What Is a Keyframe Interval? Settings for Live Streaming

A keyframe interval is the time between fully encoded frames. See what YouTube, Twitch, Facebook, Kick and LinkedIn ask for and how to convert seconds to frames.

What a keyframe is

A keyframe is a video frame that is encoded on its own, without depending on any other frame. The HLS specification calls such frames I-frames: "encoded video frames whose encoding does not depend on any other frame". The frames in between depend on neighbouring frames, which is what makes video compression efficient. The keyframe interval (also called GOP length or keyframe frequency) is the time between one keyframe and the next, usually set in seconds in an encoder such as OBS Studio.

Keyframes matter in live streaming because a viewer who joins, or a player that switches quality, needs a frame it can start decoding from. The HLS specification says a Media Segment that contains H.264 video SHOULD contain an Instantaneous Decoding Refresh (IDR) frame, and that frames before the first IDR will be downloaded but possibly discarded.

What the platforms ask for

Intervals as published by each platform, checked November 27, 2026. Frame counts are seconds × frame rate; LinkedIn and X publish their own frame counts. Check the current documentation before you go live.
PlatformKeyframe interval publishedFrames at 30 fpsFrames at 60 fpsSource
YouTubeRecommended 2 seconds; do not exceed 4 seconds60120YouTube Help: Choose live encoder settings
Twitch2 seconds (every resolution in its x264 and NVENC specs)60120Twitch Help: Broadcasting Guidelines
Facebook Live2 seconds recommended; do not exceed 4 seconds60120Meta Live Video API reference; Meta Business Help Center
Kick2s in the OBS settings Kick lists for x264 and NVIDIA NVENC60120Kick Help Center
LinkedIn LiveEvery 2 seconds60 (LinkedIn’s own example)Not listed (LinkedIn recommends 30 fps)LinkedIn Help: Live Video encoder settings
X (Twitter)Every 3 seconds90 (X’s figure)180 (X’s figure)X Help Center: Live Studio

One value for every destination

A relay such as Multistream Platform forwards the stream your encoder sends, so one keyframe interval reaches every destination. Five of the six platforms above publish 2 seconds, and YouTube and Facebook add an upper limit of 4 seconds. X is the exception: its Live Studio help recommends a keyframe every 3 seconds and does not publish a limit either way.

  • YouTube, Twitch, Facebook, Kick or LinkedIn in any mix: use 2 seconds. It matches every one of their published figures.
  • Adding X to that mix: 2 seconds still matches the other five. X does not say whether it accepts values other than 3 seconds, so run a test stream to X before an important broadcast.
  • X only: use X’s 3 seconds (90 frames at 30 fps, 180 at 60 fps).

Seconds, frames and frame rate

