GlossaryTwo-pass encoding

Two-pass encoding

Two-pass encoding is a way of compressing video where the encoder analyzes the whole video in a first pass, then uses that information to distribute bits more efficiently in a second pass. Because the encoder already knows where the hard scenes are, the second pass can meet a set file size or average data rate with better quality than one pass alone. It roughly doubles analysis time and cannot be used for live streams.

Why it matters

Two-pass encoding gives on-demand libraries better quality for a fixed size or bitrate, which matters when delivery and storage budgets are set in advance. It roughly doubles analysis work, so it adds cost and time per title and is not an option for live streams.

How it works

  1. In the first pass, the encoder reads the whole video and logs how complex each scene is.
  2. It saves those statistics to a log file instead of producing final output.
  3. In the second pass, it uses the log to give more bits to hard scenes and fewer to easy ones.
  4. The result hits the target file size or average bitrate with more even quality across the video.

Is two-pass encoding better than one-pass?

Yes, when you must hit a specific file size or average bitrate, two-pass usually gives better quality. One-pass with a quality target, such as CRF, can match it when file size can vary. Two-pass takes longer and cannot be used for live video.

When should I use two-pass encoding?

Use two-pass when you need a predictable file size or bitrate for on-demand video, such as building an adaptive bitrate ladder with strict caps or fitting a size limit. Skip it for live streams and quick turnaround uploads, where the extra time matters more than the gain.

Where it's used

OTT services and video platforms use two-pass encoding for on-demand titles where consistent quality and predictable file sizes matter. Live streams and short video apps skip it because it takes longer.