broken ffmpeg default settings detected
Asked Answered
A

4

16

I am getting broken ffmpeg error while VideoWrite using X264 Fourcc codec.I have install all the dependencies.How can I rectify this problem.The sample code that I have been using is as follows.

VideoWriter oVideoWriter ("path.mp4", CV_FOURCC('X','2','6','4'), 15, frameSize, false);

Operating system : Ubuntu 14.04 64-bit

Console Error:

[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

Suggest me any solution for this.

Antisemite answered 3/9, 2014 at 6:8 Comment(7)
What is the actual ffmpeg command (if using the cli tools and not the API)? What is the actual, complete ffmpeg console/log output?Tims
@LordNeckbeard I have updated my question with console log,Please look into thisAntisemite
Please show the complete console output and the command too if possible.Tims
ffmpeg -i input_file -acodec libmp3lame -vcodec libx264 -y output.mp4 i am using this command , getting same errorJeanett
Are you insisting on h264? You could try using some other codec, such as MJPG for example.Lotion
Maybe your gstreamer is out of date?Diehl
Is the video playable? If your settings are wrong in OpenCV, it will create an ill-formatted video.Disbud
D
1

You might want to ensure you have the latest version of the libx264 codec. You can do this by:

sudo apt-get install --reinstall x264 libx264-dev

The error also indicates an issue with GStreamer not having the necessary plugins. You can install GStreamer plugins using:

sudo apt-get install gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly
Domingo answered 4/10, 2023 at 8:1 Comment(0)
W
0

for the error:

[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

you may need the command -vpre perset (e.g. -vpre fast). maybe you libx264 is too old. I meet the same error while using a ffmpeg built in 2014.

Witkin answered 8/8, 2016 at 12:20 Comment(1)
Since libx264 is called indirectly, there is no way to give additional ffmpeg switches on any command line.Rapture
W
0

I don't remember if you need to re build opencv with open h264 support, but for sure, standart opencv doesn't provide h264 codec. Here is a hint:

http://answers.opencv.org/question/104346/how-to-encode-a-h264-video-on-windows/

Walburga answered 5/4, 2018 at 9:23 Comment(1)
The question is about OpenCv on Linux.Rapture
E
0

please install libx264-dev and try compiling openvc3.0 with that. follow this link

Electronic answered 13/4, 2018 at 19:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.