Ask Your Question

Revision history [back]

avi files not opening in OpenCV (running on Raspberry Pi)

I have installed OpenCV on my Raspberry Pi B+ (Raspbian) and am trying to run video processing algorithms on it. The algorithms are working fine on my laptop running Ubuntu. On my raspberry pi, the avi files are not opening for some reason. They should pop up as a new window when I run my executable. Here is the screenshot of the terminal when I run the executable-

image description

The error says "Cannot open the video file". The same OpenCV files run perfectly fine in Ubuntu. So is this an issue with Raspbian or with the way OpenCV was installed ? I am not able to figure out the problem.

Should I install any additional packages/tools on raspberry pi so that the avi files open ? (However, Images are popping up on a new window perfectly fine. Only videos are not working)

Note-My current OpenCV has been configured to run with Qt instead of GTK.

The OpenCV code snippet is:

int main(int argc, char* argv[],int argp) { VideoCapture cap("/home/pi/BMSCE/openCV/CaptureVID/MyVideo.avi"); // open the video file for reading

if ( !cap.isOpened() ) // if not success, exit program { cout << "Cannot open the video file" << endl; return -1; } ..... .....

Thank you !