Build a two-pass ffmpeg H.264 encode for constrained bitrate delivery

domain: ffmpeg.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Run pass 1 with -pass 1 and the target -b:v, discarding output to a null muxer.
  2. Set -maxrate and -bufsize alongside -b:v to cap peak bitrate for constrained VBR delivery.
  3. Run pass 2 with the same -b:v/-maxrate/-bufsize values and -pass 2, writing the actual output file.
  4. Keep both passes on identical encoder settings (codec, resolution, GOP size), since mismatches invalidate the pass-1 statistics.
  5. Verify the resulting file's average bitrate against the target using ffprobe.

Known gotchas

Related routes

Build an ffmpeg ABR encoding ladder for HLS delivery
ffmpeg · 5 steps · unrated
Run FFmpeg's loudnorm two-pass workflow for accurate EBU R128 loudness normalization
ffmpeg.org · 6 steps · unrated
Implement two-pass EBU R128 loudness normalization with FFmpeg's loudnorm filter to hit a precise integrated loudness target
ffmpeg.org · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans