Content Delivery Network Blog

RTMP Encoder Settings: Bitrate, Keyframes and Ingest URLs

Written by BlazingCDN | Sep 26, 2026, 7:32:55 AM

A stable RTMP encoder configuration comes down to four settings. Use constant bitrate (CBR) sized to about 75 percent of your sustained upload. Set a fixed 2-second keyframe interval with scene-cut keyframes disabled. Send AAC-LC audio at 48 kHz and 128 to 160 kbps. Split the ingest URL into server and stream key exactly as the receiving server expects. Get those right and the packager downstream can cut clean HLS segments, the player never stalls on a missing IDR frame, and your encoder stops dropping frames under load. Budget about 20 minutes with OBS Studio or ffmpeg and a working ingest endpoint.

RTMP Encoder Settings Cheat Sheet (2026)

For H.264 over RTMP in 2026, a stable 1080p60 ingest profile uses constant bitrate at 6,000 kbps, a keyframe every 2 seconds (120 frames at 60 fps), and AAC-LC audio at 160 kbps and 48 kHz. That combination lets any HLS or DASH packager cut clean 2-, 4- or 6-second segments without re-encoding the video track.

OutputVideo bitrate (H.264, CBR)GOP at 2 sAudioMin sustained upload
720p303,000 kbps60 framesAAC-LC 128 kbps, 48 kHz~4.4 Mbps
720p604,500 kbps120 framesAAC-LC 160 kbps, 48 kHz~6.5 Mbps
1080p304,500 kbps60 framesAAC-LC 160 kbps, 48 kHz~6.5 Mbps
1080p606,000 kbps120 framesAAC-LC 160 kbps, 48 kHz~8.6 Mbps
1440p609,000 to 12,000 kbps120 framesAAC-LC 160 kbps, 48 kHz~13 to 17 Mbps

Upload headroom, not resolution, is what decides which row you can actually run: a 1080p60 stream at 6,000 kbps needs roughly 8.6 Mbps of sustained upload, not 6.

Prerequisites

  • An encoder: OBS Studio 30 or later, or ffmpeg built with libx264 (NVENC or Quick Sync are fine alternatives).
  • An ingest endpoint: the server URL and stream key from your platform, or your own media server's RTMP application name.
  • A measured sustained upload figure. Take it from a 60-second test to a distant server, not a 10-second burst to a nearby one.
  • ffprobe on the same machine for validation.

How to Configure an RTMP Encoder Step by Step

1. Budget the bitrate against your upload

Use this rule of thumb, which is our own planning heuristic: required upload equals (video bitrate plus audio bitrate) times 1.05 for FLV and TCP overhead, divided by 0.75 for headroom. For 1080p60, that is (6,000 + 160) × 1.05 ÷ 0.75, or about 8,624 kbps. The 25 percent headroom absorbs TCP congestion-window collapses and competing traffic. RTMP runs over TCP, so any sustained shortfall turns straight into encoder-side buffering and dropped frames.

2. Set rate control to CBR

Constant bitrate keeps the ingest flow predictable for the network and for the server-side transcoder. VBR spikes on high-motion scenes are exactly when your uplink is least able to absorb them. The OBS settings below map to Settings, Output, Output Mode: Advanced, Streaming tab.

OBS Studio fieldValueWhy
Encoderx264 or NVIDIA NVENC H.264H.264 is universally accepted over classic RTMP
Rate ControlCBRFlat ingest rate, predictable uplink use
Bitrate6000 KbpsFrom the budget in step 1
Keyframe Interval2 s (never 0)0 means auto, which produces irregular GOPs
CPU Usage Presetveryfast (x264) or P5 (NVENC)Leaves CPU headroom and avoids skipped frames
Profile / B-frameshigh / 2Better quality per bit, broadly decodable
Audio (Settings, Audio)48 kHz, stereo, 160 kbpsMatches broadcast and packager defaults

The single most damaging OBS default is Keyframe Interval 0, so set it explicitly to 2 before anything else.

3. Lock the keyframe interval

The keyframe interval must divide evenly into your HLS segment duration. Packagers can only cut at IDR frames. A 2-second GOP works with 2, 4 or 6 second segments, but a 4-second GOP forces a 6-second target into uneven 4 and 8 second segments. Published guidance from major live platforms in 2026 converges on 2 seconds, with 4 seconds as the common ceiling.

GOP length in frames equals fps times seconds: 60 at 30 fps, 120 at 60 fps. Disable scene-cut detection too, because extra I-frames inserted on cuts break alignment across transcoded renditions. Aligned segments also cache better. Segment N covers the same time range in every rendition, so a CDN such as BlazingCDN can serve ABR switches from cache instead of going back to the packager.

4. Configure audio

Use AAC-LC, 48 kHz, stereo, 128 to 160 kbps. The failure to avoid is a 44.1 kHz source feeding a 48 kHz encoder, or the reverse. Resampling in the wrong place produces slow A/V drift that shows up 30 to 60 minutes into an event, long after your smoke test passed. Classic RTMP in FLV carries H.264 and AAC only. The Enhanced RTMP specification adds HEVC, AV1 and VP9, but only use those if your ingest server explicitly supports them.

5. Enter the ingest URL and stream key correctly

Most ingest endpoints split into a server field and a key field. The server is the rtmp scheme, the host, port 1935 (optional, since it is the default) and the application path, for example rtmp://INGEST_HOST:1935/APP_NAME. Replace INGEST_HOST with your server's hostname and APP_NAME with the application, commonly "live". The stream key goes only in the key field. Pasting it into the server field as well produces a doubled path that the server rejects as an unknown stream.

