Used if targeting a specific output file size and output quality from frame to frame is of less importance.
This is best explained with an example.
(200 MiB * 8388.608 [converts MiB to kBit; note: not 8192 as 1 kBit is always 1000 bit]) / 600 seconds = ~2796 kBit/s total bitrate 2796 - 128 kBit/s (desired audio bitrate) = 2668 kBit/s video bitrate
For two-pass, ffmpeg is run twice, with almost the same settings, except for:
For libx265, the -pass option (that you would use for libx264) is not applicable.
ffmpeg -y -i input -c:v libx265 -b:v 8000k -x265-params pass=1 -an -f null /dev/null && \ ffmpeg -i input -c:v libx265 -b:v 8000k -x265-params pass=2 -c:a aac -b:a 320k output.mp4
NOTE: