I am trying to open a video file (.MOV,.AVI or .MP4) using OpenCV on linux. So that I can extract specific frames as images on the disc and do image processing. I have also installed ffmpeg on linux.
My code snippet is :
CvCapture* capture = cvCreateFileCapture("sample.avi");
if(!capture) // check if we succeeded
printf("Video failed to open\n");
else
printf("Video opened\n");
I cannot open an avi file. Can anyone guide me:
- Why I cannot open AVI video file using OpenCV?
- I was reading somewhere that OpenCV can only handle .avi files. So, what I will do with other movie formats?
Any help will be really appreciated . .