[英]How to read .mp4 files in opencv
我完全是OpenCV,C ++的新手。 嘗試閱讀mp4
視頻,但發現OpenCV不支持mp4
,它只能讀取avi
(我不確定自己寫的是不是還是錯誤的)。 經過在線研究后, ffmpeg
是將mp4
轉換為avi
進行進一步處理的最佳選擇。
我正在Visual Studio 2012中使用OpenCV 3.0 。 我看到OpenCV C:\\opencv\\build\\x86\\vc11\\bin
文件夾中有一個dll
文件opencv_ffmpeg300.dll
。 有什么方法可以使用此dll
文件讀取和轉換我的視頻嗎?
如果有人能為我提供一些指導,我將非常感激,我完全迷失在OpenCV世界中。
對於視頻,
Video I/O:
Video for Windows: YES
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: YES (prebuilt binaries)
codec: YES (ver 55.18.102)
format: YES (ver 55.12.100)
util: YES (ver 52.38.100)
swscale: YES (ver 2.3.100)
resample: NO
gentoo-style: YES
OpenNI: NO
OpenNI PrimeSensor Modules: NO
OpenNI2: NO
PvAPI: NO
GigEVisionSDK: NO
DirectShow: YES
Media Foundation: NO
XIMEA: NO
Intel PerC: NO
讓我嘗試幫助您解決問題。
首先,我建議您使用以下代碼檢查構建信息
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace cv;
int main(int argc, char** argv)
{
std::cout <<
"Using OpenCV version " << CV_VERSION << "\n" << std::endl;
std::cout << getBuildInformation();
return 0;
}
我像下面一樣閱讀mp4文件
Video I/O:
Video for Windows: YES
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: YES (prebuilt binaries)
codec: YES (ver 56.41.100)
format: YES (ver 56.36.101)
util: YES (ver 54.27.100)
swscale: YES (ver 3.1.101)
resample: NO
gentoo-style: YES
GStreamer: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
OpenNI2: NO
PvAPI: NO
GigEVisionSDK: NO
DirectShow: YES
Media Foundation: NO
XIMEA: NO
Intel PerC: NO
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.