How to Livestream via OBS with Livepeer Studio

How to Livestream via OBS with Livepeer Studio

In today's digital age, live-streaming has become a powerful medium for content creators and businesses alike. Whether you're hosting a virtual event, running a webinar, or simply sharing your gaming experiences with an audience, effective live-streaming can significantly enhance your reach and engagement. One of the most popular tools for this is OBS (Open Broadcaster Software), known for its ease of use, open-source nature, and high degree of customization.

In this guide, we'll walk you through the process of setting up a live stream using Livepeer Studio with OBS, offering advanced features to ensure high-quality streaming.

Why OBS and Livepeer Studio?

OBS is a favorite among many creators due to its versatility and robust feature set. When paired with Livepeer Studio, an innovative and cost-effective video streaming platform, the combination offers unmatched efficiency and scalability. Livepeer Studio's API-first, open-source approach ensures seamless integration and superior streaming quality.

Getting Started

Step 1: Obtain a Unique Stream Key

Before you start streaming, you'll need a unique stream key from Livepeer Studio. Follow our previous guide on creating a stream to get this key. This key is essential for configuring OBS and ensuring your stream connects to Livepeer Studio's platform.

Step 2: Open OBS and Create a Source

  1. Open OBS.
  2. Click the `+` icon under "Sources."
  3. Select `Video Capture Device` if you’re using a camera or webcam. For streaming a browser window, choose `Window Capture`.
  4. Name your device (e.g., `OBS1`, `OBS2`, `OBS3`).

Step 3: Update Stream Settings

  1. Navigate to `Stream settings`.
  2. Choose `Show All…` and select `Livepeer Studio` for the service.
  3. Keep the `Default Server` and paste the stream key provided by Livepeer Studio into the OBS “Stream Key” fields.

Note: It's recommended to follow the streaming service recommendations for optimal performance. Ignoring these may require additional adjustments as discussed in the low latency section below.

Step 4: Start Streaming

After saving your settings, OBS will return to the stream console. Press `Start Streaming` based on the output settings you've configured. Viewers can now play back the livestream using the playback ID.

Configuring OBS for Low Latency

Balancing low latency with high stream quality is crucial for providing an optimal user experience. Here are some key settings to consider:

Low Latency Settings

  1. Rate Control:
  • Dictates the bitrate or "quality" of the stream. Higher bandwidth means better quality but requires a stable connection.
  1. Keyframe Interval:
  • Determines how often a full frame appears. More frequent keyframes reduce latency but increase bandwidth needs.

Optimizing for Low Latency

  • Set the keyframe interval to a lower value for more frequent keyframes.
  • Turn off B-frames for the lowest latency. B-frames increase latency due to their need for a larger encode buffer.

Optimizing for Stream Quality

  • Rate Control:
  • Use CBR (Constant Bit Rate) or CRF (Constant Rate Factor) to maintain a balance between quality and bandwidth.
  • Peak Bitrate:
  • A higher peak bitrate improves quality but may cause playback issues like buffering for some viewers.

Livepeer-specific Considerations

Livepeer primarily uses HLS (HTTP Live Streaming), which has specific keyframe interval requirements:

  • A 2-second keyframe interval is recommended for low latency.
  • For higher quality on poor connections, a 5-second keyframe interval may be better, though it increases latency.

Here are some profiles to help you balance low latency with stream quality:

Low Latency, High Quality

  • Rate Control: CRF
  • CRF: 25
  • Keyframe Interval: 1
  • CPU Usage Preset: Very fast
  • Profile: High
  • Resolution: 1080p
  • x264 Options: bframes=0

Low Latency for Bad Connections

  • Rate Control: CBR
  • Bit Rate: 1200
  • Keyframe Interval: 1
  • CPU Usage Preset: Very fast
  • Profile: High
  • Resolution: 720p
  • x264 Options: bframes=0

Balanced High Quality

  • Rate Control: CRF
  • CRF: 25
  • Keyframe Interval: 2
  • CPU Usage Preset: Very fast
  • Profile: High
  • Resolution: Any
  • x264 Options: None

Balanced for Bad Connections

  • Rate Control: CBR
  • Bit Rate: 2000
  • Keyframe Interval: 2
  • CPU Usage Preset: Very fast
  • Profile: High
  • Resolution: Up to 1080p
  • x264 Options: None

High Quality, High Latency

  • Rate Control: CRF
  • CRF: 27
  • Keyframe Interval: 10
  • CPU Usage Preset: Very fast
  • Profile: High
  • Resolution: 1080p
  • x264 Options: bframes=3

Low Bandwidth, High Latency

  • Rate Control: CBR
  • Bit Rate: 700
  • Keyframe Interval: 10
  • CPU Usage Preset: Very fast
  • Profile: High
  • Resolution: 720p or lower
  • x264 Options: bframes=3

Conclusion

Setting up a livestream via OBS with Livepeer Studio not only enhances your streaming capabilities but also ensures you deliver high-quality content to your audience. By following the recommended settings, you can balance latency, quality, and user experience effectively.

Ready to take your livestream to the next level? Sign up for free with Livepeer Studio and explore the endless possibilities of seamless and efficient video streaming.