I ran into issues with VideoWriter coding flv, so I found hope by forums claiming I should install all sorts of codecs + FFMPEG manually from source, and rerun cmake + make + make install in opencv 2.4.5 directory. cmake claimed it found all the required FFMPEG dependencies and will use them (However, I did not explicitly tell cmake to do so...).
Then, I attempted:
out.open("/home/dror/Videos/IMG-0.flv", CV_FOURCC('F','L','V','1'), cap.get(CV_CAP_PROP_FPS), S, true);
And it blessed me with:
[flv @ 0x173f7a0] Tag FLV1/0x31564c46 incompatible with output codec id '22' ([2][0][0][0])
OpenCV Error: Unsupported format or combination of formats (Gstreamer Opencv backend doesn't support this codec acutally.) in CvVideoWriter_GStreamer::open, file /home/dror/src/opencv/modules/highgui/src/cap_gstreamer.cpp, line 505
terminate called after throwing an instance of 'cv::Exception'
what(): /home/dror/src/opencv/modules/highgui/src/cap_gstreamer.cpp:505: error: (-210) Gstreamer Opencv backend doesn't support this codec acutally. in function CvVideoWriter_GStreamer::open
I changed the file extension:
out.open("/home/dror/Videos/IMG-0.avi", CV_FOURCC('F','L','V','1'), cap.get(CV_CAP_PROP_FPS), S, true);
And it worked fine. (If you belive ffmpeg -i
output)..
Possible reasons:
- I didn't EXPLICITLY tell cmake to use FFMPEG.
- The sources I used don't reside in
/usr/src
? - I should have purged manually opencv installation before reinstalling..?
- I'm using too old a version of ffmpeg..? (ffmpeg-0.11.1)
- This is a peculiar bug..
- This is where you come in! :)
Help!