YouTube closed GOP and 2 B-frames: Sume exposes no GOP fields
YouTube recommends a closed GOP of half the frame rate and 2 consecutive B-frames. Sume video-trim has no GOP or B-frame field and rejects raw ffmpeg flags.

YouTube recommends a closed GOP with a GOP of half the frame rate, which works out to a keyframe every half second. Sume's video-trim has no GOP or B-frame field, and raw ffmpeg fields such as codec and crf are refused, so only the cut mode touches GOP behavior.
YouTube settings are from its recommended upload encoding settings page (undated; read 2026-10-01). Sume behavior is from the Video trim docs.
What does a GOP of half the frame rate mean in frames?
The page says "Closed GOP. GOP of half the frame rate." Reading that as a frame count gives the figures below. YouTube lists it with 2 consecutive B frames as part of the same recommended set, not as a hard limit.
| Frame rate | GOP length in frames | Keyframe spacing |
|---|---|---|
| 24 fps | 12 | 0.5 s |
| 30 fps | 15 | 0.5 s |
| 60 fps | 30 | 0.5 s |
Which trim mode touches the GOP?
precision: "keyframe" is a stream copy: the source's GOP structure is kept as it is, and the docs warn the cut may start a GOP early, so you re-base against actual_start_seconds in the result. precision: "exact" is a frame-accurate re-encode with libx264; the docs do not say how it lays out GOPs or B-frames. Neither mode lets you ask for a closed GOP.
What happens if I send GOP flags?
The server compiles ffmpeg itself. A request carrying vf, filter, ffmpeg, cmd, codec, crf or similar returns ffmpeg_fields_rejected, so a -g or -bf style option has no way in. If your pipeline must hit an exact GOP layout, run your own encoder on the finished file. Check what you have with ffprobe.
ffprobe -v error -select_streams v:0 \
-show_entries stream=profile,has_b_frames,r_frame_rate \
-of default=noprint_wrappers=1 trimmed.mp4Does YouTube reject a file that misses these settings?
The page does not say so; it presents them as recommendations. Treat them as a target for your final encode. For the codec and chroma side of exact mode, see what exact mode re-encodes.
Sources
Related posts
More in Developers
- Deinterlace before YouTube upload: Sume has no deinterlace filter
YouTube says deinterlace 1080i60 to 1080p30 before upload. Sume's video-filter allowlist names no deinterlacer and refuses unknown filters.
- YouTube moov atom and edit lists: keyframe trim vs exact trim
YouTube asks for MP4 with moov first and no edit lists. Sume's keyframe trim is a stream copy; exact re-encodes. The docs do not state moov placement.
- YouTube Opus and Eclipsa Audio uploads vs Sume's WAV and MP3
YouTube now lists Opus and Eclipsa Audio beside AAC-LC for uploads. Sume audio outputs are wav (pcm_s16le) and mp3 only; neither is Opus or Eclipsa.
- YouTube 4K upload bitrate: 35-45 Mbps, 8K 80-160 Mbps
YouTube recommends 35-45 Mbps for 4K SDR at 24-30 fps and 80-160 Mbps for 8K. Sume's video router lists 4K on one model and sets no bitrate field.
Written by Sume