What Is a Keyframe Interval? Settings for Live Streaming
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
| Platform | Keyframe interval published | Frames at 30 fps | Frames at 60 fps | Source |
|---|---|---|---|---|
| YouTube | Recommended 2 seconds; do not exceed 4 seconds | 60 | 120 | YouTube Help: Choose live encoder settings |
| Twitch | 2 seconds (every resolution in its x264 and NVENC specs) | 60 | 120 | Twitch Help: Broadcasting Guidelines |
| Facebook Live | 2 seconds recommended; do not exceed 4 seconds | 60 | 120 | Meta Live Video API reference; Meta Business Help Center |
| Kick | 2s in the OBS settings Kick lists for x264 and NVIDIA NVENC | 60 | 120 | Kick Help Center |
| LinkedIn Live | Every 2 seconds | 60 (LinkedIn’s own example) | Not listed (LinkedIn recommends 30 fps) | LinkedIn Help: Live Video encoder settings |
| X (Twitter) | Every 3 seconds | 90 (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
- Open Settings, then Output.
- Set Output Mode to Advanced. The keyframe field is on the Streaming tab in this mode.
- 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.
- Enter 2. The unit is seconds, not frames.
- 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_KEYBecause -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 60halves 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
- YouTube Help: Choose live encoder settings, bitrates, and resolutions
- Twitch Help: Broadcasting Guidelines
- Meta for Developers: Live Video API reference
- Meta Business Help Center: Requirements for Facebook Live videos
- Kick Help Center: How to stream on KICK.com (October 27, 2026)
- LinkedIn Help: LinkedIn Live Video encoder settings
- X Help Center: Live Studio (Recommended Encoder Settings)
- OBS Studio source code (obsproject/obs-studio): encoder field labels, x264 keyframe handling and built-in service recommendations
- FFmpeg documentation: ffmpeg (-force_key_frames)
- FFmpeg Codecs Documentation (-g and libx264 options)
- RFC 8216: HTTP Live Streaming (R. Pantos and W. May, August 2017; Informational)
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
Keep learning
kbps vs Mbps, CBR vs VBR, and the bitrates the major platforms publish.
Read the guideStep-by-step OBS Studio settings to send one stream to a multistreaming relay and out to every platform.
Read the guideA settings order for OBS Studio built from each platform's published numbers and your upload speed.
Read the guideGo 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.
Ready to stream everywhere?
Bring your live, hosted, and pre-recorded streams into one platform.
