Load Captures in OpenCV

后端 未结 2 1733
清歌不尽
清歌不尽 2021-01-21 03:59

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

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-21 04:24

    OpenCV "farms out" video encoding and decoding to other libraries (e.g., ffmpeg and VFW). Also, have a look at the highgui source directory to see all of the VideoCapture wrappers available (specifically pay attention to the cap_* implementations). AVI is merely a container, and really isn't that critical to what video codecs that OpenCV can read. AVI can contain several different combinations of video, audio, and even subtitle streams. See my other answer about this. Here is also a quick article explaining the differences between containers and codecs.

    So, if you're on Linux make sure ffmpeg supports decoding the video codec you are interested in processing. You can check what codecs your version of ffmpeg supports with the following command:

    ffmpeg -formats
    

    On Windows, you'll want to make sure you have plenty of codecs available to decode various types of video like the K-Lite Codec Pack.

提交回复
热议问题