Stream to YouTube with HLS in OBS Studio
This guide provides a straightforward, step-by-step walkthrough on how to configure OBS Studio to stream to YouTube using the HTTP Live Streaming (HLS) protocol. Transitioning from RTMP to HLS allows you to stream in higher-efficiency codecs like HEVC (H.265) or AV1, which deliver superior video quality, HDR support, and better stability at lower bandwidths.
Step 1: Enable HLS in YouTube Control Room
Before configuring OBS, you must set up an HLS-compatible stream key in your YouTube account.
- Go to the YouTube Studio dashboard and click Go Live in the top right corner.
- In the Live Control Room, navigate to the Stream Settings tab.
- Under Stream key selection, click the dropdown and select Create new stream key.
- Name your stream key and ensure the Stream Protocol is set to HLS (highly recommended).
- If you want to stream in HDR, toggle the Turn on manual resolution/frame rate selection and select your desired resolution (e.g., 4K or 1440p).
- Copy the Stream Key generated by YouTube.
Step 2: Configure Stream Settings in OBS Studio
Next, you need to point OBS Studio to YouTube’s HLS ingestion servers.
- Open OBS Studio and click Settings in the bottom right corner.
- Select the Stream tab from the left-hand menu.
- Click the Service dropdown menu and select YouTube - HLS.
- Keep the Server set to Primary YouTube Ingest Server.
- Click Use Stream Key, paste the stream key you copied from YouTube into the text field, and click Apply.
(Alternatively, you can click “Connect Account” to sign in directly, which automatically configures the HLS connection.)
Step 3: Optimize Video Encoder Settings for HLS
HLS achieves its high efficiency by utilizing modern video encoders. You must configure OBS to use HEVC or AV1 instead of the older H.264 encoder.
- In the Settings window, click on the Output tab.
- Change the Output Mode dropdown at the top to Advanced.
- Under the Streaming tab, locate the Video Encoder option.
- Select one of the following modern encoders based on your hardware:
- NVIDIA NVENC HEVC or NVIDIA NVENC AV1 (for NVIDIA graphics cards)
- AMD HW H.265 or AMD HW AV1 (for AMD graphics cards)
- SVT-AV1 or AOM AV1 (CPU-based AV1 encoders, resource-intensive)
- Set your Rate Control to CBR (Constant Bitrate).
- Set your Bitrate according to your target
resolution:
- 1080p (60fps): 6,000 to 10,000 Kbps
- 1440p (60fps): 10,000 to 15,000 Kbps
- 4K (60fps): 20,000 to 30,000 Kbps
- Set the Keyframe Interval to exactly 2 s (2 seconds). This is a critical requirement for HLS streaming.
- Click Apply.
Step 4: Configure Video Resolution
- Navigate to the Video tab in the Settings window.
- Set the Base (Canvas) Resolution to match your monitor’s resolution.
- Set the Output (Scaled) Resolution to match the target resolution you chose in Step 3.
- Set the Common FPS Values to 60 (or 30 depending on your preference).
- Click OK to save all settings.
Step 5: Start the Stream
- Click Start Streaming in the main OBS Studio window.
- Go back to your YouTube Live Control Room in your web browser.
- Within a few seconds, YouTube will begin receiving the HLS feed, displaying a preview and indicating an “Excellent Connection” status.
- If your stream is not set to auto-start, click Go Live in the YouTube Control Room to begin broadcasting to your viewers.