Skip to content
Encoding & Compression

Best Video Encoding Settings for Streaming (Bitrate Ladder)

Proven HLS and DASH encoding settings: bitrate ladders for H.264, HEVC and AV1, keyframes, segment length, audio and FFmpeg commands.

Best Video Encoding Settings for Streaming (Bitrate Ladder)
On this page 11 sections

Your encoding settings decide how good your stream looks, how often it buffers and how much you pay your CDN every month. Get them right and viewers on fibre see crisp 1080p while viewers on a train still get smooth playback. Get them wrong and you pay for bits nobody can see, or your lowest rendition stalls on the connections that needed it most. This guide collects the best encoding settings for streaming that we use as starting points, and explains why each one matters.

This guide gives you practical, tested settings for on-demand and live streaming with HLS and DASH: ladders for H.264, HEVC and AV1, the keyframe and segment rules that matter, and FFmpeg commands you can adapt.

The five settings that matter most

Before the ladders, five decisions shape everything else.

1. Keyframe interval (GOP)

Every segment must start with a keyframe (an IDR frame) so the player can switch renditions cleanly. Use a fixed keyframe interval that divides evenly into your segment length, and keep it the same in every rendition.

  • 2 seconds is the standard. At 30 fps that is -g 60; at 25 fps, -g 50; at 60 fps, -g 120.
  • Disable scene-cut keyframes (-sc_threshold 0 in x264) or use an encoder option that forces keyframes on segment boundaries.
  • Closed GOPs are safest for segmenting.

2. Segment length

  • VOD: 4 to 6 seconds. Longer segments mean fewer requests and better compression; shorter means faster startup and quicker adaptation.
  • Live: 2 seconds for lower latency, or 4 to 6 seconds if latency does not matter.
  • Low-latency live: 2-second segments with 200 to 500 ms parts or chunks. See low-latency streaming.

3. Rate control

  • VOD renditions: capped CRF (quality target plus -maxrate and -bufsize) or two-pass VBR with a max rate. Both put bits where they are needed.
  • Live ingest to a platform: CBR at the platform’s recommended bitrate.
  • Live output renditions from your own transcoder: constrained VBR, with -maxrate close to the target and a small buffer.

A buffer size (-bufsize) of 1 to 2 times the max rate is a common choice. Smaller buffers make bitrate steadier, which matters for streaming.

4. Profile and level

For H.264, use High profile for everything except the lowest rungs if you need compatibility with very old devices, where Main is safer. Set levels that match resolution and frame rate, for example level 4.0 or 4.1 for 1080p30 and 4.2 for 1080p60. Most encoders choose sensible levels automatically.

5. Pixel format and colour

Use yuv420p (8-bit 4:2:0) for H.264 SDR. Use 10-bit (yuv420p10le) for HEVC or AV1 HDR, with the correct colour metadata (BT.2020, PQ or HLG). Keep colour settings identical across renditions so switches do not shift colours.

H.264 ladder (general content, 16:9, 30 fps)

Resolution Video bitrate Max rate Notes
1920×1080 5,000 kbps 5,350 kbps Top rung for most content
1280×720 3,000 kbps 3,210 kbps Most common rung on mobile
960×540 1,800 kbps 1,930 kbps
768×432 1,100 kbps 1,180 kbps
640×360 730 kbps 780 kbps
416×234 365 kbps 390 kbps Safety rung for poor connections

This is close to the widely cited Apple HLS authoring examples, with sensible rounding. For 60 fps content, raise the upper rungs by roughly 40 to 50 percent.

HEVC ladder (for Apple devices, TVs and 4K)

Resolution Video bitrate
3840×2160 12,000–16,000 kbps
2560×1440 7,000–9,000 kbps
1920×1080 3,500–4,500 kbps
1280×720 2,000–2,500 kbps
960×540 1,200–1,500 kbps
640×360 500–700 kbps

Use 10-bit HEVC for HDR, and tag HEVC with hvc1 for Apple compatibility.

AV1 ladder (modern devices with hardware decode)

