Skip to content
streamneo.
Streaming Settings11 min read

How to Set GOP and Keyframes for a 4K 60fps YouTube Live Video Loop

Set a two-second keyframe interval, translate it to GOP frames at 60 fps, and test codec bitrate and stream health before looping 4K video.

sn.
StreamNeoPublished 5 October 2026
Worth sharing?

For a 4K 60fps YouTube Live loop, set the keyframe interval to two seconds. If your encoder asks for GOP length in frames, use 120 frames at exactly 60 fps; keep it at or below four seconds, or 240 frames.

Choose a closed GOP, then set a bitrate appropriate to your video codec and what your encoder and upload connection can sustain. YouTube’s published bitrate figures are recommendations, not promises of stable delivery: test the complete stream, including its loop point, before relying on it overnight.

Set the keyframe interval to two seconds

A keyframe, also called an I-frame, gives a decoder a reference point from which to reconstruct following frames. In a group of pictures, or GOP, frames between keyframes may depend on other frames for their image data. Regular keyframes help receivers join and decode a stream, and give the platform a predictable interval to work with.

For YouTube Live, the platform-level setting to begin with is a two-second keyframe frequency. YouTube states that two seconds is recommended and says not to exceed four seconds in its live encoder settings guidance. This applies to the keyframe interval regardless of whether you select H.264, H.265/HEVC or AV1 for an RTMP/RTMPS stream.

Look in your encoder for a field labelled keyframe interval, keyframe frequency, or GOP interval. If it accepts time, set two seconds. If it offers a keyframe checkbox or auto setting without displaying the interval, consult that encoder’s own documentation or verify the resulting frequency in YouTube Studio. A generic “high quality” preset is not evidence that the interval is correct.

YouTube’s general encoder table describes RTMP/RTMPS. HLS ingest has its own requirements, including closed GOP and particular transport-stream, audio and segment rules. Do not copy HLS segment settings into an RTMP setup simply because both are used to send a live stream. The YouTube HLS ingestion guide is the relevant primary source if you are specifically using HLS.

Convert seconds to GOP frames at 60 fps

An encoder may express GOP size as a number of frames rather than a duration. At a fixed 60 frames per second, multiply the interval in seconds by 60:

Keyframe interval Calculation at 60 fps GOP length in frames
2 seconds (recommended starting point) 60 × 2 120 frames
4 seconds (maximum YouTube guidance) 60 × 4 240 frames

These frame counts are arithmetic conversions of YouTube’s time-based guidance, not separate frame-count values published by YouTube. For the recommended two-second interval, enter 120 when the encoder specifically asks for GOP length in frames at exactly 60 fps. You do not need to choose the maximum simply because it is allowed; two seconds is the stated recommendation.

Check what the software means by “GOP size”. Some encoders expose a length in frames, others expose a time interval, and some have both an interval and a separate intra-refresh or keyframe option. Do not enter 120 into a field that expects seconds, milliseconds, or a different unit. If the interface is unclear, use the duration setting when available, then check the stream’s reported keyframe behaviour.

The conversion assumes a fixed 60 fps timebase. If your source, encoder or actual output uses a fractional frame rate or variable frame rate, a frames-only field can be less intuitive: a nominal frame count may not correspond to the exact wall-clock duration you intended. Prefer a time-based interval where the encoder supports it, set the output to the frame rate you mean to send, and verify the actual result rather than relying on the label in a preset.

Keep the interval at or below four seconds

Four seconds is a ceiling, not a target. A longer GOP can leave more time between reference frames and may contribute to buffering or ingest warnings. YouTube’s Live Streaming API includes diagnostics for long GOP size and describes its limit as a keyframe frequency of four seconds or less. For a 60fps encoder that produces fixed-length GOPs, four seconds converts to 240 frames; use 120 for the two-second recommendation.

