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)
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 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
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
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.
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
| Encoder | Quality | Bitrate | VMAF mean | VMAF 5th pct | PSNR-Y | Encode fps | CPU time (s) |
|---|---|---|---|---|---|---|---|
| x264 (H.264) · preset medium | 22 | 6,348.8 kbps | 99.98 | 100.00 | 40.24 | 23.65 | 29.3 |
| x264 (H.264) · preset medium+k12 | 22 | 8,939.6 kbps | 99.97 | 100.00 | 39.96 | 34.71 | 25.3 |
| x264 (H.264) · preset medium+k50 | 22 | 7,345.3 kbps | 99.98 | 100.00 | 40.32 | 23.42 | 29.7 |
| x264 (H.264) · preset medium+b0 | 22 | 9,018.9 kbps | 99.97 | 100.00 | 40.43 | 34.57 | 28.7 |
| x264 (H.264) · preset medium | 28 | 2,490.2 kbps | 99.51 | 97.44 | 37.25 | 34.77 | 21.3 |
| x264 (H.264) · preset medium+k12 | 28 | 4,221.7 kbps | 98.82 | 94.92 | 37.08 | 50.24 | 17.9 |
| x264 (H.264) · preset medium+k50 | 28 | 3,042.6 kbps | 99.53 | 97.29 | 37.41 | 32.39 | 22.1 |
| x264 (H.264) · preset medium+b0 | 28 | 3,038.1 kbps | 99.71 | 98.55 | 36.91 | 57.84 | 17.0 |
| x264 (H.264) · preset medium | 34 | 1,198.8 kbps | 89.85 | 83.34 | 33.78 | 44.7 | 17.0 |
| x264 (H.264) · preset medium+k12 | 34 | 2,227.9 kbps | 88.50 | 80.58 | 33.83 | 57.22 | 14.7 |
| x264 (H.264) · preset medium+k50 | 34 | 1,499.1 kbps | 90.64 | 84.46 | 34.06 | 39.7 | 17.7 |
| x264 (H.264) · preset medium+b0 | 34 | 1,294.8 kbps | 86.95 | 81.69 | 33.24 | 88.37 | 11.0 |
| x265 (HEVC) · preset medium | 24 | 4,608.6 kbps | 99.97 | 100.00 | 40.32 | 20.72 | 48.2 |
| x265 (HEVC) · preset medium+k12 | 24 | 6,481.8 kbps | 99.97 | 100.00 | 40.36 | 13.58 | 62.6 |
| x265 (HEVC) · preset medium+k50 | 24 | 5,003.6 kbps | 99.97 | 100.00 | 40.36 | 18.16 | 51.8 |
| x265 (HEVC) · preset medium+b0 | 24 | 7,996.3 kbps | 99.97 | 100.00 | 41.15 | 15.27 | 67.1 |
| x265 (HEVC) · preset medium | 30 | 1,874.4 kbps | 98.08 | 92.61 | 37.42 | 28.5 | 34.4 |
| x265 (HEVC) · preset medium+k12 | 30 | 3,106.1 kbps | 98.08 | 92.34 | 37.46 | 17.72 | 45.5 |
| x265 (HEVC) · preset medium+k50 | 30 | 2,139.2 kbps | 98.29 | 92.39 | 37.50 | 23.78 | 37.2 |
| x265 (HEVC) · preset medium+b0 | 30 | 2,598.5 kbps | 99.91 | 100.00 | 37.83 | 26.37 | 38.6 |
| x265 (HEVC) · preset medium | 36 | 827.9 kbps | 87.44 | 78.93 | 34.12 | 34.52 | 27.9 |
| x265 (HEVC) · preset medium+k12 | 36 | 1,583.6 kbps | 85.96 | 77.47 | 34.04 | 20.22 | 35.7 |
| x265 (HEVC) · preset medium+k50 | 36 | 988.6 kbps | 87.49 | 78.17 | 34.20 | 28.5 | 30.1 |
| x265 (HEVC) · preset medium+b0 | 36 | 1,003.7 kbps | 89.90 | 84.62 | 34.09 | 41.45 | 24.7 |
pedestrian_area — pedestrian street
| Encoder | Quality | Bitrate | VMAF mean | VMAF 5th pct | PSNR-Y | Encode fps | CPU time (s) |
|---|---|---|---|---|---|---|---|
| x264 (H.264) · preset medium | 22 | 5,449.7 kbps | 97.51 | 94.43 | 41.05 | 20.73 | 37.0 |
| x264 (H.264) · preset medium+k12 | 22 | 7,333.9 kbps | 97.56 | 94.31 | 41.11 | 29.18 | 32.0 |
| x264 (H.264) · preset medium+k50 | 22 | 5,928.7 kbps | 97.57 | 94.63 | 41.09 | 20.75 | 37.4 |
| x264 (H.264) · preset medium+b0 | 22 | 5,862.3 kbps | 97.17 | 94.25 | 40.84 | 30.94 | 32.2 |
| x264 (H.264) · preset medium | 28 | 2,480 kbps | 88.67 | 85.91 | 38.72 | 31.4 | 28.1 |
| x264 (H.264) · preset medium+k12 | 28 | 3,267.4 kbps | 90.05 | 86.63 | 39.10 | 41.6 | 23.5 |
| x264 (H.264) · preset medium+k50 | 28 | 2,652.9 kbps | 89.37 | 86.69 | 38.95 | 28.84 | 28.6 |
| x264 (H.264) · preset medium+b0 | 28 | 2,514.2 kbps | 86.81 | 83.70 | 38.23 | 49.72 | 20.3 |
| x264 (H.264) · preset medium | 34 | 1,293 kbps | 72.17 | 69.63 | 35.94 | 40.08 | 22.6 |
| x264 (H.264) · preset medium+k12 | 34 | 1,666.4 kbps | 75.52 | 71.45 | 36.48 | 48.32 | 19.2 |
| x264 (H.264) · preset medium+k50 | 34 | 1,367.9 kbps | 74.33 | 71.39 | 36.30 | 34.79 | 22.8 |
| x264 (H.264) · preset medium+b0 | 34 | 1,309.4 kbps | 68.92 | 65.82 | 35.35 | 67.55 | 15.2 |
| x265 (HEVC) · preset medium | 24 | 3,176.6 kbps | 96.27 | 93.45 | 40.85 | 14.42 | 68.6 |
| x265 (HEVC) · preset medium+k12 | 24 | 4,147 kbps | 96.53 | 93.50 | 41.00 | 11.37 | 75.7 |
| x265 (HEVC) · preset medium+k50 | 24 | 3,378.5 kbps | 96.31 | 93.42 | 40.90 | 13.32 | 69.8 |
| x265 (HEVC) · preset medium+b0 | 24 | 4,142.7 kbps | 97.38 | 94.73 | 40.97 | 16.43 | 62.1 |
| x265 (HEVC) · preset medium | 30 | 1,472.2 kbps | 87.05 | 84.36 | 38.54 | 18.57 | 53.5 |
| x265 (HEVC) · preset medium+k12 | 30 | 1,910.8 kbps | 88.49 | 85.59 | 38.88 | 13.73 | 58.4 |
| x265 (HEVC) · preset medium+k50 | 30 | 1,555.8 kbps | 87.55 | 84.74 | 38.69 | 16.9 | 54.5 |
| x265 (HEVC) · preset medium+b0 | 30 | 1,762.9 kbps | 88.05 | 85.42 | 38.54 | 24.7 | 41.4 |
| x265 (HEVC) · preset medium | 36 | 731.7 kbps | 69.76 | 66.74 | 35.70 | 22.9 | 42.4 |
| x265 (HEVC) · preset medium+k12 | 36 | 947.3 kbps | 73.83 | 69.64 | 36.24 | 16.22 | 47.8 |
| x265 (HEVC) · preset medium+k50 | 36 | 773.4 kbps | 71.84 | 68.47 | 35.97 | 20.33 | 43.8 |
| x265 (HEVC) · preset medium+b0 | 36 | 871.4 kbps | 69.71 | 66.70 | 35.54 | 33.73 | 30.5 |
riverbed — riverbed (small ripples)
| Encoder | Quality | Bitrate | VMAF mean | VMAF 5th pct | PSNR-Y | Encode fps | CPU time (s) |
|---|---|---|---|---|---|---|---|
| x264 (H.264) · preset medium | 22 | 23,396.4 kbps | 99.94 | 100.00 | 38.69 | 12.82 | 81.0 |
| x264 (H.264) · preset medium+k12 | 22 | 24,298.5 kbps | 99.94 | 100.00 | 38.82 | 15.78 | 67.3 |
| x264 (H.264) · preset medium+k50 | 22 | 23,535.1 kbps | 99.94 | 100.00 | 38.69 | 13.12 | 76.6 |
| x264 (H.264) · preset medium+b0 | 22 | 23,308 kbps | 99.94 | 100.00 | 38.71 | 15.36 | 60.9 |
| x264 (H.264) · preset medium | 28 | 11,622.6 kbps | 88.97 | 86.99 | 35.38 | 15.77 | 66.5 |
| x264 (H.264) · preset medium+k12 | 28 | 12,042.5 kbps | 89.37 | 85.50 | 35.51 | 18.76 | 56.2 |
| x264 (H.264) · preset medium+k50 | 28 | 11,673.4 kbps | 88.74 | 85.74 | 35.37 | 15.47 | 64.2 |
| x264 (H.264) · preset medium+b0 | 28 | 11,593.6 kbps | 89.04 | 87.10 | 35.44 | 18.58 | 50.3 |
| x264 (H.264) · preset medium | 34 | 5,702.7 kbps | 62.65 | 59.81 | 31.98 | 20.24 | 49.9 |
| x264 (H.264) · preset medium+k12 | 34 | 5,865.3 kbps | 63.28 | 56.80 | 32.09 | 22.05 | 42.0 |
| x264 (H.264) · preset medium+k50 | 34 | 5,680.3 kbps | 62.20 | 56.93 | 31.93 | 18.91 | 48.0 |
| x264 (H.264) · preset medium+b0 | 34 | 5,715.7 kbps | 63.05 | 60.15 | 32.07 | 25.27 | 36.9 |
| x265 (HEVC) · preset medium | 24 | 15,197.8 kbps | 97.00 | 93.72 | 37.69 | 4.42 | 222.6 |
| x265 (HEVC) · preset medium+k12 | 24 | 15,641 kbps | 97.07 | 93.89 | 37.86 | 4.42 | 221.2 |
| x265 (HEVC) · preset medium+k50 | 24 | 15,272.8 kbps | 97.00 | 93.88 | 37.72 | 4.37 | 224.6 |
| x265 (HEVC) · preset medium+b0 | 24 | 18,447.7 kbps | 99.80 | 98.93 | 38.80 | 4.97 | 201.8 |
| x265 (HEVC) · preset medium | 30 | 7,534.2 kbps | 79.56 | 74.65 | 34.54 | 5.82 | 168.6 |
| x265 (HEVC) · preset medium+k12 | 30 | 7,741 kbps | 80.57 | 74.77 | 34.73 | 5.83 | 166.7 |
| x265 (HEVC) · preset medium+k50 | 30 | 7,567.4 kbps | 79.74 | 74.66 | 34.58 | 5.79 | 169.0 |
| x265 (HEVC) · preset medium+b0 | 30 | 9,205.7 kbps | 87.59 | 83.42 | 35.71 | 6.54 | 153.6 |
| x265 (HEVC) · preset medium | 36 | 3,424.3 kbps | 54.77 | 49.45 | 31.28 | 8.03 | 122.7 |
| x265 (HEVC) · preset medium+k12 | 36 | 3,545.4 kbps | 56.32 | 49.80 | 31.49 | 7.6 | 122.8 |
| x265 (HEVC) · preset medium+k50 | 36 | 3,445.8 kbps | 55.08 | 49.28 | 31.32 | 7.87 | 122.7 |
| x265 (HEVC) · preset medium+b0 | 36 | 4,401.7 kbps | 64.70 | 58.97 | 32.46 | 8.49 | 118.3 |
rush_hour — rush-hour traffic
| Encoder | Quality | Bitrate | VMAF mean | VMAF 5th pct | PSNR-Y | Encode fps | CPU time (s) |
|---|---|---|---|---|---|---|---|
| x264 (H.264) · preset medium | 22 | 5,294.4 kbps | 93.69 | 91.91 | 41.58 | 20.78 | 40.9 |
| x264 (H.264) · preset medium+k12 | 22 | 6,694.5 kbps | 93.89 | 91.88 | 41.64 | 25.98 | 35.9 |
| x264 (H.264) · preset medium+k50 | 22 | 5,677.9 kbps | 93.85 | 91.94 | 41.61 | 18.62 | 42.8 |
| x264 (H.264) · preset medium+b0 | 22 | 5,428.3 kbps | 94.23 | 93.37 | 41.63 | 27.82 | 35.6 |
| x264 (H.264) · preset medium | 28 | 2,275.6 kbps | 84.82 | 82.40 | 39.84 | 32.1 | 28.0 |
| x264 (H.264) · preset medium+k12 | 28 | 2,686 kbps | 85.26 | 82.20 | 40.01 | 35.85 | 24.6 |
| x264 (H.264) · preset medium+k50 | 28 | 2,371.9 kbps | 85.14 | 82.52 | 39.92 | 24.95 | 30.3 |
| x264 (H.264) · preset medium+b0 | 28 | 2,292 kbps | 85.15 | 83.97 | 39.77 | 45.12 | 21.8 |
| x264 (H.264) · preset medium | 34 | 1,098.4 kbps | 69.83 | 66.73 | 37.41 | 43.16 | 21.1 |
| x264 (H.264) · preset medium+k12 | 34 | 1,312.1 kbps | 71.25 | 67.21 | 37.73 | 39.46 | 19.2 |
| x264 (H.264) · preset medium+k50 | 34 | 1,140.5 kbps | 70.66 | 67.15 | 37.57 | 29.69 | 23.3 |
| x264 (H.264) · preset medium+b0 | 34 | 1,135.6 kbps | 69.97 | 67.79 | 37.23 | 66.6 | 15.2 |
| x265 (HEVC) · preset medium | 24 | 2,938.9 kbps | 91.64 | 89.72 | 41.28 | 13.2 | 74.5 |
| x265 (HEVC) · preset medium+k12 | 24 | 3,498.4 kbps | 92.26 | 89.77 | 41.50 | 10.91 | 80.9 |
| x265 (HEVC) · preset medium+k50 | 24 | 3,019.6 kbps | 91.67 | 89.75 | 41.31 | 12.48 | 75.3 |
| x265 (HEVC) · preset medium+b0 | 24 | 3,850.4 kbps | 94.05 | 93.18 | 41.73 | 16.55 | 61.5 |
| x265 (HEVC) · preset medium | 30 | 1,233.5 kbps | 81.82 | 78.95 | 39.35 | 19.25 | 51.3 |
| x265 (HEVC) · preset medium+k12 | 30 | 1,505.1 kbps | 83.09 | 79.22 | 39.68 | 14.27 | 56.7 |
| x265 (HEVC) · preset medium+k50 | 30 | 1,273.3 kbps | 81.92 | 78.95 | 39.41 | 17.59 | 51.8 |
| x265 (HEVC) · preset medium+b0 | 30 | 1,620 kbps | 85.56 | 84.50 | 39.94 | 24.66 | 41.4 |
| x265 (HEVC) · preset medium | 36 | 504.8 kbps | 65.26 | 61.74 | 36.72 | 26.72 | 35.7 |
| x265 (HEVC) · preset medium+k12 | 36 | 658.4 kbps | 67.90 | 62.64 | 37.20 | 17.88 | 40.4 |
| x265 (HEVC) · preset medium+k50 | 36 | 529 kbps | 65.83 | 62.03 | 36.83 | 23.18 | 37.3 |
| x265 (HEVC) · preset medium+b0 | 36 | 682 kbps | 69.72 | 67.89 | 37.09 | 39.61 | 25.7 |
How to read it, and what we observed
1. x264: size change vs. the default settings at the same CRF (change in mean VMAF)
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)
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
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.
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
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.
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