[FFmpeg-user] 2 pass encoding with hevc_nvenc

Nicolas George george at nsup.org
Sun Sep 4 14:01:00 EEST 2016


Le nonidi 19 fructidor, an CCXXIV, Carl Eugen Hoyos a écrit :
> How is this supposed to work (in a general sense, unrelated
> to a codec or an implementation)?
> Two-pass encoding indicates constant bitrate afaict.

You are mistaken, there is no need for two passes for constant bitrate.

Two passes is necessary when local optimization does not work, i.e. when
there is need of information about the end of the file to make decisions
about the beginning.

The most obvious example is to achieve a target AVERAGE bitrate. Or,
equivalently, to achieve a target total size. For example to fit a movie on
exactly 700 Mo to burn it on a CD-R. If the second half of the movie is
unexpectedly quiet, then it will consume less bits than expected, yielding a
file of significantly less than 700 Mo: it was possible to achieve a better
overall quality. If the second half of the movie is unexpectedly nervous,
then it will consume more bits than expected, yielding a file of
significantly more than 700 Mo: it is necessary to start again with a lower
overall quality. Hence the two passes: first see what parts of the movie are
quiet and what parts are nervous, then distribute the quality evenly.

There is no need for two passes when encoding for a certain target quality,
nor for a certain target constant bitrate, or even constant on average over
a few seconds.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20160904/f565aa58/attachment.sig>


More information about the ffmpeg-user mailing list