Broken ffmpeg settings when writing video

asked 2016-03-09 04:42:31 -0600

frageDE gravatar image

I have an OpenCV (2.4.9) application written in C++, which takes a video as input, processes it, and records the results as video as well. It works for 3 out of 4 videos on mine, but with 1 video it does not record, which is weird.

I initialize the writer object like this:

// Load input video
VideoCapture captureIn(videoPathRGB);

// Setup output video according to the input video
VideoWriter output_cap(videoPathResult, captureIn.get(CV_CAP_PROP_FOURCC), captureIn.get(CV_CAP_PROP_FPS), cv::Size(captureIn.get(CV_CAP_PROP_FRAME_WIDTH), captureIn.get(CV_CAP_PROP_FRAME_HEIGHT)));

and then after the processing step, I write it with:

// record the stream by passing the modified frame at each step

and of course, at the end I finish with:

// do the cleaning

The videos I process are all mp4 files with around 1-2 minutes. Normally this works, but with 1 specific video I get the following error:

[libx264 @ 0xa64b20] broken ffmpeg default settings detected
[libx264 @ 0xa64b20] use an encoding preset (e.g. -vpre medium)
[libx264 @ 0xa64b20] preset usage: -vpre <speed> -vpre <profile>
[libx264 @ 0xa64b20] speed presets are listed in x264 --help
[libx264 @ 0xa64b20] profile is optional; x264 defaults to high
Could not open codec 'libx264': Unspecified error

And obviously it does not record.

Any thoughts?

edit retag flag offensive close merge delete


I have absolutely same problem. Have you(read: anybody) found the solution?

zazazasaza gravatar imagezazazasaza ( 2017-07-21 05:47:54 -0600 )edit