0

Based on CRF Guide (Constant Rate Factor in x264, x265 and libvpx), quoting:

Streaming nowadays is done a little more cleverly. YouTube or Netflix are using 2-pass or even 3-pass algorithms, where in the latter, a CRF encode for a given source determines the best bitrate at which to 2-pass encode your stream. They can make sure that enough bitrate is reserved for complex scenes while not exceeding your bandwidth.

also the article Saving on Encoding and Streaming: Deploy Capped CRF also claims that "Capped CRF" is the highest quality while also making sure bitrate does not go above X but they propose a single pass with:

ffmpeg -i input_file -crf 23 -maxrate 6750k -bufsize 6750k output_file

What's the correct way to generate the highest quality possible file inside a bitrate constraint using ffmpeg with x264?

  • 1
    I'd hazard a guess that unless you were dealing with the volume of content that YT and NF are, the small decreases in file size probably aren't going to give you a good return on the time spent doing the extra passes. But I don't know your use case. – stib Jul 23 at 12:48
  • @stib Time is not relevant, as long it stays under 24 hours for a 3 hour input. Saving on the bitrate while delivering very high video quality is the goal – Freedo Jul 23 at 21:27
1

What's the correct way to generate the highest quality possible file inside a bitrate constraint using ffmpeg with x264?

There is no "correct" way. This is still an evolving area of research, and about half the articles you have read on the subject are more marketing that they are science. The "correct" way may also be different for every video. Netflix for example just encodes the video a couple dozen ways, and keeps the one it thinks is best and throws the rest away.

The closest thing to a "best" single answer, would be 2 pass placebo capped CRF.

  • Ok but still, which one is better, single pass CRF capped or the other ? – Freedo Jul 23 at 21:39
  • “Best” is not caped CRF next I guess would be 2 pass caped CRF – SlimSCSI Jul 23 at 21:41
  • Best quality inside a X bitrate – Freedo Jul 23 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.