If port 1935 is blocked on a corporate or venue network, switch to RTMPS on port 443, which wraps the same protocol in TLS. Treat the stream key as a credential and rotate it if it appears on screen or in a shared config.

6. For ffmpeg, assemble these parameters

The table lists the libx264 parameters that reproduce the OBS profile above, in the order you would pass them after your input.

ParameterValueEffect
-c:v / -preset / -profile:vlibx264 / veryfast / highCodec, speed and profile
-b:v / -maxrate / -bufsize6000k / 6000k / 6000kCBR with a 1-second VBV buffer
-x264-paramsnal-hrd=cbrStrict HRD-compliant CBR with filler
-g / -keyint_min / -sc_threshold120 / 120 / 0Fixed 2 s GOP at 60 fps, no scene-cut IDRs
-bf / -pix_fmt2 / yuv420pB-frames and a universally decodable chroma format
-c:a / -b:a / -ar / -acaac / 160k / 48000 / 2AAC-LC stereo at 48 kHz
-f and destinationflv, then the full server URL with /STREAM_KEY appendedRTMP requires an FLV container

Setting -sc_threshold 0 is the parameter most ffmpeg recipes omit, and it is the one that keeps GOPs exactly 2 seconds long.

Add -re before the input only when streaming from a file, so ffmpeg sends at real-time speed rather than as fast as it can read.

How to Validate the Stream

  • Keyframe spacing: record 60 seconds locally with the same settings. Run ffprobe with -select_streams v, -show_entries frame=pts_time,key_frame and -of csv. Keyframe timestamps should step by exactly 2.000 seconds, or 2.002 at 29.97 fps.
  • OBS stats (View, Stats): check network dropped frames and encoder-skipped frames. Both should be 0 over a 10-minute test. Network drops point to the uplink, and skipped frames point to CPU or GPU.
  • Ingest side: the server's reported input bitrate should sit flat within about 5 percent of your target.
  • Packaged output: every EXTINF value in the HLS media playlist should equal your target segment duration, except the last partial one.

Rollback

Before changing anything, export your current OBS profile (Profile, Export) or copy your working ffmpeg invocation into version control. If the new settings misbehave mid-event, stop the stream, import the old profile and restart. The ingest server treats it as a reconnect, and most players recover within one or two segment durations.

Common Streaming Encoder Failures: Symptom, Cause, Fix

  • Rising dropped frames (network) → bitrate above sustained upload, or bufferbloat on the uplink → lower the bitrate one ladder row or enable OBS dynamic bitrate.
  • "Encoding overloaded" or skipped frames → x264 preset too slow for the CPU → move to superfast or switch to NVENC.
  • Uneven HLS segments or ABR stalls → keyframe interval on auto, or scene-cut IDRs → set 2 s and disable scene cut.
  • Audio drifting after 30+ minutes → mixed 44.1 and 48 kHz sources → set every device and the encoder to 48 kHz.
  • Connection refused or timeout → port 1935 blocked → use RTMPS on 443.
  • Connects, then immediately disconnects → stream key duplicated in the server URL, or wrong application name → put the key only in the key field.

Tuning RTMP Encoding Once It Works: Trade-offs

A 1-second keyframe interval cuts join time and supports 1-second low-latency segments. The cost is roughly 10 to 20 percent more bits for the same visual quality at a fixed bitrate, so only take it if latency matters more than sharpness. Tune zerolatency removes B-frames and lookahead, which saves a few hundred milliseconds but costs quality per bit. Hardware encoders free the CPU but, at equal bitrate, typically trail x264 medium on quality.

For events that cannot fail, run a second RTMP encoder to the platform's backup ingest with identical GOP and audio settings. The failover is only seamless if both streams are frame-compatible. If you control delivery, review the CDN features that matter for live HLS segment delivery once ingest is stable.

FAQ: RTMP Encoder and Keyframe Interval Settings

What keyframe interval should an RTMP encoder use?

Use a fixed 2-second keyframe interval with scene-cut detection disabled. Two seconds divides evenly into 2, 4 and 6 second HLS segments, which keeps renditions aligned for adaptive bitrate switching. Intervals above 4 seconds are rejected or flagged by many ingest servers and slow down viewer join time.

Is CBR or VBR better for RTMP streaming?

CBR is better for RTMP ingest. RTMP runs over TCP, so VBR bitrate spikes on high-motion scenes can exceed available upload and cause dropped frames. VBR suits file-based encoding, where the encoder has no real-time uplink constraint. The server-side transcoder produces the adaptive ladder anyway.

What port does RTMP use for ingest?

RTMP uses TCP port 1935 by default, and RTMPS uses TCP port 443 over TLS. If an encoder cannot connect from a restricted network, switching to RTMPS on 443 usually works because that port is rarely blocked. The encoder settings stay the same; only the server URL scheme and port change.

Test Your Keyframe Alignment This Week

Pull 60 seconds of your current production stream and run the ffprobe keyframe check from the validation section. Then open one packaged HLS media playlist and scan the EXTINF values. If keyframes land anywhere other than exact 2-second steps, or segment durations vary, you have found the source of your ABR stalls. Your encoder is on auto or inserting scene-cut IDRs, and the fix takes two fields. Instrument network dropped frames and encoder-skipped frames as separate metrics on your next event. They fail for different reasons, and aggregating them hides which one you actually need to fix.