Video play issue from file using OpenCV library in QT

asked 2017-02-06 04:47:48 -0600

ManuSL gravatar image

Hi,

Am new to OpenCV, trying to play video from file from Qt but unsuccessful. Following is the code am trying int VideoTest::Videoplay() {

VideoCapture cap("/home/manu/Desktop/song.mp4"); if(!cap.isOpened()) // check if we succeeded return -1;

Mat edges; namedWindow("edges",1); for(;;) { Mat frame; cap >> frame; cvtColor(frame, edges, COLOR_BGR2GRAY); GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5); Canny(edges, edges, 0, 30, 3); imshow("edges", edges); if(waitKey(30) >= 0) break; } return 0;

}

Instead of file name if i give camera number am able to open camera and display it, But video file is not opening. Please help with the solution.

edit retag flag offensive close merge delete

Comments

Any Solution For this???

ManuSL gravatar imageManuSL ( 2017-03-03 01:28:03 -0600 )edit