Skip to content

Maximizing Broadcast Quality in LiveSwitch

Jacob Steele Jun 21, 2023 4:07:51 PM

Livestreaming has become an integral part of our digital landscape, allowing us to connect with audiences worldwide in real time. Whether you're a content creator, a broadcaster, or a business looking to engage customers, ensuring high broadcast quality is crucial. In this article, we will explore the key strategies and techniques for maximizing broadcast quality in LiveSwitch, ensuring an exceptional livestreaming experience for your audience.

Question: How do I maximize broadcast quality when I have a single C# sending client?

Answer:  When it comes to maximizing broadcast quality with a single C# sending client, it's important to explore the various encoder settings available. In this guide, we will primarily focus on Vp8/Opus, as these codecs are commonly used. Keep in mind that there are additional options beyond those listed below that may impact quality. However, I will highlight the key settings that I prioritize when adjusting the quality of my broadcasts.

Please note that the majority of our use cases are conferencing so our default settings are optimized for conferencing purposes, which may not yield the best results for broadcasting. By modifying the settings from our VOIP defaults to align more with broadcasting requirements, you can significantly enhance the quality of your streams.

 

Opus

To ensure high-quality audio in your broadcasts, you can fine-tune the Opus encoder settings. Consider the following configuration:

var audioEncoder = new FM.LiveSwitch.Opus.Encoder();
audioEncoder.TargetBitrate = 512; //max quality... defs be overkill. 1-512
audioEncoder.CodecConfig.ForceChannels = 2; // 1-2
audioEncoder.CodecConfig.IsVbr = true; // true/false
audioEncoder.CodecConfig.UseConstrainedVBR = false; //true/false
audioEncoder.CodecConfig.Application = FM.LiveSwitch.Opus.ApplicationType.Audio; // instead of voip - reduces compression.
audioEncoder.CodecConfig.Bandwidth = FM.LiveSwitch.Opus.Bandwidth.FullBand; // reduces compression.

 

VP8

For optimal video quality in your broadcasts, it is essential to configure the VP8 encoder settings. Consider the following adjustments:

var videoEncoder = new FM.LiveSwitch.Vp8.Encoder();
videoEncoder.TargetBitrate = 3000; // for 720 at 30 fps
videoEncoder.CodecConfig.MinQuantizer = 23; // 0 - 63 - lowers better quality 
videoEncoder.CodecConfig.MaxQuantizer = 56; // 0 - 63 - lowers better quality
videoEncoder.CodecConfig.EndUsageMode = FM.LiveSwitch.Vpx.EndUsageMode.CQ; // constant quality (will raise bitrate during motion)

 

Additional Resources:

  • For a comprehensive guide on VP8, refer to this link: VP8 Tuner Guide
  • To determine suitable bitrates, you can consult this guide: Twitch Encoding Bitrate Guide (although it focuses on H.264, it can still serve as a starting point)

 

Understanding End Usage Modes

Different encoding modes impact the behavior of bitrate during motion events. Here are some observations based on tests with a target bitrate of 1024:

CBR (constant bitrate)

CBR showcases a significant drop in bitrate during full-frame motion, leading to pixelation. It is the default mode but may not be ideal for maintaining high-quality video.

 

VBR (variable bitrate)

The bitrate spikes upward during motion and gradually decreases, offering good quality. However, it may trigger bandwidth adaptation if viewers' connections cannot handle the higher bitrate.

 

CQ (constant quality)

CQ mode disregards the target bitrate and uses any required bitrate to maintain quality. This flexibility makes it a favorite choice of mine, although it is more susceptible to bandwidth adaptation.

 

Need assistance in architecting the perfect WebRTC application? Let our team help out! Get in touch with us today!