[MEncoder-users] Flashvideo for YouTube using mencoder

Corey Hickey bugfood-ml at fatooh.org
Sat Feb 23 02:55:14 CET 2008


Reimar Döffinger wrote:
> On Fri, Feb 22, 2008 at 09:52:13PM +0100, Ben wrote:
>> On Fri, Feb 22, 2008 at 7:44 PM, Reimar Döffinger
>> <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
>>
>>>  When you specified a bitrate of 349kbit/s
>> Where did I do that?
> 
> The exact number does not matter for the point. Yes, I forgot to
> subtract the audio bit rate from that.
> 
>>> and your video rate lowers
>>>  that means that either 1) your codec sucks 2) you did not do two-pass
>>>  and quality will probably be bad anyway.
>> No, it means I have to change the command line to close in to the maximum.
> 
> That may be the reality since FFmpeg's rate-control is not always the
> best, but the point of rate-control is that you get _exactly_ the
> bitrate you specified (obviously this requires two-pass), there is no
> need to change the command line, because you can get it right the first
> time every time! (if rate-control works as it should, if it does not it
> might well be worth trying to find out why).

...and, furthermore, if you use one-pass encoding and happen to find
some settings that give you the bitrate you want, you'll likely find out
that those same settings result in a widely different bitrate when you
encode a different video.

On a single pass (or the first of two), lavc makes a halfhearted attempt
to meet the bitrate the user specified. I say halfhearted because lavc
can, should, and will vary the number of bits it spends on individual
frames. This makes the bitrate fluctuate widely in response to
characteristics of the input video. Lavc does not know when the video is
going to end. If the video ends during a high-motion sequence, lavc will
may have just spent many bits and the overall average bitrate will be
high; if the video ends in a low motion sequence, the overall average
could be low.

Over a longer time, the fluctuations average out and the average
single-pass bitrate for a long video will likely be somewhat close to
that requested.

Meanwhile, however, lavc may have spent too few bits on a high motion
sequence, making it look bad; or, lavc may have spent too many and not
had enough to make the following sequence look good; or, lavc may have
spent too many bits in the first half of a high-motion sequence,
realized it was deeply in debt, and then starved itself for a while.

Lavc can make quite reasonable decisions about how to allocate bits, but
only if it knows the characteristics of the input video first, hence the
reason for doing two passes. The first pass is just a preliminary analysis.


By the way, if you want lavc to meet your requested bitrate more
precisely, investigate the vratetol option. This is more relevant with
smaller videos.

-Corey



More information about the MEncoder-users mailing list