Video Encoders

Encoding, Decoding, and Transcoding: How Your Live Stream Reaches Your Viewers

This post covers encoding, decoding, and transcoding, the processes behind sending live streams efficiently across the internet to your viewers. It's part of our series on video encoders.

In its raw form, high-quality video is too bulky for broadcasters to upload and viewers to download. Encoding, decoding, and transcoding are three core processes that underlie the speedy transfer of video files to a playable format for your viewers around the world.

What is encoding?

Encoding is the process of compressing large video files for easier uploading to the internet. Broadcasters use either a hardware or software video encoder for the task.

Let's say you want to stream in 1080p60.

An uncompressed 1080p video frame is about 6 Megabytes (MB). At 60 frames-per-second, you'd need an upload speed of almost 3 Gigabits-per-second (Gbps) to send that 1080p video to the internet.

Fortunately, most cameras use a technique called chroma subsampling to reduce the amount of data needed to represent the image. This process can cut your 1080p60 video to about 1.4 Gbps.

Encoding is your answer for squeezing your video down to an even more manageable size for rapid transit across the information superhighway.

The process uses video codecs— like ProRes, MPEG-4, H.264, HEVC, VP8, and AV1— to compress your video.

The most common video codec for streaming is H.264. Using H.264, you can send your 1080p60 video stream at about 12 Megabits-per-second (Mbps). Recall that without compression, the raw video would require an upload speed of 3 Gbps— or 3000 Mbps. H.264 encoding reduces upload bandwidth needs by over 99%.

Screen Shot 2019-01-22 at 2.05.07 PM

HEVC is another video codec gaining traction in the streaming world; it promises higher quality video for the same bit rate, or a reduction in bit rate over an equivalent-quality H.264-encoded stream.

If you're streaming from a video camera set up, you'll need either a software encoder or a hardware encoder— like the BoxCaster or BoxCaster Pro— to encode your video for transfer to the internet.

If you use a mobile device for video capture, your phone or tablet has a built-in encoder. All recent iOS devices can encode your video in HEVC under the right conditions. You can take advantage of the powerful codec in your iOS device with our Broadcaster App.

Once your video is encoded, it's ready for transfer across the internet to your viewers. Reaching your viewers across the world requires a content delivery network (CDN). Most live streaming platforms provide CDNs as a part of their service.

Once the compressed video reaches your viewers, it needs to be expanded back to its original size. That's where decoding comes in.

 

What is decoding?

Decoding is the opposite process of encoding. The action takes compressed video files and expands them back to their original form. Decoding makes your video suitable for display on your computer monitor, TV screen, projector, or phone.

When paired, encoding and decoding enable efficient live video delivery under the constraints of your network. It's all well and good until you realize you don't really want every viewer to receive that 1080p60 video. Viewers watching the stream over limited network connections and on small screens need a video with different specs to prevent buffering. Luckily, we have the third process— transcoding.

 

What is transcoding?

Transcoding is the process of taking an encoded stream and modifying some attributes— like the image size or the encoded bit rate— in a meaningful way. A transcoder receives an encoded video stream from an encoder, decodes it into a raw video again, changes it in some significant way, and re-encodes it.

One of the main benefits of transcoding is outputting multiple variants.

If your original stream is 1080p, the process will allow you to create alternate streams— for instance, 720p and 480p streams. Since your viewers have a variety of display capabilities and network speeds, providing several variants for them ensures they can watch on almost any device. You may recognize variant options from the gear icon on a video player that allows you to change your picture quality as a viewer.

With a process called adaptive bitrate playback— a feature of the BoxCast Platform— the viewer will automatically be matched with the optimal variant for their viewing condition.

Adaptive bitrate playback ensures that even if your viewer is watching your high-quality stream on their phone on a busy bus, they will not get buffering.

Broadcasters can choose to transcode on-site or in the cloud. Transcoding in the cloud removes the burden of encoding and transmitting all of the variants from your location to the cloud, which saves both your computing resources and network bandwidth.

 

Cloud-Transcoding

 

Cloud transcoding also lets you alter your stream in other ways. You can change image size for playability on devices with smaller or larger screens. You can modify video codec and codec parameters for compatibility with devices that support other standards. Transcoding even allows you to add graphic overlays or composites of the video for scoreboards, lower thirds, or additional image layers.

Transcoding is essential for reaching your audience across all of their many devices and viewing conditions.

 

Final Thoughts + Further Reading

Here at BoxCast, our platform takes care of encoding, decoding, and transcoding to ensure your viewers receive your stream in the most efficient way possible.

Happy streaming 😃!