Skip to main content

Two-Pass Encoding vs CRF: Which Is Better for Video?

Two-pass encoding runs a video through the encoder twice: once to analyze it, once to hit an exact bitrate. How it compares to CRF, with FFmpeg commands.

Convert MKV to MP4

CRF quality encoding applied automatically

MKV MP4

Tap to choose your file

or

Supports M4A, WAV, FLAC, OGG, AAC, WMA, AIFF, OPUS • Max 100 MB

Two-Pass Encoding in FFmpeg

Pick the target size, turn it into a bitrate, then run two passes. Example: a 10-minute video that must fit in 100 MB: 100 × 8,000 ÷ 600 s ≈ 1,333 kbps in total; minus 128 kbps of audio leaves about 1,200 kbps for video.

  • ffmpeg -y -i input.mkv -c:v libx264 -preset medium -b:v 1200k -pass 1 -an -f null /dev/null — pass 1 (analysis only). On Windows, write NUL instead of /dev/null.
  • ffmpeg -i input.mkv -c:v libx264 -preset medium -b:v 1200k -pass 2 -c:a aac -b:a 128k output.mp4 — pass 2 (the real encode).

Both passes must use the same video settings. FFmpeg writes the analysis to ffmpeg2pass-0.log in the current folder; pass 2 reads it, and you can delete it afterwards.

The Fundamental Difference

CRF and two-pass encoding solve the same problem — balancing quality against file size — but from opposite directions:

  • CRF (Constant Rate Factor): "I want this quality level. Give me whatever file size is needed to achieve it." You control quality; file size is the variable.
  • Two-pass: "I want this file size (target bitrate). Give me the best quality that fits." You control file size; quality is the variable.
Feature CRF Two-Pass
You control Quality level (CRF number) Target bitrate / file size
Variable File size Quality
Passes 1 (single pass) 2 (analyze + encode)
Speed 1x (baseline) ~2x slower
File size prediction Unpredictable Predictable
Quality consistency Constant quality per frame Optimal bit distribution

How CRF Works

CRF encoding is a single-pass process. The encoder processes each frame and asks: "How many bits do I need to achieve this quality level for this specific frame?"

  • High-complexity frames (explosions, fast motion) receive more bits
  • Low-complexity frames (static shots, title cards) receive fewer bits
  • The quality stays constant; the bitrate fluctuates

The result is a variable bitrate (VBR) file where every frame gets exactly the bits it needs — no waste on simple scenes, no starvation on complex ones. This is why CRF produces the optimal quality-to-size ratio for offline encoding.

How Two-Pass Works

Two-pass encoding processes the video twice:

  1. Pass 1 (Analysis): The encoder scans the entire video without producing output. It builds a frame-by-frame complexity map — which scenes are simple, which are complex, where scene changes occur.
  2. Pass 2 (Encoding): Using the analysis from pass 1, the encoder distributes the target bitrate optimally across all frames. Complex scenes get more of the bitrate budget; simple scenes get less.

The result: a file that precisely hits the target bitrate while distributing quality as evenly as possible across all scenes.

Quality Comparison

At sensible settings, CRF and two-pass produce nearly identical quality. The differences are subtle:

  • CRF advantage: Every frame gets exactly the bits it needs. No frame is ever starved. CRF may produce slightly better average quality because it's not constrained by a bitrate budget.
  • Two-pass advantage: Better bit distribution for extreme content (long videos with wildly varying complexity). The analysis pass helps the encoder prepare for upcoming complex scenes.

In practice, the quality difference between CRF and a well-targeted two-pass encode is negligible for most content. You would need frame-by-frame VMAF analysis to detect differences.

Speed Comparison

