本文介绍了OpenCV VideoWriter无法打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
运行带有OpenCV 2.4.8(预构建的二进制文件)的Windows 7,x64.
Running Windows 7, x64 with OpenCV 2.4.8 (pre-built binaries).
尝试以下基本代码:
VideoWriter wrt;
wrt.open("video.mp4", -1, 29, Size(480, 640));
这什么都不做.选择编解码器的预期弹出窗口没有打开,或者编写器也没有打开(即,对wrt.isOpen()
的调用返回false).另外,编写器类wrt.writer
中的内部指针保持为空.
This does nothing. The expected popup for codec selection does not open, nor is the writer getting open (i.e. a call to wrt.isOpen()
returns false). Also, the internal pointer inside the writer class wrt.writer
remains null.
尝试:
- 调试和发布OpenCV二进制文件.
- 根据此将
opencv_ffmpeg248.dll
复制到可执行文件的目录中 - 传递专用编解码器代码,例如
CV_FOURCC('M','P','4','2')
和其他代码. - 击中计算机.
- Both Debug and Release OpenCV binaries.
- Copying
opencv_ffmpeg248.dll
to the executable's directory according to this. - Passing exclusive codec codes such as
CV_FOURCC('M','P','4','2')
and others. - Hitting the computer.
没有任何效果.任何帮助/方向将不胜感激.
Nothing worked. Any help/direction would be appreciated..
推荐答案
尝试VideoWriter wrt;wrt.open("video.avi", -1, 29, Size(480, 640));
TryVideoWriter wrt;wrt.open("video.avi", -1, 29, Size(480, 640));
这篇关于OpenCV VideoWriter无法打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!