Skip to main content

What is rtmp://a.rtmp.youtube.com/live2? Complete RTMP-to-YouTube Guide

Decode YouTube's primary RTMP ingest URL, configure your encoder, and troubleshoot the most common errors. Sourced from official YouTube and OBS documentation.

Last updated: September 202612 min read

If you've ever pasted rtmp://a.rtmp.youtube.com/live2 into OBS or another encoder, you've used YouTube's primary live ingestion endpoint. The URL itself is plain text — no secret — but the protocol behind it (RTMP), the bitrate it expects, and the way it negotiates a connection with YouTube's servers are what actually decide whether your stream lands.

This guide walks through every part of that URL, the official encoder settings YouTube publishes, the difference between RTMP and RTMPS, a step-by-step OBS configuration, and real troubleshooting fixes pulled from the OBS Studio forums. Every recommendation has a citation; nothing here is invented.

What is RTMP and why does YouTube still use it?

The Real-Time Messaging Protocol (RTMP) was created by Macromedia for the Flash player era. After Adobe acquired Macromedia, it released the RTMP 1.0 specification on 21 December 2012, making the protocol publicly implementable by any encoder vendor. Adobe Flash itself reached end-of-life on 31 December 2020, but RTMP outlived its parent platform. YouTube, Twitch, Facebook Live, and almost every CDN ingest endpoint still standardize on RTMP because of one property: sub-second latency from encoder to server.

How RTMP actually works

RTMP runs over a single TCP connection — RTMP port 1935 by default, no firewall punch needed beyond outbound 1935. The handshake is a six-packet exchange: the client sends C0/C1/C2 and the server replies S0/S1/S2, with each main packet carrying 1,536 bytes of randomized data plus a timestamp used to synchronize the connection (Wikipedia: RTMP). Once handshaken, the connection stays open and chunks of audio (default 64 bytes) and video (default 128 bytes) flow continuously. The protocol exists in several variants — RTMP (plain), RTMPS (over TLS), RTMPE (Adobe-proprietary encryption), RTMPT (HTTP-tunneled), and RTMFP (UDP-based) — but RTMP and RTMPS are the only two that matter for YouTube ingestion in 2026.

Decoding rtmp://a.rtmp.youtube.com/live2: every part explained

Pasted into your encoder, the YouTube RTMP URL looks like this:

rtmp://a.rtmp.youtube.com/live2/<your-stream-key>

Each segment carries meaning:

  • rtmp:// — the protocol scheme. Tells your encoder to open a TCP connection on port 1935 and speak RTMP.
  • a.rtmp.youtube.com — the hostname of YouTube's primary ingest server. The "a" subdomain is the primary; the matching "b" subdomain is reserved for backup ingestion.
  • /live2 — the application path on the server. YouTube routes RTMP traffic to its live-streaming application via this path.
  • /<your-stream-key> — the unique identifier that ties the incoming stream to your channel. Treat it like a password: anyone with your key can broadcast to your channel.

Primary vs backup ingest

Production encoders that need redundancy can also push a duplicate stream to YouTube's backup server:

rtmp://b.rtmp.youtube.com/live2?backup=1

If the primary connection drops, YouTube falls over to the backup automatically. The backup feed must use the same stream key and ideally identical encoding settings.

Where to find your YouTube stream key for RTMP

Open YouTube Studio at https://youtube.com/livestreaming, click the Stream tab (or schedule a new stream), and copy the Stream key field. The Stream URL just above it shows the RTMP endpoint by default; click the lock icon to reveal the encrypted RTMPS variant.

RTMP vs RTMPS: which should you use for YouTube?

RTMPS is RTMP carried over a TLS connection. According to Google's official protocol comparison, RTMPS "benefits both content creators and viewers by preventing man-in-the-middle attacks on the ingestion side of livestreams." It is otherwise functionally identical to RTMP — same latency profile, same codec support, same encoder-side configuration.

  • Plain RTMP — no encryption, port 1935, URL: rtmp://a.rtmp.youtube.com/live2
  • RTMPS — TLS encrypted, port 443, URL: rtmps://a.rtmps.youtube.com/live2

Recommendation: use RTMPS for any production stream. Switch to plain RTMP only if your network blocks outbound 443 (rare in home setups, common in some corporate firewalls). The setup steps are identical — only the Stream URL changes. To find the RTMPS URL, click the lock icon in YouTube Live Control Room.

YouTube RTMP encoder settings (the official cheat-sheet)

YouTube publishes official YouTube RTMP settings for every supported resolution and frame rate. The numbers below come straight from that page.