Some encoders ask for frames instead of seconds. The conversion is frames = seconds × frame rate. A 2-second interval is 60 frames at 30 fps (LinkedIn's own example) and 120 frames at 60 fps.

How to set it in OBS Studio

  1. Open Settings, then Output.
  2. Set Output Mode to Advanced. The keyframe field is on the Streaming tab in this mode.
  3. Find the field under your video encoder. OBS Studio labels it Keyframe Interval (0=auto) for x264 and Keyframe interval (seconds, 0 = auto) for NVIDIA NVENC.
  4. Enter 2. The unit is seconds, not frames.
  5. Check that Rate Control is CBR and the bitrate suits your platforms, then click Apply.

You do not have to convert anything: OBS Studio’s x264 encoder multiplies the seconds you enter by your frame rate, so 2 becomes 60 frames at 30 fps and 120 at 60 fps. When you pick YouTube, Twitch or Facebook Live from OBS’s built-in service list, OBS’s service data recommends a 2-second interval and CBR and applies them by default. A Custom server, which is what you use for a relay, for Kick and for X, carries no such recommendation, so whatever is in the field is what gets sent. Because every platform except X lists 2 seconds, it is a safe common value for streaming to several platforms at once; see best OBS settings for streaming for the rest of the output panel and our bitrate recommender for the figure per platform.

How to set it in FFmpeg

FFmpeg counts in frames, not seconds. Its codec documentation describes -g as the group of pictures (GOP) size, and for libx264 it maps -g to x264’s keyint, the maximum GOP size. For a 2-second interval at 30 fps, use -g 60:

ffmpeg -re -i input.mp4 -c:v libx264 -g 60 -c:a aac -f flv rtmp://example.com/live/STREAM_KEY

Because -g is a maximum, libx264 can place a keyframe earlier, for example where its scene-change detection (the sc_threshold option) finds a cut. To put keyframes on a fixed time grid instead, FFmpeg’s main documentation describes -force_key_frames with an expression; its own example forces a keyframe every 5 seconds with expr:gte(t,n_forced*5). For every 2 seconds:

-force_key_frames "expr:gte(t,n_forced*2)"

The time-based version keeps working if you change the frame rate. With -g, remember to change the number too: -g 60 is 2 seconds at 30 fps but only 1 second at 60 fps, where 2 seconds is -g 120.

Common mistakes

  • Leaving OBS on 0 (auto). 0 lets the encoder decide; OBS Studio’s x264 encoder only sets a maximum keyframe distance when the value is not 0. With a built-in YouTube, Twitch or Facebook Live service OBS fills in 2 seconds, but with a Custom server nothing does, so type 2 yourself.
  • Typing frames into a seconds field. The OBS field is in seconds, so 60 does not mean 60 frames. OBS Studio’s x264 field only accepts 0 to 20.
  • Typing seconds into a frames field. FFmpeg’s -g, and OBS’s own Keyframe interval (frames) field in FFmpeg Output mode, count frames, so 2 there means a keyframe every 2 frames.
  • Going above 4 seconds. YouTube and Facebook both say not to exceed 4 seconds.
  • Changing the frame rate but not the GOP. A frame-based value such as -g 60 halves in time when you move from 30 to 60 fps.

Symptoms and checks

  • If a platform complains about the keyframe frequency or the preview stays blank, check that the interval is not above the platform's limit (4 seconds on YouTube and Facebook).
  • Make sure the setting is the same in every encoder or relay that feeds the platform.
  • LinkedIn also suggests the Baseline video profile if a stream fails to process, because higher profiles can introduce B-frames and timestamp issues.

Related: what is bitrate, how to multistream with OBS Studio and what is HLS.

Try it with Multistream Platform. Send one RTMP or SRT stream and relay it to YouTube, Twitch, Facebook, Kick, TikTok and custom endpoints. Start on the free Starter plan (2 channels, 20 streaming hours a month) and see the pricing page for paid plans.

Sources

This guide was first published on October 5, 2026; platform figures and the OBS and FFmpeg details were re-checked on November 27, 2026. Platforms change their recommendations, so confirm against the current documentation before you go live.

Frequently asked questions

What is a keyframe interval?
The time between keyframes (frames that are encoded independently of other frames). In live streaming it is set in seconds.
YouTube and Facebook recommend 2 seconds and say not to exceed 4; Twitch, Kick and LinkedIn list 2 seconds. X recommends 3 seconds. For several platforms at once, 2 seconds matches every platform except X.
60 frames at 30 fps and 120 frames at 60 fps.
In common use they refer to the same idea: how often a full frame is encoded. Encoders may express it in frames or in seconds.
Viewers and players need keyframes to start or switch playback. HLS segments with H.264 video should contain an IDR frame.
A relay forwards the stream you send, so the interval you set in your encoder applies to every destination. Use a value every platform accepts, such as 2 seconds.
Settings, Output, with Output Mode set to Advanced: the field is on the Streaming tab under the video encoder, labelled Keyframe Interval (0=auto) for x264. Enter it in seconds.
It lets the encoder decide when to insert keyframes instead of using a fixed interval. With a Custom server, such as a multistreaming relay, OBS does not fill in a platform value, so set 2 seconds yourself.
X's Live Studio help recommends a keyframe every 3 seconds: 72, 90, 150 and 180 frames at 24, 30, 50 and 60 fps.
Use -g with the frame count (-g 60 at 30 fps, -g 120 at 60 fps), or force a keyframe every 2 seconds with -force_key_frames "expr:gte(t,n_forced*2)".
Have questions that aren't listed here? Talk to the team

Go live everywhere from one stream

Send one RTMP or SRT stream from OBS, vMix or a hardware encoder and we relay it to YouTube, Twitch, Facebook, Kick, TikTok and custom destinations. The Starter plan is $0 a month with 2 channels and 20 streaming hours.

Go Live Today

Ready to stream everywhere?

Bring your live, hosted, and pre-recorded streams into one platform.

One platform. Limitless audiences. Stream. Grow. Everywhere.