Resolution Video bitrate
3840×2160 9,000–13,000 kbps
1920×1080 2,800–3,800 kbps
1280×720 1,500–2,000 kbps
854×480 800–1,000 kbps
640×360 400–550 kbps

AV1 savings over H.264 are largest on detailed, high-resolution content. Offer AV1 only to devices that decode it in hardware, and keep H.264 as the fallback. See H.264 vs H.265 vs AV1 and test devices with our codec support checker.

Content adjustments

  • Screen recordings, slides and lectures: these compress very well. You can often halve the bitrates above. Keep resolution high for text readability.
  • Animation: also compresses well; try 60 to 70 percent of the table values.
  • Sports, concerts and grainy film: increase the upper rungs by 20 to 50 percent, and consider 60 fps for sports.

Better still, use per-title or capped CRF encoding so each video gets what it needs. Our adaptive bitrate guide explains why.

Audio settings

  • Codec: AAC-LC for maximum compatibility. HE-AAC for very low bitrate rungs.
  • Bitrate: 128 kbps stereo is a solid default. 96 kbps is fine for speech. 160 to 192 kbps for music-heavy content.
  • Sample rate: 48 kHz.
  • Surround: AAC 5.1 at 256 to 384 kbps, or E-AC-3 (Dolby Digital Plus) for TV platforms.
  • Packaging: keep audio as separate tracks in CMAF, not muxed into every video rendition.
  • Loudness: normalise to around -16 LUFS for web and mobile or -23/-24 LUFS for broadcast-style delivery, so viewers do not need to adjust volume between videos.

FFmpeg: encoding a full H.264 ladder

This command encodes three renditions from a 1080p source in one pass of decoding, with aligned 2-second keyframes, and writes HLS with fMP4 segments:

ffmpeg -i input.mp4 \
  -filter_complex "[0:v]split=3[v1][v2][v3];[v1]scale=1920:1080[v1o];[v2]scale=1280:720[v2o];[v3]scale=640:360[v3o]" \
  -map "[v1o]" -c:v:0 libx264 -preset slow -crf 21 -maxrate:v:0 5350k -bufsize:v:0 10700k \
  -map "[v2o]" -c:v:1 libx264 -preset slow -crf 22 -maxrate:v:1 3210k -bufsize:v:1 6420k \
  -map "[v3o]" -c:v:2 libx264 -preset slow -crf 23 -maxrate:v:2 780k -bufsize:v:2 1560k \
  -g 60 -keyint_min 60 -sc_threshold 0 -pix_fmt yuv420p \
  -map a:0 -map a:0 -map a:0 -c:a aac -b:a 128k -ac 2 \
  -f hls -hls_time 6 -hls_playlist_type vod -hls_segment_type fmp4 \
  -hls_segment_filename "out/v%v/seg_%03d.m4s" -master_pl_name master.m3u8 \
  -var_stream_map "v:0,a:0 v:1,a:1 v:2,a:2" out/v%v/index.m3u8

Adjust -g to match your frame rate (2 × fps). For production, many teams encode renditions to MP4 first, then package with Shaka Packager or Bento4 to produce both HLS and DASH from the same CMAF segments, with DRM if needed.

Live streaming settings

Ingest (you → platform)

For platforms that transcode your stream (YouTube, Twitch, most online video platforms):

Output Video bitrate (CBR) Keyframe Encoder preset
1080p60 6,000–9,000 kbps 2 s x264 “veryfast”/“faster” or NVENC “Quality”
1080p30 4,500–6,000 kbps 2 s Same
720p60 4,500–6,000 kbps 2 s Same
720p30 3,000–4,500 kbps 2 s Same

Audio: AAC 128 to 160 kbps, 48 kHz. Make sure your upload speed is at least 1.5 times the total bitrate. Our guide on upload speed for live streaming and the bandwidth calculator help you check.

Twitch caps most channels at around 6,000 kbps for standard ingest; YouTube accepts much higher. Check each platform’s current limits.

