What Is Video Encoding? (Update)March 9, 2023
Just a few decades back, cell phones weighed more than today’s laptops and home theaters overflowed with VHS tapes. The ability to fit more data into less space has been one of the most remarkable feats of the past century — and compression technologies like video encoding have made it all possible.
Streaming now makes up a considerable chunk of the digital information floating around, with video expected to account for 82.5 percent of all internet traffic in 2023. In this blog, we’ll look at what video encoding is and its role in live video delivery. We’ll also explore the differences between lossy and lossless compression, common video encoding formats used for streaming, and the difference between video encoding vs. transcoding.
Table of Contents
- What Is Video Encoding
- Why Is Video Encoding Necessary?
- How Does Encoding Work?
- Video Encoding Formats for Live Streaming
- Encoding vs. Transcoding: What’s the Difference?
- What Is Adaptive Bitrate Streaming?
- Get Started Today
What Is Video Encoding
Video encoding describes the process of converting raw video into a compressed digital format for efficient delivery across the internet. Encoding occurs as soon as a video stream is captured and plays an essential role in all live streaming workflows. The encoder itself might be built into a camera, but it can also take the form of a hardware encoding appliance, computer software like OBS Studio, or a mobile app.
Why Is Video Encoding Necessary?
Video encoding is essential because raw video files are too large to send through most internet connections. For example, an uncompressed video at 480p (a low resolution) and 30 frames per second can have a data rate of 220 Mbps (Megabits per second), but the average home internet connection in the U.S. has a download speed of 189 Mbps and an upload speed of 23 Mbps. These large files wouldn’t even fit on a DVD or Blu-Ray disc. It would be like stuffing a large object down a tube with a diameter half its size — not to mention even more difficult when resolutions, frame rates, and color depths are higher.
Encoding, however, makes it possible to stream HD videos on basic home internet or through mobile data. Without video encoding, the only way to watch footage would be on the original device it was recorded on.
How Does Encoding Work?
Milliseconds after a live stream is captured, the data must be shrunk down for efficient transportation across the internet. Often, streams are reduced from gigabytes of data to megabytes of data.
Video encoding software and hardware rely on two-part compression tools called codecs to achieve this. Specifically, codecs apply algorithms to the video and audio data to condense it in every way possible. Once the stream reaches viewers, a video decoder built into the player software or set-top box decompresses the data for playback.
And by “condense,” we actually mean the encoder’s algorithm discards visual data it considers irrelevant. It might be pixels that don’t make a difference to a positive video experience or something else, but unlike a ZIP file, decompressing a video doesn’t restore the file as it originally was — it’s forever changed.
What Is a Codec
A codec refers to the compression technology that acts upon video and audio data to shrink it into a streamable size. Literally ‘coder-decoder’ or ‘compressor-decompressor,’ codecs apply algorithms to initially compress the data for transmission, and later decompress for viewing.
When it comes to streaming live video, both video and audio codecs come into play. H.264, also known as AVC (Advanced Video Coding), is the most common video codec. AAC (Advanced Audio Coding) is the most common audio codec.
Encoding in Action à la the MP3 Codec
For the sake of illustration, let’s focus in on an audio compression technology you’re sure to know by name: MPEF-1 Audio Layer III, a.k.a. MP3.
The MP3 codec revolutionized music consumption in the 1990s. Overnight, music libraries that once filled storage cabinets with CDs could be crammed into hand-held MP3 players — with no noticeable change in quality.
The MP3 codec did this by discarding all audio components beyond the limitations of human hearing for efficient transportation and storage. This is called lossy compression, an essential encoding method for video streaming.
Lossy vs. Lossless Video Encoding
Lossless compression occurs when the data is compacted without any information being discarded. A trusty ZIP file does just this, allowing us to cram a bunch of information into a small amount of space while preserving data integrity.
On the other hand, lossy compression enables a much greater reduction in file size by tossing out unnecessary data. Size is important when it comes to streaming, making lossy compression a must.
The goals of lossy compression are threefold:
- Drop all data that would go undetected by the human eye or ear
- Reduce the quality where possible
- Quickly compress all remaining data
When encoding for live streaming, lossy compression ensures efficient transmission across the internet. As such, all the encoding formats in our list below fall in this camp.
Subscribe and stay up to date
Get all the details on codecs and protocols, the latest live streaming trends, and much more.Subscribe
Video Encoding Formats for Live Streaming
Before getting into our recommended encoding formats, a quick note on terminology.
Video encoding formats describe the compression specifications available, whereas video codecs describe the software or hardware implementation of these formats. For the sake of this article, that distinction has little bearing. However, keep in mind that for any given specification, there may be multiple codec implementations available.1
Without further ado, here’s our list of the most popular formats in 2021.
Recommended Live Streaming Encoding Formats:
- H.264/AVC: H.264 is an efficient and widely adopted video compression technology that lends well to low-latency streaming workflows.
- VP9: VP9 is a more advanced and higher-quality compression technology than H.264/AVC that enjoys greater compatibility than many of its alternatives and works well for 4K streaming.
- H.265/HEVC: When delivering premium OTT content to living room devices, the royalty-bearing H.265 codec is the best encoding format currently available.
- AV1: AV1 is the latest and greatest open-source video encoding technology, but lengthy encoding times currently translate to high encoding costs.
See our deep-dive blog on video codecs for a more comprehensive look at the best video encoding formats for streaming — or check out the video below.
Encoding vs. Transcoding: What’s the Difference?
It’s certainly possible to encode a video once and never touch it again. But most streaming workflows utilize video transcoding at a later step to further process the stream.
Video transcoding involves decompressing an encoded video file, (often) altering it, and then recompressing — potentially in a different encoding format — for delivery to end users. This conversion process can take place at the media server or in a cloud-based streaming platform.
Here are the key areas where encoding and transcoding differ:
1. Encoding occurs first; transcoding occurs second.
Just as one must write a book before translating it, a stream must be encoded before it can be transcoded.
2. Encoding is necessary; transcoding isn’t.
It’s not possible to live stream a video over the internet without encoding. This process of condensing raw video into a digital format for efficient delivery across the web always occurs, even if the encoder is built into the capture device from which you’re broadcasting.
Video transcoding, on the other hand, isn’t a must. Plenty of workflows, such as those using WebRTC from end to end, don’t require any transcoding infrastructure.
What Is Adaptive Bitrate Streaming?
Video encoding is not so simple as encoding a file into one output file, though. The average household internet connection has a download speed of 189 Mbps, but what if someone has an even better connection, or much worse? How do you ensure your audience members in a rural area with poor internet have an equally enjoyable video watching experience?
You need to encode your video into multiple output formats with different compression rates and resolutions. This process is known as encoding for adaptive bitrate streaming (ABR). ABR streaming leverages an algorithm that automatically adjusts your video’s bitrate according to an end user’s internet bandwidth so no matter where they are or when they’re watching the video, playback appears seamless to the user’s eyes.
Get Started Today
No matter what type of streaming architecture you’re trying to build, Wowza makes it happen. Our full-service platform can be integrated with production-quality encoding appliances, browser-based Web Real-Time Communications (WebRTC) encoding, a wide array of software encoders, and everything in between. Give it a spin today by signing up for a free Wowza trial.
1. Streaming codec expert Jan Ozer explains this distinction in more detail in his article on the H.264/AVC specification:
“As a video standard, there are multiple implementations of the H.264 codec, including the x264 codec in FFmpeg, and the Beamr codec used in the Wowza Streaming Engine. Intel and NVIDIA both offer hardware-accelerated H.264 codecs that can be accessed from the Wowza Streaming Engine.
Because H.264 is a standard, all video encoded by any H.264 codec should play on any H.264 decoder or player, whether in a browser, smartphone, or Smart TV.”