OpenCV platform-wide videos

I am writing a video using OpenCV on a Linux machine. I want to read the same video using OpenCV on a Windows computer. I cannot do this using the standard codecs provided by openCV .

Can anyone suggest how I can read / write video on two platforms?

+4
source share
2 answers

The OpenCV Wiki directly solves this problem. See http://opencv.willowgarage.com/wiki/VideoCodecs and, in particular, the heading "Compatibility List".

Unfortunately, the only codecs supported on all three platforms (Linux, Windows, and OSX) are the "DIB" I420 and IYUV, which are uncompressed video codecs and thus make really large file sizes.

The wiki also lists some codecs to try, which can work on any two platforms, but not all three.

If you decide to use uncompressed video files, you can convert them to something with a smaller file size as soon as they are on your Windows computer using a program such as VirtualDub .


Edit: FYI. On Windows, I have OpenCV output in Motion-JPEG, and then I use VirtualDub in direct stream mode to save a file that fixes a movie index error. These M-JPEG video files are then played by default on Mac and Windows.

If I try to read a video in OpenCV, I often convert my video to Cinepak first (using virtual dub, quicktime, etc.) and then upload it to OpenCV. I use Cinepak because, for some reason, Cinepak encoders seem more common than MJPEG encoders.

+2
source

I don’t think that the problem is with OpenCV, I think it is with codecs, as you mentioned. I also don’t think OpenCV comes with codecs ... double check that you have the appropriate codecs installed under Windows.

Have you looked at the documentation for video codecs ?

+1
source

All Articles