[FFmpeg-user] formula for transcoding to ogv, shrinking an mkv

Carl Eugen Hoyos cehoyos at ag.or.at
Fri Jan 18 18:52:18 CET 2013

Tom Evans <tevans.uk <at> googlemail.com> writes:

> So, *iff* you have a target file size, you can easily calculate a
> bitrate, and then do a 2-pass encoding with that target bitrate. This
> will produce a file of exactly your size limit.
> Alternatively, you can encode with a crf and no target bitrate. This
> will produce you a file of known quality, but unknown size. The size
> will depend on the bitrate required to produce the quality requested.
> Adjust the crf until the end size is below your limit.
> If you then compare the two files, they will be very similar quality -
> the one produced by crf will have a slightly lower bitrate than the
> 2-pass encode - which should be obvious, the crf encoded file is less
> than your size limit, the 2-pass encoded file is your size limit, and
> the two have the same length video! - and, since the bitrates are
> probably quite similar, the quality should also be similar.

While I am certainly not the encoding parameter 
expert, allow me to add that this is definitely 
not true in the general case (where the movie 
has different scenes that need different bit-rates 
to get the same overall quality)!

In the specific mentioned case (screen-casting), 
it may work fine, but it still needs some trial-
and-error to get the right value for crf, while 
2-pass encoding will "automatically" succeed.
(Assuming the rate-control works fine;-) )

Carl Eugen

More information about the ffmpeg-user mailing list