我得到破碎的ffmpeg错误,而VideoWrite使用X264 Fourcc编解码器.我已经安装了所有的依赖.我怎么能纠正这个问题.我一直在使用的示例代码如下.
VideoWriter oVideoWriter ("path.mp4", CV_FOURCC('X','2','6','4'), 15, frameSize, false);
操作系统:Ubuntu 14.04 64-bit
控制台错误:
[libx264 @ 0x8d6220] broken ffmpeg default settings detected
[libx264 @ 0x8d6220] use an encoding preset (e.g. -vpre medium)
[libx264 @ 0x8d6220] preset usage: -vpre <speed> -vpre <profile>
[libx264 @ 0x8d6220] speed presets are listed in x264 --help
[libx264 @ 0x8d6220] profile is optional; x264 defaults to high
Could not open codec 'libx264': Unspecified errorOpenCV Error: Unsupported format or combination of formats (Your version of Gstreamer doesn't support this codec acutally or needed plugin missing.) in CvVideoWriter_GStreamer::open, file /home/mbox140/Development/opencv-2.4.9/modules/highgui/src/cap_gstreamer.cpp, line 518
terminate called after throwing an instance of 'cv::Exception'
what(): /home/mbox140/Development/opencv-2.4.9/modules/highgui/src/cap_gstreamer.cpp:518: error: (-210) Your version of Gstreamer doesn't support this codec acutally or needed plugin missing. in function CvVideoWriter_GStreamer::open
建议我任何解决方案。
4条答案
按热度按时间j2datikz1#
对于错误:
你可能需要命令-vpre perset(e.g. -vpre fast).也许你libx 264太老了.我在使用2014年内置的ffmpeg时遇到了同样的错误.
anhgbhbe2#
我不记得你是否需要重新构建
opencv
与开放h264
支持,但可以肯定的是,标准opencv
不提供h264
编解码器。这里有一个提示:http://answers.opencv.org/question/104346/how-to-encode-a-h264-video-on-windows/
xzv2uavs3#
请安装libx 264-dev并试着编译openvc3.0.按照这个link
q5iwbnjs4#
您可能希望确保您拥有最新版本的libx264编解码器。您可以通过以下方式做到这一点:
该错误还表明GStreamer没有必要的插件。您可以使用以下方法安装GStreamer插件: