Lab · 2026-11-22한국어日本語

Keyframe Interval (keyint) and B-Frames Tested: How Much Do File Size, VMAF and Decode Load Change at the Same CRF? (x264 and x265)

We encoded four live-action 1080p25 10-second clips with x264 (CRF 22, 28, 34) and x265 (CRF 24, 30, 36) at preset medium in four ways: default settings (keyint 250), keyint 12, keyint 50, and B-frames off (bframes=0). At the same CRF, keyint 12 made files +2.9 to +85.8% larger with x264 and +2.7 to +91.3% larger with x265, while keyint 50 changed size by −0.4 to +25.0% (x264) and +0.4 to +19.4% (x265). Matched at the same VMAF (excluding the sky clip), keyint 12 still cost +2.5 to +23.6% more with x264 and keyint 50 cost +1.9 to +3.7%. Turning B-frames off cut x264 encoding CPU time to 0.65–0.98×, but x265 files grew by +19.1 to +73.5% at the same CRF. Decoding CPU time showed no consistent direction.

The test PC, FFmpeg and VMAF settings shared by every lab article are collected on the methodology page. Methodology (common to all tests)

The short answer

Frequent keyframes (keyint 12) made files much larger at the same CRF, and even when matched at the same VMAF they cost +2.5 to +23.6% more depending on the video (x264, excluding the sky clip). A 2-second interval (keyint 50) cost little: +1.9 to +3.7% with x264 and −0.1 to +3.3% with x265. The penalty was largest on the static sky video (x264 keyint 12 at the same CRF: +40.8 to +85.8%) and smallest on the highly textured riverbed (+2.9 to +3.9%). With B-frames off, x264 at the same VMAF did not change size much on many clips (−0.8 to +18.0%) and encoding CPU time dropped, but x265 files grew by +19.1 to +73.5% at the same CRF. Decoding CPU time showed no consistent difference across settings.

Why we wanted to know

When you make video for streaming or editing, you often see advice like 'set the keyframe interval to 2 seconds' or 'turn B-frames off for live streaming'. A keyframe (I-frame) is a frame that can be decoded on its own, without any frame before or after it, so it makes seeking easy, but it is known to eat a lot of bits. How much larger the file gets as you add more of them, and how turning B-frames off changes quality, size and speed, should differ from video to video, yet this site had no article with the numbers. Our earlier measurements covered presets (x264 preset speed and size) and tune (the tune option test). This article works the same way: the preset is fixed at medium and only the GOP settings change.

The baseline is not a 'very long GOP' but an interval close to 10 seconds

The clips are only 250 frames (10 seconds) long, so with the default (keyint 250) the only keyframes are the first I-frame and the frames inserted at scene changes (scenecut). That means this experiment cannot tell you the gain over a 'very long GOP'; it can only measure the cost of shortening the GOP. We did not count how many keyframes were actually inserted under each setting.

How we measured

ItemDetails
FFmpeg9.0.2 (gyan.dev full_build)
PCOne machine: AMD Ryzen 5 PRO 4650G (6 cores, 12 threads), 16 GB RAM
Threads per job4. Process priority set to IDLE
Input formatyuv420p 8-bit, 1920x1080, 25 fps. Input is the original y4m, output is mkv (no audio)
LengthOnly the first 250 frames (10 seconds) of each clip
Quality metriclibvmaf default model (vmaf_v0.6.1), measured per frame against the source. Mean (vmaf_mean), 5th percentile (vmaf_p5), minimum (vmaf_min)
Time metricEncoding uses the CSV's utime_s (CPU time); decoding uses dec_utime_s (CPU time of 4-thread decoding). Wall-clock time (rtime_s) fluctuates with other jobs, so we did not use it
Measured on2026-11-22 (4 clips × 8 settings × 3 levels = 96 encodes). Preset fixed at medium

VMAF is a quality metric developed by Netflix. It compares the source and the encoded result frame by frame and scores each from 0 to 100; the closer to 100, the harder it is to tell the encode from the source. The 5th percentile (p5) is the score at the bad end: the point below which the worst 5% of the 250 frames fall.

Encoder settings

SettingAdd for x264 (CRF 22, 28, 34)Add for x265 (CRF 24, 30, 36)
Default (baseline)-c:v libx264 -preset medium -crf Q -threads 4-c:v libx265 -preset medium -crf Q -x265-params pools=4:log-level=error
k12 (about 0.5 s)-x264-params keyint=12:min-keyint=12append keyint=12:min-keyint=12 to -x265-params
k50 (2 s)-x264-params keyint=50:min-keyint=25append keyint=50:min-keyint=25 to -x265-params
b0 (B-frames off)-x264-params bframes=0append bframes=0 to -x265-params

Input and output paths are omitted. At 25 fps, keyint 12 is a 0.48-second interval, 50 is 2 seconds and 250 is 10 seconds (calculated as frames ÷ 25, not measured). x264 CRF 22, 28, 34 and x265 CRF 24, 30, 36 are pairs chosen to land in similar quality ranges. Changing a setting means the same CRF does not give exactly the same quality, so we ran a same-CRF comparison and a same-VMAF comparison (below) separately.

How we matched at the same VMAF

We took the mean VMAF of the middle CRF point of the baseline setting (x264 28, x265 30) as the target. On each variant's curve we took the two neighboring measured points that bracket that VMAF (bitrates b1 > b2, mean VMAF v1 > v2), computed f = (v1 − T) ÷ (v1 − v2), and then calculated bitrate = b1 × (b2/b1)^f (log interpolation). The baseline side is an actual measurement, so it involves no interpolation. The bitrate is the CSV's kbps column and is proportional to file size, so the percentage change in bitrate equals the percentage change in size.

These are interpolated values, not encodes tuned to hit the target

We did not encode to hit a VMAF target. With only 3 CRF points, neighboring points are 10–25 points apart, so the interpolation error is large. There are no repeated measurements either, so it is safest to treat differences of a few percent as within the margin of error. Also, blue_sky's baseline scores are 98–99.5, close to saturation, so the score barely moves even when the bitrate changes a lot. We marked that clip's same-VMAF values with an asterisk (*) and left them out of the conclusions.

Test clip sources and licenses

All four clips are 1080p25 video made by TUM / Taurus Media Technik (2001), downloaded from the Xiph.org derf collection (media.xiph.org/video/derf/y4m/). The accompanying ReadMe_1080p.txt states "Restrictions of use: No restrictions" and "Copyright: No Copyright" (checked 2026-11-08).

Results by clip (raw data)

In each curve the horizontal axis is bitrate and the vertical axis is VMAF. Each setting gets its own curve (medium is the baseline; +k12, +k50 and +b0 are the variants), and a curve above and to the left of the baseline means higher VMAF at the same size. Times in the tables fluctuate because the jobs ran at IDLE priority, so treat them as a reference.

blue_sky — blue sky and tree branches

80901001M2M5M10MBitrate (bps, log scale)VMAFx264 (H.264) · preset medium q=34: 1,198.8 kbps, VMAF 89.847x264 (H.264) · preset medium q=28: 2,490.2 kbps, VMAF 99.51x264 (H.264) · preset medium q=22: 6,348.8 kbps, VMAF 99.976x264 (H.264) · preset medium+k12 q=34: 2,227.9 kbps, VMAF 88.499x264 (H.264) · preset medium+k12 q=28: 4,221.7 kbps, VMAF 98.822x264 (H.264) · preset medium+k12 q=22: 8,939.6 kbps, VMAF 99.973x264 (H.264) · preset medium+k50 q=34: 1,499.1 kbps, VMAF 90.636x264 (H.264) · preset medium+k50 q=28: 3,042.6 kbps, VMAF 99.528x264 (H.264) · preset medium+k50 q=22: 7,345.3 kbps, VMAF 99.976x264 (H.264) · preset medium+b0 q=34: 1,294.8 kbps, VMAF 86.954x264 (H.264) · preset medium+b0 q=28: 3,038.1 kbps, VMAF 99.712x264 (H.264) · preset medium+b0 q=22: 9,018.9 kbps, VMAF 99.971x265 (HEVC) · preset medium q=36: 827.9 kbps, VMAF 87.441x265 (HEVC) · preset medium q=30: 1,874.4 kbps, VMAF 98.083x265 (HEVC) · preset medium q=24: 4,608.6 kbps, VMAF 99.973x265 (HEVC) · preset medium+k12 q=36: 1,583.6 kbps, VMAF 85.96x265 (HEVC) · preset medium+k12 q=30: 3,106.1 kbps, VMAF 98.081x265 (HEVC) · preset medium+k12 q=24: 6,481.8 kbps, VMAF 99.972x265 (HEVC) · preset medium+k50 q=36: 988.6 kbps, VMAF 87.49x265 (HEVC) · preset medium+k50 q=30: 2,139.2 kbps, VMAF 98.286x265 (HEVC) · preset medium+k50 q=24: 5,003.6 kbps, VMAF 99.973x265 (HEVC) · preset medium+b0 q=36: 1,003.7 kbps, VMAF 89.898x265 (HEVC) · preset medium+b0 q=30: 2,598.5 kbps, VMAF 99.908x265 (HEVC) · preset medium+b0 q=24: 7,996.3 kbps, VMAF 99.971
x264 (H.264) · preset mediumx264 (H.264) · preset medium+k12x264 (H.264) · preset medium+k50x264 (H.264) · preset medium+b0x265 (HEVC) · preset mediumx265 (HEVC) · preset medium+k12x265 (HEVC) · preset medium+k50x265 (HEVC) · preset medium+b0
blue_sky — blue sky and tree branches — bitrate vs VMAF
EncoderQualityBitrateVMAF meanVMAF 5th pctPSNR-YEncode fpsCPU time (s)
x264 (H.264) · preset medium226,348.8 kbps99.98100.0040.2423.6529.3
x264 (H.264) · preset medium+k12228,939.6 kbps99.97100.0039.9634.7125.3
x264 (H.264) · preset medium+k50227,345.3 kbps99.98100.0040.3223.4229.7
x264 (H.264) · preset medium+b0229,018.9 kbps99.97100.0040.4334.5728.7
x264 (H.264) · preset medium282,490.2 kbps99.5197.4437.2534.7721.3
x264 (H.264) · preset medium+k12284,221.7 kbps98.8294.9237.0850.2417.9
x264 (H.264) · preset medium+k50283,042.6 kbps99.5397.2937.4132.3922.1
x264 (H.264) · preset medium+b0283,038.1 kbps99.7198.5536.9157.8417.0
x264 (H.264) · preset medium341,198.8 kbps89.8583.3433.7844.717.0
x264 (H.264) · preset medium+k12342,227.9 kbps88.5080.5833.8357.2214.7
x264 (H.264) · preset medium+k50341,499.1 kbps90.6484.4634.0639.717.7
x264 (H.264) · preset medium+b0341,294.8 kbps86.9581.6933.2488.3711.0
x265 (HEVC) · preset medium244,608.6 kbps99.97100.0040.3220.7248.2
x265 (HEVC) · preset medium+k12246,481.8 kbps99.97100.0040.3613.5862.6
x265 (HEVC) · preset medium+k50245,003.6 kbps99.97100.0040.3618.1651.8
x265 (HEVC) · preset medium+b0247,996.3 kbps99.97100.0041.1515.2767.1
x265 (HEVC) · preset medium301,874.4 kbps98.0892.6137.4228.534.4
x265 (HEVC) · preset medium+k12303,106.1 kbps98.0892.3437.4617.7245.5
x265 (HEVC) · preset medium+k50302,139.2 kbps98.2992.3937.5023.7837.2
x265 (HEVC) · preset medium+b0302,598.5 kbps99.91100.0037.8326.3738.6
x265 (HEVC) · preset medium36827.9 kbps87.4478.9334.1234.5227.9
x265 (HEVC) · preset medium+k12361,583.6 kbps85.9677.4734.0420.2235.7
x265 (HEVC) · preset medium+k5036988.6 kbps87.4978.1734.2028.530.1
x265 (HEVC) · preset medium+b0361,003.7 kbps89.9084.6234.0941.4524.7
blue_sky — blue sky and tree branches — all measurements

pedestrian_area — pedestrian street

607080901001M2M5MBitrate (bps, log scale)VMAFx264 (H.264) · preset medium q=34: 1,293 kbps, VMAF 72.166x264 (H.264) · preset medium q=28: 2,480 kbps, VMAF 88.665x264 (H.264) · preset medium q=22: 5,449.7 kbps, VMAF 97.507x264 (H.264) · preset medium+k12 q=34: 1,666.4 kbps, VMAF 75.515x264 (H.264) · preset medium+k12 q=28: 3,267.4 kbps, VMAF 90.051x264 (H.264) · preset medium+k12 q=22: 7,333.9 kbps, VMAF 97.565x264 (H.264) · preset medium+k50 q=34: 1,367.9 kbps, VMAF 74.328x264 (H.264) · preset medium+k50 q=28: 2,652.9 kbps, VMAF 89.367x264 (H.264) · preset medium+k50 q=22: 5,928.7 kbps, VMAF 97.568x264 (H.264) · preset medium+b0 q=34: 1,309.4 kbps, VMAF 68.916x264 (H.264) · preset medium+b0 q=28: 2,514.2 kbps, VMAF 86.812x264 (H.264) · preset medium+b0 q=22: 5,862.3 kbps, VMAF 97.171x265 (HEVC) · preset medium q=36: 731.7 kbps, VMAF 69.758x265 (HEVC) · preset medium q=30: 1,472.2 kbps, VMAF 87.05x265 (HEVC) · preset medium q=24: 3,176.6 kbps, VMAF 96.268x265 (HEVC) · preset medium+k12 q=36: 947.3 kbps, VMAF 73.83x265 (HEVC) · preset medium+k12 q=30: 1,910.8 kbps, VMAF 88.49x265 (HEVC) · preset medium+k12 q=24: 4,147 kbps, VMAF 96.53x265 (HEVC) · preset medium+k50 q=36: 773.4 kbps, VMAF 71.844x265 (HEVC) · preset medium+k50 q=30: 1,555.8 kbps, VMAF 87.552x265 (HEVC) · preset medium+k50 q=24: 3,378.5 kbps, VMAF 96.315x265 (HEVC) · preset medium+b0 q=36: 871.4 kbps, VMAF 69.714x265 (HEVC) · preset medium+b0 q=30: 1,762.9 kbps, VMAF 88.051x265 (HEVC) · preset medium+b0 q=24: 4,142.7 kbps, VMAF 97.384
x264 (H.264) · preset mediumx264 (H.264) · preset medium+k12x264 (H.264) · preset medium+k50x264 (H.264) · preset medium+b0x265 (HEVC) · preset mediumx265 (HEVC) · preset medium+k12x265 (HEVC) · preset medium+k50x265 (HEVC) · preset medium+b0
pedestrian_area — pedestrian street — bitrate vs VMAF
EncoderQualityBitrateVMAF meanVMAF 5th pctPSNR-YEncode fpsCPU time (s)
x264 (H.264) · preset medium225,449.7 kbps97.5194.4341.0520.7337.0
x264 (H.264) · preset medium+k12227,333.9 kbps97.5694.3141.1129.1832.0
x264 (H.264) · preset medium+k50225,928.7 kbps97.5794.6341.0920.7537.4
x264 (H.264) · preset medium+b0225,862.3 kbps97.1794.2540.8430.9432.2
x264 (H.264) · preset medium282,480 kbps88.6785.9138.7231.428.1
x264 (H.264) · preset medium+k12283,267.4 kbps90.0586.6339.1041.623.5
x264 (H.264) · preset medium+k50282,652.9 kbps89.3786.6938.9528.8428.6
x264 (H.264) · preset medium+b0282,514.2 kbps86.8183.7038.2349.7220.3
x264 (H.264) · preset medium341,293 kbps72.1769.6335.9440.0822.6
x264 (H.264) · preset medium+k12341,666.4 kbps75.5271.4536.4848.3219.2
x264 (H.264) · preset medium+k50341,367.9 kbps74.3371.3936.3034.7922.8
x264 (H.264) · preset medium+b0341,309.4 kbps68.9265.8235.3567.5515.2
x265 (HEVC) · preset medium243,176.6 kbps96.2793.4540.8514.4268.6
x265 (HEVC) · preset medium+k12244,147 kbps96.5393.5041.0011.3775.7
x265 (HEVC) · preset medium+k50243,378.5 kbps96.3193.4240.9013.3269.8
x265 (HEVC) · preset medium+b0244,142.7 kbps97.3894.7340.9716.4362.1
x265 (HEVC) · preset medium301,472.2 kbps87.0584.3638.5418.5753.5
x265 (HEVC) · preset medium+k12301,910.8 kbps88.4985.5938.8813.7358.4
x265 (HEVC) · preset medium+k50301,555.8 kbps87.5584.7438.6916.954.5
x265 (HEVC) · preset medium+b0301,762.9 kbps88.0585.4238.5424.741.4
x265 (HEVC) · preset medium36731.7 kbps69.7666.7435.7022.942.4
x265 (HEVC) · preset medium+k1236947.3 kbps73.8369.6436.2416.2247.8
x265 (HEVC) · preset medium+k5036773.4 kbps71.8468.4735.9720.3343.8
x265 (HEVC) · preset medium+b036871.4 kbps69.7166.7035.5433.7330.5
pedestrian_area — pedestrian street — all measurements

riverbed — riverbed (small ripples)

50607080901005M10M20MBitrate (bps, log scale)VMAFx264 (H.264) · preset medium q=34: 5,702.7 kbps, VMAF 62.645x264 (H.264) · preset medium q=28: 11,622.6 kbps, VMAF 88.974x264 (H.264) · preset medium q=22: 23,396.4 kbps, VMAF 99.945x264 (H.264) · preset medium+k12 q=34: 5,865.3 kbps, VMAF 63.282x264 (H.264) · preset medium+k12 q=28: 12,042.5 kbps, VMAF 89.369x264 (H.264) · preset medium+k12 q=22: 24,298.5 kbps, VMAF 99.945x264 (H.264) · preset medium+k50 q=34: 5,680.3 kbps, VMAF 62.196x264 (H.264) · preset medium+k50 q=28: 11,673.4 kbps, VMAF 88.736x264 (H.264) · preset medium+k50 q=22: 23,535.1 kbps, VMAF 99.945x264 (H.264) · preset medium+b0 q=34: 5,715.7 kbps, VMAF 63.046x264 (H.264) · preset medium+b0 q=28: 11,593.6 kbps, VMAF 89.043x264 (H.264) · preset medium+b0 q=22: 23,308 kbps, VMAF 99.944x265 (HEVC) · preset medium q=36: 3,424.3 kbps, VMAF 54.774x265 (HEVC) · preset medium q=30: 7,534.2 kbps, VMAF 79.562x265 (HEVC) · preset medium q=24: 15,197.8 kbps, VMAF 97.005x265 (HEVC) · preset medium+k12 q=36: 3,545.4 kbps, VMAF 56.318x265 (HEVC) · preset medium+k12 q=30: 7,741 kbps, VMAF 80.57x265 (HEVC) · preset medium+k12 q=24: 15,641 kbps, VMAF 97.073x265 (HEVC) · preset medium+k50 q=36: 3,445.8 kbps, VMAF 55.078x265 (HEVC) · preset medium+k50 q=30: 7,567.4 kbps, VMAF 79.736x265 (HEVC) · preset medium+k50 q=24: 15,272.8 kbps, VMAF 97.001x265 (HEVC) · preset medium+b0 q=36: 4,401.7 kbps, VMAF 64.704x265 (HEVC) · preset medium+b0 q=30: 9,205.7 kbps, VMAF 87.592x265 (HEVC) · preset medium+b0 q=24: 18,447.7 kbps, VMAF 99.797
x264 (H.264) · preset mediumx264 (H.264) · preset medium+k12x264 (H.264) · preset medium+k50x264 (H.264) · preset medium+b0x265 (HEVC) · preset mediumx265 (HEVC) · preset medium+k12x265 (HEVC) · preset medium+k50x265 (HEVC) · preset medium+b0
riverbed — riverbed (small ripples) — bitrate vs VMAF
EncoderQualityBitrateVMAF meanVMAF 5th pctPSNR-YEncode fpsCPU time (s)
x264 (H.264) · preset medium2223,396.4 kbps99.94100.0038.6912.8281.0
x264 (H.264) · preset medium+k122224,298.5 kbps99.94100.0038.8215.7867.3
x264 (H.264) · preset medium+k502223,535.1 kbps99.94100.0038.6913.1276.6
x264 (H.264) · preset medium+b02223,308 kbps99.94100.0038.7115.3660.9
x264 (H.264) · preset medium2811,622.6 kbps88.9786.9935.3815.7766.5
x264 (H.264) · preset medium+k122812,042.5 kbps89.3785.5035.5118.7656.2
x264 (H.264) · preset medium+k502811,673.4 kbps88.7485.7435.3715.4764.2
x264 (H.264) · preset medium+b02811,593.6 kbps89.0487.1035.4418.5850.3
x264 (H.264) · preset medium345,702.7 kbps62.6559.8131.9820.2449.9
x264 (H.264) · preset medium+k12345,865.3 kbps63.2856.8032.0922.0542.0
x264 (H.264) · preset medium+k50345,680.3 kbps62.2056.9331.9318.9148.0
x264 (H.264) · preset medium+b0345,715.7 kbps63.0560.1532.0725.2736.9
x265 (HEVC) · preset medium2415,197.8 kbps97.0093.7237.694.42222.6
x265 (HEVC) · preset medium+k122415,641 kbps97.0793.8937.864.42221.2
x265 (HEVC) · preset medium+k502415,272.8 kbps97.0093.8837.724.37224.6
x265 (HEVC) · preset medium+b02418,447.7 kbps99.8098.9338.804.97201.8
x265 (HEVC) · preset medium307,534.2 kbps79.5674.6534.545.82168.6
x265 (HEVC) · preset medium+k12307,741 kbps80.5774.7734.735.83166.7
x265 (HEVC) · preset medium+k50307,567.4 kbps79.7474.6634.585.79169.0
x265 (HEVC) · preset medium+b0309,205.7 kbps87.5983.4235.716.54153.6
x265 (HEVC) · preset medium363,424.3 kbps54.7749.4531.288.03122.7
x265 (HEVC) · preset medium+k12363,545.4 kbps56.3249.8031.497.6122.8
x265 (HEVC) · preset medium+k50363,445.8 kbps55.0849.2831.327.87122.7
x265 (HEVC) · preset medium+b0364,401.7 kbps64.7058.9732.468.49118.3
riverbed — riverbed (small ripples) — all measurements

rush_hour — rush-hour traffic

60708090100500k1M2M5MBitrate (bps, log scale)VMAFx264 (H.264) · preset medium q=34: 1,098.4 kbps, VMAF 69.832x264 (H.264) · preset medium q=28: 2,275.6 kbps, VMAF 84.821x264 (H.264) · preset medium q=22: 5,294.4 kbps, VMAF 93.692x264 (H.264) · preset medium+k12 q=34: 1,312.1 kbps, VMAF 71.249x264 (H.264) · preset medium+k12 q=28: 2,686 kbps, VMAF 85.264x264 (H.264) · preset medium+k12 q=22: 6,694.5 kbps, VMAF 93.886x264 (H.264) · preset medium+k50 q=34: 1,140.5 kbps, VMAF 70.662x264 (H.264) · preset medium+k50 q=28: 2,371.9 kbps, VMAF 85.143x264 (H.264) · preset medium+k50 q=22: 5,677.9 kbps, VMAF 93.846x264 (H.264) · preset medium+b0 q=34: 1,135.6 kbps, VMAF 69.972x264 (H.264) · preset medium+b0 q=28: 2,292 kbps, VMAF 85.153x264 (H.264) · preset medium+b0 q=22: 5,428.3 kbps, VMAF 94.229x265 (HEVC) · preset medium q=36: 504.8 kbps, VMAF 65.264x265 (HEVC) · preset medium q=30: 1,233.5 kbps, VMAF 81.816x265 (HEVC) · preset medium q=24: 2,938.9 kbps, VMAF 91.635x265 (HEVC) · preset medium+k12 q=36: 658.4 kbps, VMAF 67.902x265 (HEVC) · preset medium+k12 q=30: 1,505.1 kbps, VMAF 83.092x265 (HEVC) · preset medium+k12 q=24: 3,498.4 kbps, VMAF 92.256x265 (HEVC) · preset medium+k50 q=36: 529 kbps, VMAF 65.828x265 (HEVC) · preset medium+k50 q=30: 1,273.3 kbps, VMAF 81.921x265 (HEVC) · preset medium+k50 q=24: 3,019.6 kbps, VMAF 91.668x265 (HEVC) · preset medium+b0 q=36: 682 kbps, VMAF 69.72x265 (HEVC) · preset medium+b0 q=30: 1,620 kbps, VMAF 85.564x265 (HEVC) · preset medium+b0 q=24: 3,850.4 kbps, VMAF 94.054
x264 (H.264) · preset mediumx264 (H.264) · preset medium+k12x264 (H.264) · preset medium+k50x264 (H.264) · preset medium+b0x265 (HEVC) · preset mediumx265 (HEVC) · preset medium+k12x265 (HEVC) · preset medium+k50x265 (HEVC) · preset medium+b0
rush_hour — rush-hour traffic — bitrate vs VMAF
EncoderQualityBitrateVMAF meanVMAF 5th pctPSNR-YEncode fpsCPU time (s)
x264 (H.264) · preset medium225,294.4 kbps93.6991.9141.5820.7840.9
x264 (H.264) · preset medium+k12226,694.5 kbps93.8991.8841.6425.9835.9
x264 (H.264) · preset medium+k50225,677.9 kbps93.8591.9441.6118.6242.8
x264 (H.264) · preset medium+b0225,428.3 kbps94.2393.3741.6327.8235.6
x264 (H.264) · preset medium282,275.6 kbps84.8282.4039.8432.128.0
x264 (H.264) · preset medium+k12282,686 kbps85.2682.2040.0135.8524.6
x264 (H.264) · preset medium+k50282,371.9 kbps85.1482.5239.9224.9530.3
x264 (H.264) · preset medium+b0282,292 kbps85.1583.9739.7745.1221.8
x264 (H.264) · preset medium341,098.4 kbps69.8366.7337.4143.1621.1
x264 (H.264) · preset medium+k12341,312.1 kbps71.2567.2137.7339.4619.2
x264 (H.264) · preset medium+k50341,140.5 kbps70.6667.1537.5729.6923.3
x264 (H.264) · preset medium+b0341,135.6 kbps69.9767.7937.2366.615.2
x265 (HEVC) · preset medium242,938.9 kbps91.6489.7241.2813.274.5
x265 (HEVC) · preset medium+k12243,498.4 kbps92.2689.7741.5010.9180.9
x265 (HEVC) · preset medium+k50243,019.6 kbps91.6789.7541.3112.4875.3
x265 (HEVC) · preset medium+b0243,850.4 kbps94.0593.1841.7316.5561.5
x265 (HEVC) · preset medium301,233.5 kbps81.8278.9539.3519.2551.3
x265 (HEVC) · preset medium+k12301,505.1 kbps83.0979.2239.6814.2756.7
x265 (HEVC) · preset medium+k50301,273.3 kbps81.9278.9539.4117.5951.8
x265 (HEVC) · preset medium+b0301,620 kbps85.5684.5039.9424.6641.4
x265 (HEVC) · preset medium36504.8 kbps65.2661.7436.7226.7235.7
x265 (HEVC) · preset medium+k1236658.4 kbps67.9062.6437.2017.8840.4
x265 (HEVC) · preset medium+k5036529 kbps65.8362.0336.8323.1837.3
x265 (HEVC) · preset medium+b036682 kbps69.7267.8937.0939.6125.7
rush_hour — rush-hour traffic — all measurements

How to read it, and what we observed

1. x264: size change vs. the default settings at the same CRF (change in mean VMAF)

Setting · clipCRF 22CRF 28CRF 34
k12 · blue_sky+40.8% (0.00)+69.5% (−0.69)+85.8% (−1.35)
k12 · pedestrian_area+34.6% (+0.06)+31.8% (+1.39)+28.9% (+3.35)
k12 · riverbed+3.9% (0.00)+3.6% (+0.39)+2.9% (+0.64)
k12 · rush_hour+26.4% (+0.19)+18.0% (+0.44)+19.5% (+1.42)
k50 · blue_sky+15.7% (0.00)+22.2% (+0.02)+25.0% (+0.79)
k50 · pedestrian_area+8.8% (+0.06)+7.0% (+0.70)+5.8% (+2.16)
k50 · riverbed+0.6% (0.00)+0.4% (−0.24)−0.4% (−0.45)
k50 · rush_hour+7.2% (+0.15)+4.2% (+0.32)+3.8% (+0.83)
b0 · blue_sky+42.1% (0.00)+22.0% (+0.20)+8.0% (−2.89)
b0 · pedestrian_area+7.6% (−0.34)+1.4% (−1.85)+1.3% (−3.25)
b0 · riverbed−0.4% (0.00)−0.2% (+0.07)+0.2% (+0.40)
b0 · rush_hour+2.5% (+0.54)+0.7% (+0.33)+3.4% (+0.14)

Compared with the baseline row at the same CRF (variant row ÷ baseline row), using the CSV's size_bytes and vmaf_mean. Parentheses show the difference in mean VMAF. At CRF 22, blue_sky and riverbed have baseline VMAF of 99.9 or higher, so their scores are close to saturation.

2. x265: size change vs. the default settings at the same CRF (change in mean VMAF)

