[MEncoder-users] "requested bitrate is too low." in 2-pass x264 encoding

呂建林 x4base at gmail.com
Thu Apr 8 17:49:57 CEST 2010


Hello, everyone.
I tried to encode a file to the x264 codec
These were what I typed:
mencoder -nosound  -ovc x264 -x264encopts pass=1:bitrate=2000 -o
test.mp4   -endpos 10 shadow.flv
mencoder -nosound  -ovc x264 -x264encopts pass=2:bitrate=2000 -o
test.mp4   -endpos 10 shadow.flv

my mencoder and libx264 were compiled from the svn and git version ,respectively

the 1st-pass finished successfully. but in the 2nd pass , it
complained "x264 [error]: requested bitrate is too low. estimated
minimum is 9 kbps".
The same thing kept happening even if I set the bitrate=20000000
This is quite strange.


The following is what I tried:

I did a little code tracing and I found that in the function
init_pass2 in encoder/ratecontrol.c of the libx264 code,
there was
 if( all_available_bits < all_const_bits)
{
        x264_log( h, X264_LOG_ERROR, "requested bitrate is too low.
estimated minimum is %d kbps\n",
                 (int)(all_const_bits * rcc->fps / (rcc->num_entries *
1000.)) );
        return -1;
}

The value  [all_available_bits] is calculated from
h->param.rc.i_bitrate * 1000. * duration.
Also , the value of  [duration] is summed from
rcc->entry[i].i_duration , which , in the log file divx2pass.log, seem
to be 0 for each i.
Is it common for i_duration to be always 0?
So it seems that the expression all_available_bits < all_const_bits is
always true, and therefore mencoder keeps complaining

Did I misunderstand anything ?
If
Or I just gave  some wrong options to mencoder?

Thanks for your attention.

my system info:
2.6.30.10-105.2.23.fc11.x86_64
MEncoder SVN-r31027-4.4.1


More information about the MEncoder-users mailing list