Do not lengthen the interval to save bitrate or to make a 4K encoder work harder. Those are separate concerns. If the machine cannot encode or the connection cannot upload the selected format reliably, reduce the load in a deliberate way, such as choosing a lower output resolution or frame rate that suits the channel, rather than exceeding YouTube’s keyframe limit.

A continuous file loop does not change the platform’s interval recommendation. A loop point is still worth testing because it may reveal a black frame, audio gap, dropped frames or a playback discontinuity. That is a practical check of your source and playback chain, not a special YouTube rule that every loop boundary must coincide with a keyframe. For other causes of a loop failing after its first pass, see why a 4K 60fps YouTube Live loop can stop after one video.

Use a closed GOP

Select closed GOP and leave open GOP disabled. In a closed GOP, frames in one group do not rely on frames from the preceding or following group in the way an open GOP can. That makes the group boundary a self-contained decoding point, which matters to ingest and processing systems that expect a clean boundary.

YouTube’s Live Streaming API explicitly flags open GOP as unsupported. For HLS, YouTube’s ingestion guide specifically requires closed GOP. Those are direct platform constraints, rather than a preference based on perceived picture quality. The API also reports an openGop configuration issue when it detects an open group; see the LiveStreams API documentation.

Encoder terminology varies. Look for a setting such as “closed GOP”, “open GOP”, or “GOP structure”. If the only available control is an “open GOP” tick box, make sure it is off. Avoid guessing from an encoder preset name: after setting the option, verify the stream health messages during a test.

If you send a backup stream, match its keyframe frequency to the primary stream. The API has a GOP mismatch diagnostic for differing frequencies between primary and backup. A backup can have its own encoder settings, so check both rather than assuming that copying the video file also copied the relevant output configuration.

Choose bitrate guidance by codec

YouTube publishes different 4K/2160p at 60fps bitrate figures for different ingestion codecs. Its current encoder settings and bitrate table lists the following values:

Video codec Listed minimum for 2160p at 60fps Listed recommended bitrate
H.264 14 Mbps 50 Mbps
AV1 10 Mbps 35 Mbps
H.265/HEVC 10 Mbps 35 Mbps

Use the column for the codec actually being sent to YouTube, not the codec in which your source file happens to be stored. A file may be encoded in one format and your live encoder may send another. Confirm the output codec in the streaming software and confirm that the selected codec and protocol are supported by the encoder and ingestion route you use.

The values are YouTube’s guidance for an encoder setting; they do not guarantee that a particular network path, encoder or computer can sustain a continuous stream at that rate. The connection needs room for normal variation, and other devices on the same connection can affect available upload capacity. If the upload falls behind or the encoder drops frames, the recommended number alone will not fix it. Test at the intended resolution, frame rate, codec and audio settings, and choose a rate the actual setup can maintain.

The codec can also affect other format decisions. In YouTube’s RTMP/RTMPS guidance, HEVC is the recommended choice for HDR, while AV1 is not supported for HDR. If the loop is SDR, do not select HDR-related settings accidentally; if it is HDR, check the current official encoder guidance and your encoder’s support before committing. Codec choice changes the bitrate table and may change format options, but it does not change the two-second keyframe recommendation.

For RTMP/RTMPS, YouTube also lists CBR, progressive scan, square pixels, two B-frames and one reference frame among its encoder recommendations. Treat these as platform-level targets to compare against your encoder, not evidence that a particular preset is correct. HLS is a separate ingestion method with its own format requirements, so first identify which route you are using.

Test encoder and upload stability

Do a preflight with the exact output profile you intend to leave running: 3840 × 2160 resolution if that is your target, 60fps, the selected codec, the intended bitrate, and the two-second keyframe interval. A short test at a lower resolution or with a still image does not tell you whether the real 4K loop, with its actual motion and sound, behaves well at the intended settings.

Include representative sections of the video: a visually busy passage, a quiet passage, and the transition where the file returns to its start. Include the audio as it will be broadcast. Watch the local encoder for dropped or skipped frames and monitor YouTube Studio’s stream health and messages. The live streaming checklist is useful for checking the wider launch process, while this preflight should concentrate on the encoding profile and loop itself.