Setting · clipCRF 24CRF 30CRF 36
k12 · blue_sky+40.6% (0.0)+65.7% (0.0)+91.3% (−1.5)
k12 · pedestrian_area+30.5% (+0.3)+29.8% (+1.4)+29.5% (+4.1)
k12 · riverbed+2.9% (+0.1)+2.7% (+1.0)+3.5% (+1.5)
k12 · rush_hour+19.0% (+0.6)+22.0% (+1.3)+30.4% (+2.6)
k50 · blue_sky+8.6% (0.0)+14.1% (+0.2)+19.4% (+0.1)
k50 · pedestrian_area+6.4% (+0.1)+5.7% (+0.5)+5.7% (+2.1)
k50 · riverbed+0.5% (0.0)+0.4% (+0.2)+0.6% (+0.3)
k50 · rush_hour+2.7% (0.0)+3.2% (+0.1)+4.8% (+0.6)
b0 · blue_sky+73.5% (0.0)+38.6% (+1.8)+21.2% (+2.5)
b0 · pedestrian_area+30.4% (+1.1)+19.7% (+1.0)+19.1% (0.0)
b0 · riverbed+21.4% (+2.8)+22.2% (+8.0)+28.5% (+9.9)
b0 · rush_hour+31.0% (+2.4)+31.3% (+3.8)+35.1% (+4.5)

Same method as the x264 table. Parentheses show the difference in mean VMAF (to one decimal place).

  • With keyint 12, file size grew in all 24 comparisons (12 for x264 + 12 for x265) (x264 +2.9 to +85.8%, x265 +2.7 to +91.3%). The largest values for both encoders are blue_sky at the higher CRFs (x264 CRF 34 went from 1,198.8 to 2,227.9 kbps, +85.8%, while VMAF went from 89.847 to 88.499).
  • With keyint 12, VMAF was mostly the same or higher, but because size grew along with it, that is not a free gain. Example: pedestrian_area at x264 CRF 34 went from VMAF 72.166 to 75.515 (+3.35) at +28.9% size. Judging that needs the 'same VMAF' tables below. Only blue_sky also lost VMAF at CRF 28 and 34 (−0.69 and −1.35).
  • keyint 50 cost little. x264 −0.4 to +25.0%, x265 +0.4 to +19.4%. The 25.0% and 19.4% are blue_sky at the higher CRFs, and riverbed stayed within +0.6% for both encoders (−0.4 to +0.6%).
  • The spread between clips was large. With the same keyint 12, riverbed was +2.7 to +3.9% (both encoders) while blue_sky was +40.6 to +91.3%. riverbed's baseline bitrate at x264 CRF 28 is 11,622.6 kbps, the highest of the four clips. You could read this as: a highly textured video already spends many bits on every frame, so extra keyframes raise the size by a smaller proportion. This data cannot confirm the reason, though.
  • Results for b0 (B-frames off) differed by encoder. With x264 at the same CRF, size changed by −0.4 to +42.1% (−0.4 to +7.6% excluding blue_sky), while with x265 all 12 comparisons grew, by +19.1 to +73.5%. x265 riverbed also gained +2.8 to +9.9 VMAF, while x264 pedestrian_area lost VMAF (−0.34, −1.85, −3.25).

3. Size change at the same VMAF

Clip (target VMAF)k12k50b0
blue_sky (99.51)*+165.5%+22.0%+20.4%
pedestrian_area (88.67)+23.6%+3.7%+18.0%
riverbed (88.97)+2.5%+1.9%−0.4%
rush_hour (84.82)+15.4%+2.5%−0.8%

x264 medium. The target is the mean VMAF of the baseline CRF 28 point. Example: rush_hour's baseline is 2,275.6 kbps, and k12 interpolates to about 2,626 kbps. *blue_sky's 99.51 is in a range close to score saturation, so we do not interpret it (k12 interpolates over a very wide span between CRF 22 and 28). riverbed k50 interpolates over a wide span between CRF 22 and 28, and pedestrian_area b0 also interpolates between CRF 22 and 28.

Clip (target VMAF)k12k50b0
blue_sky (98.08)*+65.8%+12.5%+16.6%
pedestrian_area (87.05)+21.1%+3.3%+15.2%
riverbed (79.56)−0.5%−0.1%−5.7%
rush_hour (81.82)+13.8%+2.6%+7.0%

x265 medium. The target is the mean VMAF of the baseline CRF 30 point. *blue_sky's 98.08 is also in a range close to saturation. riverbed b0's −5.7% interpolates over a span of nearly 24 points between CRF 30 and 36, so the error is large.

  • The same-VMAF cost of keyint 12 varied a lot by clip. Excluding blue_sky, x264 was +2.5 to +23.6% and x265 −0.5 to +21.1%. pedestrian_area was the largest (+23.6% and +21.1%) and riverbed was close to zero (+2.5% and −0.5%).
  • With keyint 50, excluding blue_sky, every value was within a few percent: x264 +1.9 to +3.7%, x265 −0.1 to +3.3%. Without repeated measurements, differences this small are hard to tell apart from the margin of error. On these clips, the cost of keeping a 2-second interval was small.
  • The same-VMAF cost of b0 changed sign depending on encoder and clip. With x264, riverbed and rush_hour were −0.4% and −0.8%, effectively the same, and pedestrian_area was +18.0% (a wide interpolation span). With x265, riverbed was −5.7% (a wide interpolation span), rush_hour +7.0% and pedestrian_area +15.2%.
  • With x265 b0 at the same CRF, size grew everywhere and VMAF mostly rose as well, so 'keep the CRF and just turn B-frames off' is not a fair comparison. It shows that the same CRF does not mean the same target quality. This data cannot tell us why.

4. The cost: encoding time and decoding load

