【发布时间】:2020-01-15 12:14:15
【问题描述】:
我正在尝试打开视频并将其写入某个位置:
#include <opencv2/opencv.hpp>
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "iostream"
using namespace cv;
using namespace std;
int main()
{
string videoName = "KorExp3.avi";
VideoCapture video(videoName);
Mat frame;
video >> frame;
VideoWriter w("D:/w.avi", CV_FOURCC('M', 'P', '4', '2'), 30, frame.size(), true);
while (true) {
video >> frame;
imshow("frame", frame);
w << frame;
}
w.release();
waitKey(0);
return 0;
}
在调试模式下,将鼠标悬停在video 上会显示:
信息不可用,没有为 opencv_world340d.dll 加载符号
我已将此 dll 文件和视频文件复制到 .exe 的同一位置,但仍然发生相同的情况。我还尝试了视频string videoName = "D:\\KorExp3.avi";的绝对路径,但没有成功。
如何使用 openCV 捕获视频并将其写入某个位置?
【问题讨论】:
标签: c++ opencv video-capture