[Libav-user] ffmpeg+libx264+broken ffmpeg default settings detected
jarno ralli
jarnor at atc.ugr.es
Tue Feb 12 14:38:50 CET 2013
Dear all,
This is the first time I post here, so please do forgive me if I'm
posting to wrong place etc. In any case, I have the infamous "broken
ffmpeg default settings detected" when using OpenCV+ffmpeg+libx264 in
Kubuntu 12.10. I have the latest git:ted versions of everything (12 Feb
2013) and I have compiled ffmpeg, x264 etc. as per
http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide.
When trying to write video using H.264 in OpenCV it uses ffmpeg library
for this purpose. However, when opening the stream I get the following:
[libx264 @ 0x20f7d00] broken ffmpeg default settings detected
[libx264 @ 0x20f7d00] use an encoding preset (e.g. -vpre medium)
[libx264 @ 0x20f7d00] preset usage: -vpre <speed> -vpre <profile>
[libx264 @ 0x20f7d00] speed presets are listed in x264 --help
[libx264 @ 0x20f7d00] profile is optional; x264 defaults to high
Could not open codec 'libx264': Unspecified error
Which is caused by (x264/encoder/encoder.c):
/* Detect default ffmpeg settings and terminate with an error. */
if( b_open )
{
int score = 0;
score += h->param.analyse.i_me_range == 0;
score += h->param.rc.i_qp_step == 3;
score += h->param.i_keyint_max == 12;
score += h->param.rc.i_qp_min == 2;
score += h->param.rc.i_qp_max == 31;
score += h->param.rc.f_qcompress == 0.5;
score += fabs(h->param.rc.f_ip_factor - 1.25) < 0.01;
score += fabs(h->param.rc.f_pb_factor - 1.25) < 0.01;
score += h->param.analyse.inter == 0 &&
h->param.analyse.i_subpel_refine == 8;
if( score >= 5 )
{
x264_log( h, X264_LOG_ERROR, "broken ffmpeg default
settings detected\n" );
x264_log( h, X264_LOG_ERROR, "use an encoding preset (e.g.
-vpre medium)\n" );
x264_log( h, X264_LOG_ERROR, "preset usage: -vpre <speed>
-vpre <profile>\n" );
x264_log( h, X264_LOG_ERROR, "speed presets are listed in
x264 --help\n" );
x264_log( h, X264_LOG_ERROR, "profile is optional; x264
defaults to high\n" );
return -1;
}
}
Now, I have a question: where do these defaults came from...are these
set in ffmpeg/libavcodecs/libx264.c:
static const AVCodecDefault x264_defaults[] = {
{ "b", "0" },
{ "bf", "-1" },
{ "flags2", "0" },
{ "g", "-1" },
{ "qmin", "-1" },
{ "qmax", "-1" },
{ "qdiff", "-1" },
{ "qblur", "-1" },
{ "qcomp", "-1" },
// { "rc_lookahead", "-1" },
{ "refs", "-1" },
{ "sc_threshold", "-1" },
{ "trellis", "-1" },
{ "nr", "-1" },
{ "me_range", "-1" },
{ "me_method", "-1" },
{ "subq", "-1" },
{ "b_strategy", "-1" },
{ "keyint_min", "-1" },
{ "coder", "-1" },
{ "cmp", "-1" },
{ "threads", AV_STRINGIFY(X264_THREADS_AUTO) },
{ "thread_type", "0" },
{ "flags", "+cgop" },
{ "rc_init_occupancy","-1" },
{ NULL },
};
My ffmpeg gives the following information:
ffmpeg version N-38355-ge2b703f Copyright (c) 2000-2013 the FFmpeg
developers
built on Feb 12 2013 14:31:31 with gcc 4.7 (Ubuntu/Linaro 4.7.2-2ubuntu1)
configuration: --enable-gpl --enable-libass --enable-libfaac
--enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-librtmp --enable-libtheora
--enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264
--enable-nonfree --enable-version3 --enable-shared
libavutil 52. 17.101 / 52. 17.101
libavcodec 54. 91.102 / 54. 91.102
libavformat 54. 62.100 / 54. 62.100
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 37.101 / 3. 37.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Hyper fast Audio and Video encoder
I would be really grateful if someone could give me a hand here!!!
All the best,
Jarno
More information about the Libav-user
mailing list