Reference

Two-Pass Encoding

Two-pass encoding compresses video in two stages: a first pass analyzes the whole clip's complexity, and a second pass uses that data to distribute bitrate intelligently. It hits a target file size more accurately than single-pass encoding.

Photos & videoGeneral

Two-Pass Encoding

Also known as: 2 pass encoding, two pass video, two pass encoding

Two-pass encoding compresses video in two stages: a first pass analyzes the whole clip's complexity, and a second pass uses that data to distribute bitrate intelligently. It hits a target file size more accurately than single-pass encoding.

  • First pass analyzes complexity; second pass allocates bitrate using that analysis.
  • Best for hitting an exact target file size, unlike quality-targeted CRF.
  • Roughly doubles encoding time compared to single-pass.

How the two passes work

In the first pass, the encoder scans the entire video and records statistics about each scene's complexity, writing them to a log file rather than producing final output. Fast-moving or detailed scenes are flagged as needing more data; static or simple scenes are flagged as needing less.

In the second pass, the encoder re-runs the compression using those statistics to allocate bitrate where it matters most. The result is a more even perceived quality and, crucially, a final file that lands very close to a chosen target file size or average bitrate.

Two-pass vs. single-pass and CRF

Single-pass encoding makes decisions on the fly without knowing what comes next, so it either overshoots quality early and runs short later, or wastes bits. It is faster but less predictable for hitting an exact size.

Constant rate factor (CRF) targets a consistent quality level and lets the file size float, which is ideal when size is not constrained. Two-pass is the better choice when you must fit a hard size limit, such as an upload or attachment cap, because the analysis pass lets the encoder plan the whole bitrate budget in advance. The tradeoff is that two-pass takes roughly twice as long to encode.

Why it matters for compressing phone videos

Phone clips, especially 4K video and high-bitrate recordings, are some of the largest files on a device. When the goal is a specific smaller size rather than just lower quality, two-pass encoding produces the best-looking result for that exact size because it spends the bitrate budget where the eye notices it most.

Cleanor's companion video compressor uses size-targeted encoding so you can shrink large recordings to a chosen size while keeping quality high, then free the original storage. Two-pass is the technique behind hitting that target reliably instead of guessing at a bitrate.

Related terms

Keep reading the reference.

Act on it

Guides and tools for this topic.