Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load Captures in OpenCV

Tags:

opencv

Which video formats can we use in OpenCV? Can anything in addition to AVI and load from camera be used? If these are the only supported formats, is a video converter required to use other video formats.

like image 438
Milad R Avatar asked Mar 22 '26 02:03

Milad R


1 Answers

I'm not sure how up-to-date it is, but this OpenCV wiki page gives a good overview of what codecs are supported. If looks like AVI is the only format with decent cross-platform support. Your options are either to do the conversion using an external converter (like you suggest) or write code that uses a video library to load the image and create the appropriate cv::Mat or IplImage * header for the data.

Unless you're processing huge quantities of video I suggest taking the path of least resistance and just converting the videos to AVI (see the above link for the details of what OpenCV supports). Just be careful to avoid lossy compression: it will wreck havoc with a lot of image processing algoritms.

like image 100
Michael Koval Avatar answered Mar 25 '26 01:03

Michael Koval