SettingEncoding CPU time ratio (utime)Decoding CPU time ratio (dec_utime)
x264 k120.83–0.91×0.97–1.24×
x264 k500.95–1.10×0.88–1.20×
x264 b00.65–0.98×0.75–1.24×
x265 k120.99–1.32×0.89–1.18×
x265 k501.00–1.08×0.86–1.09×
x265 b00.72–1.39×0.95–1.46×

Minimum to maximum over 12 comparisons (4 clips × 3 CRFs). Variant row ÷ baseline row at the same CRF (the CSV's utime_s and dec_utime_s). Examples: x264 pedestrian_area CRF 34 b0 went from 22.594 s to 15.172 s (0.67×). x265 blue_sky CRF 24 k12 went from 48.203 s to 62.562 s (1.30×).

  • x264 b0 reduced encoding CPU time in all 12 cases (0.65–0.98×). For blue_sky, pedestrian_area and rush_hour, the higher the CRF, the bigger the reduction (blue_sky 0.98×, 0.80×, 0.65×). x264 k12 also dropped to 0.83–0.91×, while k50 stayed about the same (0.95–1.10×).
  • x265 went the other way. k12 was 0.99–1.32×, the same or slower (blue_sky 1.28–1.32×), and b0 was 0.72–1.39×, varying by clip and CRF (blue_sky was 1.39× at CRF 24 and 0.88× at CRF 36). This was measured on one PC at IDLE priority, so treat it as a reference.
  • Decoding CPU time showed no consistent direction across settings. The ratios were scattered from 0.75× to 1.46×, but the absolute values are small, about 0.8 to 4.4 seconds for a 10-second clip, so fluctuations of around 0.016 seconds look big. This data does not let us say that keyint or B-frames raise or lower decoding load. Also, we did not measure hardware decoders or real players; these are FFmpeg software-decoding CPU times.
Seek latency is a calculation, not a measurement

The keyframe interval is known to affect how quickly a seek lands on the correct picture during playback, because decoding has to start from the nearest earlier keyframe. At 25 fps, keyint 12 is an interval of at most about 0.48 seconds, 50 is 2 seconds and 250 is 10 seconds. These are calculated from frame counts, and we did not measure actual seek times in this experiment.

Limitations

  • The baseline (keyint 250) is equal to the clip length (250 frames). In a 10-second clip only the first I-frame and scenecut frames appear, so we cannot know the gain over 'very rare keyframes'. We did not count keyframes directly, and the figure of about 21 keyframes at keyint 12 (250 ÷ 12) is also a calculation.
  • We used 4 clips of 10 seconds each, 8-bit, 1080p25, and a single preset (medium). This data cannot tell us how GOP length affects scores in longer videos, or the results at other presets, resolutions or 10-bit.
  • The same-VMAF comparisons are interpolated values. With only 3 CRF points the gaps between points are wide, and some interpolate across spans of 10 points or more. We left blue_sky out of the interpretation because of score saturation.
  • VMAF is a computed score, so it may not match viewing experience. Visible effects such as flicker (periodic quality changes) when keyframes are frequent are not captured by mean VMAF. We did no visual evaluation. For worst frames, look separately, as in the VMAF worst-frame test.
  • One PC, one measurement. We did not compute error from repeated runs. Times are CPU times run at IDLE priority, so treat them as a reference (see utime vs. rtime). Decoding values are small and fluctuate especially.

Practical recommendations

  • Shorten the keyframe interval only as much as you need. If your service requires a 2-second interval (keyint 50), the same-VMAF size penalty on these clips was small: +1.9 to +3.7% with x264 and −0.1 to +3.3% with x265 (excluding the sky clip). A 0.5-second interval (keyint 12), on the other hand, cost +2.5 to +23.6% (x264) at the same VMAF, so check whether you really need seeking that precise before using it.
  • The smoother and more static the video, the higher the cost of a short keyframe interval. blue_sky at x264 keyint 12 was +40.8 to +85.8% in size at the same CRF. If you have to deliver such video with a short GOP, do not keep the same CRF; redo your size budget with the CRF recommender.
  • Test the choice to turn B-frames off separately for each encoder. Turning B-frames off is known to be used in low-latency streaming to avoid frame-reordering delay (the delay B-frames cause). In this data, x264 had clips whose same-VMAF size did not grow much and its encoding time dropped (0.65–0.98×), but x265 grew by +19.1 to +73.5% at the same CRF. We did not measure latency itself.
  • After changing a setting, compare at the same VMAF and size, not the same CRF. In this article the size change at the same CRF and at the same VMAF often differed (example: x264 pedestrian_area k12 was +31.8% at the same CRF 28 and +23.6% at the same VMAF). The method is the same as in the CRF sweep test.
  • We found no reason in this data to change keyint or B-frames because of decoding load. If your playback devices are weak, first check hardware decoding support with the codec support checker, and for a similar option comparison see the fastdecode results in the tune option test.

You can download the full raw data as a CSV at the bottom of the page. You can recompute the same-CRF changes from size_bytes and vmaf_mean, the same-VMAF comparisons from kbps and vmaf_mean, and the time ratios from utime_s and dec_utime_s.

Raw data: gop-keyint-bframes-size-vmaf-v1.csv