Output ladder (if you run your own transcoder)

Use the H.264 ladder above with 2-second segments, constrained VBR, and the fastest preset your hardware can sustain in real time without dropping frames. GPU encoders are the norm for multi-rendition live transcoding.

Checklist before you publish

  • Keyframes aligned across all renditions and every segment starts with one.
  • BANDWIDTH and AVERAGE-BANDWIDTH values in the HLS master playlist match real measured bitrates.
  • CODECS and RESOLUTION attributes present for every rendition.
  • The lowest rung plays smoothly on a throttled 1 Mbps connection.
  • Colour and loudness are consistent across renditions.
  • Each rendition plays in a real player. Use our HLS player or DASH player and lock each quality level in turn.
  • The master playlist passes our M3U8 analyzer without warnings.

Testing your ladder before launch

A ladder that looks right on paper can still disappoint in practice. Before publishing a large library:

  1. Encode a test set covering your hardest content: fast motion, dark scenes, fine detail and screen text.
  2. Measure quality with VMAF against the source. Aim for roughly 93 or above on the top rung and a smooth drop across lower rungs.
  3. Watch the rungs yourself on a phone, a laptop and a TV, locking each one in a test player.
  4. Throttle your connection in the browser’s developer tools to 1, 3 and 6 Mbps and watch how the player switches.
  5. Check file sizes and bitrates against your budget with the bitrate calculator.

Adjust the ladder, re-encode the test set, and only then process the full library.

A real example: tuning a ladder for lecture videos

A training company we looked at had copied a generic sports-style ladder for its course videos: 1080p at 6 Mbps, 720p at 4 Mbps, down to 360p at 1 Mbps. Almost every lesson was a presenter in front of slides.

Encoding a sample of 20 lessons with capped CRF showed that 1080p looked indistinguishable from the source at around 2.2 Mbps, and 720p at 1.3 Mbps. The team cut the ladder to five rungs, lowered every cap by roughly half and kept 30 fps. VMAF scores stayed above 94 on the top rung.

The result was a 48 percent drop in delivered data in the first month, with no complaints about quality. Students on mobile actually saw fewer quality switches, because the lower rungs were now close enough together for smooth steps.

The lesson is simple: a ladder is a starting point, not a rule. Encode a sample of your own content, measure it, and adjust. Our bitrate calculator turns the new numbers into storage and bandwidth estimates, and the bandwidth calculator shows what they mean for your CDN bill.

Settings we would not change

Some settings are worth leaving alone even when you are chasing smaller files. Keep keyframes aligned and fixed. Keep audio at a sensible bitrate, because muddy speech drives people away faster than a slightly soft picture. Keep 8-bit yuv420p for H.264 so every device can decode it. And keep at least one rung below 500 kbps, because the viewers who need it most are the ones you never hear from: they simply leave.

One last check

Play every rung on a real phone over mobile data before you publish. Numbers on a spreadsheet do not show you a smeared face or a muffled voice; your own eyes and ears will.

Summary

Good streaming encodes rest on fixed 2-second keyframes, 4 to 6 second segments for VOD (2 for live), capped quality-based rate control, and a ladder spaced 1.5 to 2 times apart from about 365 kbps up to 5 Mbps for 1080p H.264. Add HEVC and AV1 rungs for devices that can use them, keep audio separate at 128 kbps AAC, and test every rung before launch. Adjust bitrates to your content, and let per-title encoding trim the waste.

Frequently asked questions

What keyframe interval should I use for streaming?

Set a fixed keyframe interval that divides evenly into your segment length, typically 2 seconds. At 30 fps that is 60 frames. Disable scene-cut keyframes or make sure every segment still starts with one.

What segment length is best?

Four to six seconds is a good default for on-demand video. Two-second segments suit live streams where lower latency matters.

Should I use CBR or VBR for streaming renditions?

For on-demand renditions, capped VBR or capped CRF gives better quality per bit. For live ingest, most platforms recommend CBR. For live output renditions, constrained VBR is common.

Keep reading