Recommended YouTube RTMP video bitrate (H.264) by resolution and frame rate:

  • 4K / 2160p @ 60fps — 35 Mbps recommended; H.265 / AV1 accept 10–40 Mbps
  • 4K / 2160p @ 30fps — 30 Mbps recommended
  • 1440p @ 60fps — 24 Mbps recommended
  • 1440p @ 30fps — 15 Mbps recommended
  • 1080p @ 60fps — 12 Mbps recommended
  • 1080p @ 30fps — 10 Mbps recommended
  • 720p @ 60fps — ~7.5 Mbps (extrapolated from YouTube's table)

Beyond bitrate, YouTube specifies these fixed settings:

  • Keyframe interval (GOP): 2 seconds recommended; do not exceed 4 seconds. A longer interval breaks DVR seeking and increases latency.
  • Bitrate mode: CBR (constant bitrate). VBR is technically accepted but causes throughput spikes that trigger drops on the YouTube side.
  • Audio codec: AAC or MP3. AAC-LC is the standard.
  • Audio bitrate: 128 Kbps for stereo, 384 Kbps for 5.1 surround.
  • Video codecs: H.264 (universal), H.265 / HEVC (enhanced RTMP), AV1 (enhanced RTMP — newer encoders only).

Your upload bandwidth needs roughly 1.5× the target bitrate as headroom. To match a YouTube target to your real ISP speed, use our bitrate calculator.

How to set up YouTube RTMP streaming in OBS Studio (5 steps)

OBS Studio is the de-facto open-source RTMP encoder. These five steps get you from a blank YouTube channel to a live RTMP stream. The same pattern applies to vMix, Streamlabs, Wirecast, and most cloud-streaming services — they all expose a Server URL plus Stream Key pair.

1

Get your stream URL and key from YouTube

Open YouTube Studio Live Control Room at https://youtube.com/livestreaming. Click the Stream tab to open the encoder settings panel.

  • Click "Go Live" or "Schedule Stream" via the Manage tab if you haven't already
  • Under "Stream settings", copy the Stream URL — by default it shows the plain RTMP variant
  • Click the lock icon next to the URL to reveal the RTMPS encrypted variant (recommended)
  • Copy the Stream key field — treat it like a password and never share it publicly
🔗Reset your stream key from this same panel if you ever leak it or suspect unauthorized use.
2

Configure the Stream service in OBS

In OBS Studio, open Settings → Stream. Pick "YouTube - RTMPS" from the Service dropdown if you want OBS to manage the URL automatically, or pick "Custom..." if you copied a specific RTMP/RTMPS URL.

  • Service: choose YouTube - RTMPS for the simplest setup, or Custom to paste your own URL
  • Server: keep "Primary YouTube ingest server" unless you have a specific reason to use Backup
  • Stream Key: paste the key copied in step 1
  • Click Apply to save before opening another tab
⚙️If you pick Custom, paste the full URL including the /live2 path: rtmps://a.rtmps.youtube.com/live2.
3

Set output bitrate to YouTube's recommended values

Open Settings → Output and switch Output Mode to Advanced for full control. Set Encoder, Bitrate, and Keyframe Interval according to the cheat-sheet in section 4.

  • Encoder: x264 (CPU) or NVENC / AMF / QuickSync (GPU). GPU encoders offload work from your CPU.
  • Rate Control: CBR (constant bitrate)
  • Bitrate: 12000 Kbps for 1080p60, 10000 for 1080p30, ~7500 for 720p60
  • Keyframe Interval: 2 seconds (NOT 0 — OBS treats 0 as automatic, which can exceed YouTube's 4-second cap)
📈If your stream stutters or drops frames, lower bitrate by 25% before changing anything else. Network throughput is almost always the bottleneck, not encoder choice.
4

Set video resolution and frame rate

Open Settings → Video. The Output (Scaled) Resolution and Common FPS values determine what YouTube actually receives.

  • Output (Scaled) Resolution: 1920x1080 for 1080p, 1280x720 for 720p
  • Common FPS Values: 30 or 60 — match what your bitrate target assumes
  • Downscale Filter: Lanczos (highest quality) if your CPU has headroom; Bicubic for older hardware
🖥️Don't push 4K from a laptop unless you've verified the encoder can sustain 35 Mbps for hours. A dropped frame on a 24/7 stream looks worse than a clean 1080p signal.
5

Start streaming and verify on YouTube

Close Settings, return to the OBS main window, and click Start Streaming. The status bar at the bottom should show stable bitrate and CPU usage within 5–10 seconds.

  • Open YouTube Studio Live Control Room in another tab
  • Within 30 seconds the preview should populate and the status badge changes from "Connect streaming software" to "Live"
  • Click Go Live in YouTube Studio to publish — until you do, only you can see the stream
  • Watch the OBS Stats dock (View → Stats) for Skipped frames and Dropped frames — both should stay at 0
🚀Always run a private test stream the first time you change encoder settings. YouTube can take 24+ hours to enable live streaming on a brand-new channel.

For deeper OBS configuration, see our OBS setup guide. For 24/7 streaming specifically, see the 24/7 streaming setup guide.

Troubleshooting common YouTube RTMP errors

These are the four errors that show up most often on the OBS Studio support forums, with the fixes that actually resolve them. If YouTube reports that no data is arriving at all rather than showing a connection error, that is a different diagnosis — the "no data is being received" guide separates the four causes.

"Failed to connect to server. The connection timed out."

OBS displays this exact message when the TCP handshake on port 1935 (or 443 for RTMPS) never completes. The cause is almost always network-side, not OBS-side.

  • Check that your firewall allows outbound connections on port 1935 — Windows Defender and corporate firewalls sometimes block it as suspicious high-throughput traffic
  • If 1935 is blocked, switch to RTMPS — port 443 is open almost everywhere
  • Regenerate your stream key in YouTube Studio. A revoked or copy-pasted-with-leading-whitespace key triggers an authentication failure that surfaces as "connection timed out"
  • Verify the Stream URL doesn't include any trailing whitespace or invisible characters

"Disconnected from server" / WriteN send errors

Stream connects, runs for 30 seconds to several minutes, then drops. The OBS log shows WriteN errors on the RTMP socket.

  • Use ethernet, not Wi-Fi — Wi-Fi packet loss looks fine on speed tests but kills sustained RTMP throughput
  • Check your MTU — values above 1500 cause some routers to fragment packets, which YouTube sometimes rejects. Set MTU to 1492 or 1472 if you're behind PPPoE
  • Some ISPs throttle sustained upload via deep packet inspection. Test by streaming through a VPN — if the drops disappear, your ISP is the cause

SSL handshake error on RTMPS

Specific to RTMPS connections: TLS negotiation fails before any video data flows.

  • Append :443 to the URL: rtmps://a.rtmps.youtube.com:443/live2 — some encoders need the explicit port
  • Update OBS to the current version. YouTube has rotated TLS certificates several times; older OBS builds shipped with stale CA bundles
  • If RTMPS continues to fail, fall back to plain RTMP on 1935 as a temporary workaround

Buffering or dropped frames on the YouTube side

Stream is "live" but viewers see buffering, frame drops, or video unavailable intermittently.

  • Confirm Rate Control is CBR, not VBR. YouTube's ingest is sensitive to bitrate spikes
  • Lower bitrate by 25% — your upload bandwidth is the most common culprit, even if speedtests show otherwise
  • Check encoder load: open Task Manager / Activity Monitor. OBS shouldn't sustain >80% CPU on x264. If it does, switch to NVENC or hardware encoding

When NOT to run RTMP yourself: the cloud-streaming alternative

RTMP from your laptop works for a 2-hour gameplay session. For 24/7 streams it falls apart fast. Your PC has to stay on continuously, which adds 30–80 USD per month in electricity, wears out fans and storage, and ties your internet uplink to one device. Any reboot, OS update, or 30-second internet drop kills the stream.

Cloud streaming services pre-configure the RTMP pipeline server-side. TheLoops, for example, sets the same rtmp://a.rtmp.youtube.com/live2 endpoint and your stream key behind the scenes — but the encoder runs in a datacenter with auto-reconnect, automatic bitrate adjustment, and content scheduling. You upload videos, point the service at your YouTube channel, and the stream stays live without your computer being involved.

Ready to stop running OBS yourself?

TheLoops handles the entire RTMP pipeline for you — same rtmp://a.rtmp.youtube.com/live2 endpoint, but pushed from cloud servers with auto-reconnect, scheduled playlists, and zero electricity cost on your end.

No software to install or maintain
Automatic stream recovery on network drops
Free for 24 hours, no credit card required
Start Free Trial

Frequently Asked Questions

It's YouTube's primary RTMP ingestion endpoint where encoders like OBS, vMix, and cloud streaming services send your live video. The "a" indicates the primary server (b is backup) and /live2 is the application path. Combined with your unique stream key, it identifies which channel the stream belongs to.

RTMPS is RTMP over TLS — the stream is encrypted in transit, which prevents man-in-the-middle attacks. YouTube recommends RTMPS for any production stream; you find it by clicking the lock icon in Live Control Room. Use plain RTMP only if your network blocks port 443 outbound.

Plain RTMP uses TCP port 1935 (the protocol default). RTMPS uses TCP 443. If your home firewall blocks 1935 outbound (some corporate and school networks do), you'll see "Failed to connect to server" — switching to RTMPS on 443 usually fixes it without changing anything else.