Observe both the encoder and the receiving side. If the encoder reports overload, the machine may not be producing frames on time. If the encoder appears steady but YouTube reports poor stream health or the broadcast falls behind, investigate the upload path and settings rather than assuming the local preview proves delivery. These symptoms can have several causes; use the messages and measurements from your own test rather than attributing every interruption to GOP length.

A 24/7 channel also needs to remain live when the operator’s computer is off. A local setup depends on the computer, encoder and internet connection staying available; an interruption in any of those can stop the feed. If your existing arrangement is painful because a home machine must keep running, StreamNeo takes an uploaded video and runs it as a YouTube live stream with your computer switched off, monitoring and restarting it if it drops. The keyframe and format settings still need to be considered for the stream you prepare.

For a local machine setup, make sure sleep settings, power and network arrangements match the intended run length, and know how you will notice and recover from an interruption. This overview of the cost of running a 24/7 ambient channel on a mini PC can help you consider the ongoing costs of keeping a computer on, but it does not replace testing the exact encoder and upload path.

When the test has held the intended profile and the loop transition is clean, record the settings that passed. Include codec, resolution, frame rate, bitrate, interval in seconds or frames, and closed-GOP status. That gives you a known-good baseline if a later encoder update or change to the source file produces different behaviour.

Check keyframe diagnostics

During and after the preflight, inspect YouTube Studio’s stream health messages. The Live Streaming API documents GOP-related issue names including gopSizeLong, gopSizeOver, openGop and gopMismatch. In practical terms, these point you towards an interval that is too long, an open GOP, or different GOP frequencies on primary and backup streams. They help narrow the investigation; they do not tell you by themselves which encoder control to change.

If YouTube reports a GOP issue, compare the warning with the output configuration and encoder logs. Check that the interval is two seconds, or no more than four; confirm that the frame-count field uses the expected unit; confirm closed GOP; and compare primary and backup settings if you use both. YouTube cautions that ingestion errors can make GOP-size diagnostics incorrect, so treat a message as evidence to investigate alongside the encoder output and the stream’s behaviour.

If a diagnostic appears while the encoder is also reporting errors, address the broader ingest or connection issue before repeatedly changing unrelated settings. Change one relevant setting at a time, run the same representative test again, and see whether the warning and stream behaviour change. Keep the settings that are verified in a stable test, rather than assuming a cleared message alone proves the setup is ready for a long unattended run.

For additional troubleshooting when Studio and the encoder disagree about whether a stream is live, use this guide to resolve YouTube Studio showing offline while OBS is streaming. The main point for keyframes is to verify what YouTube actually receives, not only what a settings screen says you intended to send.

Before committing, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.

FAQ

What should my GOP size be for YouTube Live at 60fps?

Set a two-second keyframe interval. At exactly 60fps, that is 120 frames; do not exceed four seconds, equivalent to 240 frames.

Does YouTube Live require a closed GOP?

YouTube’s API identifies open GOP as unsupported, and its HLS ingest guide requires closed GOP. Choose closed GOP for your encoder output and verify it during a test.

Is 50 Mbps always the right bitrate for 4K60?

No. YouTube lists 50 Mbps as recommended for H.264 at 2160p60, and 35 Mbps for AV1 or H.265/HEVC. These figures are recommendations, not a guarantee that your encoder or upload connection can sustain them.

How do I know whether the keyframe setting worked?

Run a representative test and check YouTube Studio’s stream health messages alongside the encoder’s output. If a GOP warning appears, verify the interval, units, closed-GOP setting and any backup stream configuration; investigate other ingest errors as well.

YOU’VE REACHED THE END

Keep the ideas coming.

More guides, useful tools and a little help for your next broadcast.

Back to the journal ↗
YOUR NEXT READ

A little more to explore.

More Streaming Settings guides ↗ · All topics ↗