我在使用X264 Fourcc编解码器的VideoWrite时遇到了ffmpeg错误。我已经安装了所有依赖项。如何解决这个问题。我一直使用的示例代码如下。
VideoWriter oVideoWriter ("path.mp4", CV_FOURCC('X','2','6','4'), 15, frameSize, false);
操作系统:Ubuntu 14.04 64位
控制台错误:
[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
建议我解决此问题。
答案 0 :(得分:0)
表示错误:
[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
您可能需要命令-vpre perset(例如-vpre fast)。 也许你libx264太旧了。 我在使用2014年制造的ffmpeg时遇到了同样的错误。
答案 1 :(得分:0)
我不记得您是否需要使用开放opencv
支持重新构建h264
,但可以肯定的是,标准opencv
不提供h264
编解码器。
这是一个提示:
http://answers.opencv.org/question/104346/how-to-encode-a-h264-video-on-windows/
答案 2 :(得分:0)
请安装libx264-dev并尝试使用它编译openvc3.0。请遵循此link