[MPlayer-users] [BUG] mencoder cannot encode to the required bitrate
Corey Hickey
bugfood-ml at fatooh.org
Sun Sep 3 04:43:04 CEST 2006
陆然 wrote:
> Hi,
>
> Here I found a file that cannot be encoded to the specified bitrate with lavc,
> I have tried the following command lines:
>
> mencoder -v -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=300 -o
> test.avi rate_control.avi
>
> gives me a test.avi with ~250 kbit/s
[and so on]
> I'm using SVN-r19632, and the output does not give something suspicious,
> anyway you can download the sample (12M) at
>
> http://qterm.sf.net/rate_control.avi
Your original video was soft telecined. The video you uploaded should
have been encoded with '-ofps 24000/1001'. That's why there were so many
"duplicate frames" messages. Large numbers of duplicate frames make
lavc's ratecontrol aim too low, since lavc never actually sees those
duplicates. That's why you thought '-vf harddup' fixed the problem,
since harddup actually encodes duplicate frames rather than leaving them
empty. Harddup is not the right thing to do, here. There's no good way
to fix your rate_control.avi, so you should re-encode it from the source
(a DVD?) and make sure to use '-ofps 24000/1001' this time.
Also, don't expect a 1-pass encode to meet the target bitrate very well.
That's just a best-effort approximation. Always use 2-pass encoding
unless you have a reason not to.
Also, don't expect encoding a short video to meet the target bitrate
very closely. Lavc's tolerance is based on final video size, not
bitrate, so a small difference in the final size of a short video can
have a moderate effect on bitrate. If you really have to get a precise
bitrate for some reason, adjust the vratetol lavc parameter. Doing so
will have a very slightly detrimental effect on the resultant video quality.
-Corey
More information about the MPlayer-users
mailing list