Optimizing Video Encoding Settings for Your Use CaseFebruary 26, 2019 We recently looked at video codecs and how encoding works. Today, we’re discussing some video encoding best practices based on your broadcast event. Read on for common terminology and some recommended settings.
Encoding Best PracticesIt’s important to understand what you’re trying to deliver when configuring a live stream. The right encoding settings depend entirely on your use case. For example, music events require the best audio possible. Security cameras? Not so much. And while video chats don’t need to be streamed in 4K, maximizing quality takes first place for many high-profile broadcasts. The perfect encoding configurations for your live stream might be ill-suited for another’s. This brings us to the first step when setting up your encoder: considering the specifics of your streaming scenario. You’ll want to optimize for:
- Use Case
- Venue or Location
- Available Bandwidth
- Degree of Motion
Video Quality vs. BandwidthHigh-quality videos make for bandwidth-intensive streams. And in today’s digital world, bandwidth means money. What’s more, your internet speed must be able to handle the bandwidth you’re trying to encode. Encoding low-bitrate streams whenever possible helps minimize costs. We recommend adjusting the following attributes based on your unique broadcast.
Frame RateFrame rate refers to the speed at which each frame is shown. The lower the frame rate, the choppier the video. Smooth HD streams use 60 frames per second (fps), meaning that each second of video contains 60 distinct images. Going with a standard value like 25 or 29.97 fps is often a safe bet. Reducing the frame rate even further can help minimize overall bitrate when quality doesn’t matter. For remote cameras used to capture security footage, a frame rate of about 10-15 fps works fine.
Keyframe IntervalA key frame interval, also called an i-frame interval, is an encoding setting that determines how often the whole picture is transmitted. When a stream is encoded, only some frames show the complete picture. The initial (key) frame includes a complete image, while subsequent (delta) frames only depict changes from that image. This helps reduce redundant data and lower the bandwidth. If your video stream depicts static scenes such as a news desk or talk show, then a keyframe interval of two seconds would suffice. But action-packed streams of sporting events require a shorter keyframe interval of around one second.
Audio BitrateCrystal-clear audio matters. Viewers will abandon a stream altogether if they can’t hear what’s going on. For this reason, it’s also important to allocate bandwidth to the audio segment. That said, audio plays a bigger role in some streams than others. You’ll want to use a higher audio bitrate for a news broadcast than for a sporting event. While perhaps counterintuitive, this has to do with how your audience is engaging. When it comes to the news, viewers listen to what the reporter has to say. With sporting events, they watch the game.
Overall BitrateOverall bitrate is one of the hardest things to balance against quality and the type of streaming event. In most cases, engineers attempt to push the bitrate as high as possible in an attempt to get the best picture quality. There are two issues with this approach:
- Encoding high-bitrate streams without sufficient bandwidth and resources can corrupt the video.
- Viewing high-bitrate streams without sufficient bandwidth can result in dropped video frames.
Recommended Encoder ConfigurationsWe recommend customizing the keyframe interval, frame rate, audio bitrate, and video bitrate to your streaming scenario. That way, you’ll encode a suitable stream in the most efficient manner possible. Below are a few standard recommendations based on use case, degree of motion, audience, and available bandwidth. Sports and Gambling Events Sports and gambling events require a short keyframe interval to accommodate the pace of movement, which also allows you to tune down the latency. The audio bitrate doesn’t need to be as high since the action is on the field.
- Keyframe Interval: 1 second
- Frame Rate: 29.97/25 fps
- Audio Bitrate: 128-192 kbps
- Adaptive Bitrate Streaming: Yes
- Keyframe Interval: 1-4 seconds
- Frame Rate: 29.97/25 fps
- Audio Bitrate: 192-256 kbps
- Adaptive Bitrate Streaming: Not essential
- Keyframe Interval: 4 seconds
- Frame Rate: 10-15 fps
- Audio Bitrate: 64-128 kbps
- Adaptive Bitrate Streaming: No
Just Getting Started?New to streaming? Get started with a free developer trial of the Wowza Streaming Engine™ software or the Wowza Streaming Cloud™ service. Both solutions integrate with a variety of encoders, including the free Wowza GoCoder™ mobile app and SDK.
Additional ResourcesEncoding Best Practices for Wowza Streaming Cloud
Optimize the Video Bitrate for Wowza Streaming Engine
Video: Connect an RTMP Encoder to Wowza Streaming Engine