The speed difference is straightforward:

  • CRF: 1x encoding time (single pass through the video)
  • Two-pass: ~1.7–2x encoding time (first pass is fast since it doesn't produce output, but still takes time)

For a 10-minute 1080p video on a modern CPU:

  • CRF medium: about 10 minutes at ~30 fps encoding speed (18,000 frames ÷ 30 fps = 600 s)
  • Two-pass medium: about 17–20 minutes, since the first pass runs faster than the second. A faster preset shortens both passes; our FFmpeg presets guide to speed vs file size shows the trade-off.

When to Use CRF

CRF is the better choice for almost all common scenarios:

  • File conversion: MKV to MP4, MOV to MP4, any format conversion where you want the best quality
  • Personal archival: Storing your video library at consistent quality
  • Web upload: YouTube, social media, and most platforms accept variable bitrate files
  • Sharing: When file size doesn't need to be exact, CRF gives optimal quality
  • Batch processing: One setting (CRF 23) works well for all content types

This is why our converter uses CRF — it produces the best quality without requiring users to calculate target bitrates.

When to Use Two-Pass

Two-pass encoding is the better choice when file size must be predictable:

  • DVD/Blu-ray authoring: Content must fit on a specific disc capacity
  • Bandwidth-constrained streaming: Adaptive bitrate streaming (HLS/DASH) requires precise bitrate targets for each quality level
  • File size limits: Platforms with strict upload limits (Discord 10 MB without Nitro, email 25 MB) where you need to guarantee the output fits
  • Professional broadcast: Broadcast pipelines often require CBR or precise VBR targets

The Best of Both: Capped CRF

There is a hybrid approach called capped CRF (constrained quality) that combines the advantages of both methods:

ffmpeg -i input.mkv -c:v libx264 -crf 23 -maxrate 4000k -bufsize 8000k -c:a aac output.mp4

This tells the encoder: "Target CRF 23 quality, but stay at or under about 4 Mbps (averaged over the 8,000-kbit buffer, about 2 seconds)." In practice:

  • Simple scenes: encoded at CRF 23 quality (well below 4 Mbps)
  • Complex scenes: encoded at CRF 23 quality unless it would exceed 4 Mbps, in which case quality is slightly reduced to stay within the cap

Capped CRF is ideal for streaming applications where you need bandwidth predictability without sacrificing CRF's quality-first approach.

VBR 1-Pass vs 2-Pass in Premiere Pro, Media Encoder and HandBrake

  • Premiere Pro and Adobe Media Encoder: in the H.264 export settings, Bitrate Encoding offers CBR, VBR 1 pass and VBR 2 pass. VBR 2 pass takes longer and usually distributes bits better at the same target.
  • HandBrake: on the Video tab, switch from Constant Quality to Avg Bitrate, then turn on two-pass (labelled 2-Pass or Multi-Pass Encoding, depending on the version).
  • Rule of thumb: at generous bitrates 1-pass and 2-pass look the same; the second pass pays off when the bitrate is tight for the content.

Ready to Convert?

Convert with CRF quality encoding for optimal results

MKV MP4

Tap to choose your file

or

Supports M4A, WAV, FLAC, OGG, AAC, WMA, AIFF, OPUS • Max 100 MB

Frequently Asked Questions

Not necessarily. Both produce similar quality at reasonable bitrates. CRF is faster (one pass) and produces optimal quality per bit. Two-pass is only better when you need a specific file size. For most users, CRF is the recommended approach.

No. YouTube’s published upload settings list recommended bitrates and ask for variable bitrate, not a number of passes. Two-pass is one way to land on those bitrates, but CRF 18–20 works just as well because YouTube re-encodes every upload.

CRF. It produces the best quality without requiring users to guess at bitrate targets. CRF automatically allocates bits where they're needed most, resulting in optimal quality for any content type.

Yes, this is called "capped CRF" or constrained quality. Add -maxrate and -bufsize flags to your FFmpeg command. It targets CRF quality but never exceeds the specified maximum bitrate. Useful for streaming where bandwidth is limited.

No. Two-pass needs the whole video before the second pass starts, so live streams use single-pass CBR or capped VBR instead.

Not in the usual sense. CRF is a single-pass quality target, while two-pass needs a target bitrate (-b:v). If you want both, use capped CRF with -maxrate and -bufsize.

More MKV to MP4 Guides

MKV vs MP4: Which Container Should You Choose?
MKV vs MP4 compared: codec support, subtitle tracks, device compatibility, and when to use each container format.
H.264 vs H.265 (HEVC): Which Video Codec Is Better?
H.264 vs H.265 codec comparison: quality, file size, encoding speed, hardware support, and compatibility.
MKV to MP4 Without Losing Quality: Complete Guide
Convert MKV to MP4 losslessly via remuxing or with minimal quality loss. CRF settings and codec compatibility explained.
Container vs Codec: What's the Difference?
Understand the difference between video containers (MKV, MP4, AVI) and codecs (H.264, H.265, VP9). Essential knowledge for video conversion.
CRF Quality Guide: H.264 & H.265 Settings Explained
Master CRF (Constant Rate Factor) settings for H.264 and H.265. Quality vs file size tradeoffs with visual examples.
FFmpeg Presets: Speed vs Quality vs File Size
FFmpeg encoding presets from ultrafast to veryslow. Benchmark data showing quality and speed tradeoffs for each preset.
Frame Rate Guide: 24 vs 30 vs 60 FPS Explained
Video frame rates explained: 24 fps for film, 30 fps for TV, 60 fps for gaming. When to change FPS during conversion.
Pixel Format YUV420p: Why It Matters for Video Compatibility
Why yuv420p is required for universal video playback. Chroma subsampling, color depth, and compatibility with every device.
MKV Subtitles: How to Handle Multiple Tracks
Handle MKV subtitle tracks during conversion: extract SRT, burn-in SSA/ASS, and preserve subtitle data when converting to MP4.
Back to MKV to MP4 Converter

Request a Feature

0 / 2000