The StreamSpot Blog

Insight, news and reviews from the StreamSpot staff

Compression, Codecs, Keyframes, and the Basics of Stream Quality

Posted by Corey Taylor on Jul 10, 2017 4:42:51 PM

A/V technology, particularly as it relates to streaming, has come a long way in a relatively short amount of time. In the last few years, shooting high-quality video has gone from an investment in particularly expensive capture equipment to something achievable by much more practical and affordable equipment, while still producing a high-quality product. However, this great quality has some downsides, including the fact that high quality translates to a very high data rate (or bitrate), with some as high as 5TB an hour! These files are too large for most user’s internet connections, even those who may have incredible download speeds, and most devices your viewers are watching your stream on aren’t designed to play these videos in the format in which they are shot. The solution to all these problems? Video compression.

By compressing video into smaller sizes and formats, we’re able to deliver your video much faster, allowing your viewers to play the video back in higher quality. The trick to this is something called a coder-decoder, or a codec. A codec allows you take your video and digitally encode it. Once the video reaches the end device and user, it is decoded and played back at a high quality. There are many codecs available, but the most popular and commonly used are AVC/H.264 and HEVC/H.265. The main goal of a codec is to reduce the bitrate and file size of your video while maintaining quality once it’s decoded.

Video Compression and Keyframes
Different encoders implement different types of compression. Intra-frame compressions reduce the file size of keyframes (also called I-frames) using the same techniques used on digital pictures and images. A keyframe is a bit like a reference point for the encoder to use while it’s compressing your data. Codecs will apply compression techniques to process the frames between keyframes. For example, let's say a car is driving past a building in your video. Since the building is static background and doesn’t move, the encoder doesn’t resend that part of the image. The encoder will only process the changed parts of the video, like the moving car in our example. Doing this reduces the file size which means less data that has to be sent and decoded.


Once compression has been applied to all the frames in a video, you end up with something called a bitrate— the amount of data required to store all the compressed data. We usually measure bitrate in kilobits or megabits per second. Generally speaking, a higher bitrate means a higher quality video. This translates to more bandwidth being needed to deliver the video to a viewer.

Constant bitrate vs variable bitrate
A constant bitrate (CBR) encodes your video at a consistent rate for the duration of your broadcast. There will be minor fluctuation in the rate due to a variety of factor, but this variation is minor. This is the most common type of bitrate used among StreamSpot customers.

A variable bitrate (VBR) means the bitrate can and will vary greatly for the duration of your broadcast. VBR spreads the bits around, using more bits for more complex parts of your video and less for static and less complex areas.

Which codec is used to deliver my video?
Currently, H.264 is the best codec for both quality and bitrate size. Most content publishers use it and it's the codec we suggest using here at StreamSpot.

Adaptive bitrate streaming
A decade ago, watching a video or stream online could be pretty tedious. You’d often wait 30 seconds to a minute for the video to start only to suffer several stops and buffering. The modern solution to this issue is adaptive bitrate (ABR) streaming. In adaptive streaming, each video file contains multiple streams encoded at different bitrates and resolutions. Each stream is delivered in sections lasting a few seconds long, and the receiving device chooses the best section based on the current network and device conditions. The devices always chooses the highest possible bitrate and quality at any given time, giving the viewer the best possible viewing experience based on the device they're using.

Rest assured, as a StreamSpot customer, our support team is here to assist you with any questions you may have on all things streaming. We are happy to evaluate your current settings to ensure you’re providing the best possible quality video to your viewers on all devices they might be using to watch your stream!


Topics: Faith-Based Streaming, Live Streaming Overview, streaming basics, buffering