Opencv 检测到损坏的ffmpeg默认设置

Opencv 检测到损坏的ffmpeg默认设置,opencv,ffmpeg,video-capture,h.264,libx264,Opencv,Ffmpeg,Video Capture,H.264,Libx264,在使用X264 Fourcc编解码器进行视频写入时,我遇到了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 [

在使用X264 Fourcc编解码器进行视频写入时,我遇到了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
[libx264@0x8d6220]检测到ffmpeg默认设置已损坏
[libx264@0x8d6220]使用编码预设(例如-vpre介质)
[libx264@0x8d6220]预设用法:-vpre-vpre
[libx264@0x8d6220]速度预设在x264--帮助中列出
[libx264@0x8d6220]配置文件是可选的;x264默认为高
无法打开编解码器“libx264”:未指定错误opencv错误:不支持的格式或格式组合(您的Gstreamer版本不支持此编解码器,或者缺少所需的插件)。在CvVideoWriter\u Gstreamer::open中,file/home/mbox140/Development/opencv-2.4.9/modules/highgui/src/cap\u Gstreamer.cpp,第518行
在引发“cv::Exception”的实例后调用terminate
what():/home/mbox140/Development/opencv-2.4.9/modules/highgui/src/cap_gstreamer.cpp:518:error:(-210)您的gstreamer版本不支持此编解码器,或者缺少所需的插件。函数中CvVideoWriter\u GStreamer::open
请为我提供任何解决方案。

有关错误:

[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
[libx264@0x8d6220]检测到ffmpeg默认设置已损坏
[libx264@0x8d6220]使用编码预设(例如-vpre介质)
[libx264@0x8d6220]预设用法:-vpre-vpre
[libx264@0x8d6220]速度预设在x264--帮助中列出
[libx264@0x8d6220]配置文件是可选的;x264默认为高
您可能需要命令-vpre-perset(例如-vpre-fast)。 也许你的libx264太老了。
我在使用2014年构建的ffmpeg时遇到了相同的错误。

我不记得您是否需要使用open
h264
支持重新构建
opencv
,但可以肯定的是,standart
opencv
不提供
h264
编解码器。 这里有一个提示:


请安装libx264 dev并尝试用它编译openvc3.0。按照此操作

实际的
ffmpeg
命令是什么(如果使用cli工具而不是API)?实际完整的
ffmpeg
console/log输出是什么?@LordNeckbeard我已经用console log更新了我的问题,请查看此问题。如果可能,请显示完整的console输出和命令。ffmpeg-I input_file-acodec libmp3lame-vcodec libx264-y output.mp4我正在使用此命令,同样的错误你坚持要h264吗?您可以尝试使用其他编解码器,例如MJPG。问题是关于Linux上的OpenCv。由于libx264是间接调用的,因此无法在任何命令行上提供额外的ffmpeg开关。