[FFmpeg-user] 2 pass CBR or VBR not really fixing the bitrate?

Eric Wilde ewilde at gntrains.com
Sun Jul 30 07:00:15 EEST 2017


At 12:37 AM 7/30/2017 +0200, Moritz Barsnick wrote:
>Are you talking audio? Yes, libmp3lame hits the target bitrate (be it
>ABR or CBR) pretty much spot on. But Manuel obviously asked about
>video:

Yes, you're right.  I completely missed that, since CBR makes no sense
to me, for video.  As you said, the goal of two pass encoding is to hit
an average bitrate -- which ffmpeg does quite well.

I'm not sure why you'd try to force the codec to have no variations
from the average bit rate because that's not how it works.  Lower bit
counts on frames that don't need a lot of bits (e.g. all black) make
up for higher bit counts on frames that do need a lot of bits (e.g.
motion).  The first pass basically encodes the frames with no limits
and writes their bit counts to the pass file.  The second pass can
then alter how much more it compresses high bit count frames (than the
first pass did) so that it hits the target bit rate.  The average is
all that matters.

But, I'm stating the obvious.  And, I'm probably still missing the
point.  So, I'll clam up and let wiser souls jump in.

                                    Eric




More information about the ffmpeg-user mailing list