Two ways to ask for quality
Software video encoders accept two different quality controls, and you have to know which one to use:
- CRF (Constant Rate Factor) — "keep this quality, file size is whatever it ends up." Lower number = better quality. Ranges 0 (lossless) to 51 (terrible). For libx264 the sweet spot is 18–23. For libx265 use 22–28 (HEVC's CRF scale is offset). For libsvtav1 try 25–35.
- Bitrate (-b:v) — "give me this many bits per second." Quality is whatever fits. Used when you have a target file size or are streaming under a network cap. Hardware encoders (videotoolbox, nvenc) usually require bitrate mode; they ignore CRF.
Default to CRF
For 95% of one-off jobs (uploading to YouTube, archiving, sending to a friend), use CRF. You ask for a quality and let the encoder figure out the bitrate. For libx264, CRF 18 looks visually transparent; CRF 23 is fine for casual viewing.
Use bitrate when you must (live streaming bandwidth caps, hardware encoders) or for two-pass encoding (Track 3 lesson 6) where you want a precise final file size.