Video encoding. For the uninitiated, it’s like a foreign language. Bitrates, codecs, audio channels… it can be confusing. There is a lot to it. But don’t worry, we’re here to help. This post will provide a complete guide to answer the question: what is video encoding?
Table of Contents
- What is Video Encoding?
- Video Encoding vs. Transcoding: What’s the Difference?
- How to Encode Video with vzaar
- What is Adaptive Streaming, and Why Is It Important?
- Quality vs. Size
- Common Encoding Challenges
- Video Encoding Glossary
What is Video Encoding?
Here’s one definition of video encoding.
“In video editing and production, video encoding is the process of preparing the video for output, where the digital video is encoded to meet proper formats and specifications for recording and playback through the use of video encoder software.”
But what exactly does this mean? To understand, we have to dive into some background.
Specifically, to understand video encoding, we have to understand what video is. Video is just a collection of still images. When they’re shown quickly, one after another, they make a “moving picture”—a movie.
Imagine a flipbook. That’s basically what a video is.
In the early days of digital video, video files were all RAW video. This means it was just a collection of still photos. For a video recorded at 30 frames per second, you now had 30 photos per second of footage. That’s 1800 images per minute of video. This meant that file sizes were massive.
Then, someone invented video compression, and the world of encoding was born.
What is Video Compression?
Video compression is basically a bunch of math that reduces the file size of digital video.
In the most basic form, video compression analyzes the content of video. If two frames are basically identical, the data for one frame can be tossed out and replaced with a reference to the previous frame. In this simple example, you’ve just reduced your video file size by about 50 percent.
All video compression uses variations of this basic idea to reduce file sizes. When we talk about video encoding, we’re talking about different types of video compression.
How Does Video Compression Work?
Video compression typically happens at the camera level. For example, smartphones, consumer-grade camcorders, and most professional camcorders record video in the H.264 format.
This means that, as the camera is recording, the raw images from the video sensor are encoded in real-time using (most often) the H.264 format. This compressed (encoded) video is then recorded to the storage on the camera.
The tools that are used to compress and playback video files are called “codecs.” Codec stands for compression/decompression. A codec is a piece of software that compresses raw video and audio files when encoding and decompresses/decodes the files on playback.
Different devices have different types of support for various codecs. Have you ever downloaded a video, then tried to play it, and playback failed? You might not have had software capable of playing back video encoded with that codec.
Today, the most common video codec is H.264. This format is supported on just about every device in existence, and it’s commonly used for online video. But there are many other codecs, such as MPEG-2, HEVC, VP9, Quicktime, and WMV.
Video Encoding vs. Transcoding: What’s the Difference?
Video encoding and transcoding are sometimes used interchangeably. However, for the purposes of this article we can make a proper distinction between them.
- Transcoding is the process of re-encoding a video into a different format.
- Encoding refers to either the initial process of compressing RAW video, or to the process or re-encoding a video into a different format.
Reasons to Transcode a Video
There are a variety of reasons why you might want to transcode (or encode) a video. They include:
- Reduce file size
- Reduce buffering for streaming video
- Change resolution or aspect ratio
- Change audio format or quality
- Convert obsolete files to modern formats
- Meet a certain target bit rate
- Make a video compatible with a certain device (computer, tablet, smartphone, smartTV, legacy devices)
- Make a video compatible with a certain software or service
How to Encode a Video with vzaar
Now we know what video encoding is, and why you might want to do it. The next logical question is how to encode a video. Let’s answer that question.
When you’re using the vzaar online video platform, video encoding is already included in your plan. All you have to do is provide your preferred settings when uploading your video. Then, we’ll automatically transcode your video into multiple different formats according to your instructions. Here’s how that process works.
Step 1: Create an “Ingest Recipe”
The first step in encoding your videos on the vzaar platform is to create an ingest recipe. An ingest recipe is a group of encoding presets at which your videos will be encoded and delivered.
You do this by logging into your vzaar account, then navigating to your encoding settings. Then click the button labeled “Create New Recipe.”
In the next screen, click the name at the top to give your recipe a name. Next, use the checklist to decide which renditions (or quality/size presets) you want to use for this ingest recipe.
Finally, check the box at the bottom if you want to use this as your default, then click the “Save and Close” button.
Optimal visual quality, best for HD video playback. Be aware that you’ll be using more bandwidth and viewers on slow Internet connections might experience buffering issues.
|Good option if you want to save bandwidth and ensure smooth playback for viewers on slow Internet connections. Be aware that the visual quality will be low.||360p|
|Good for smaller embeds and displays. Expect medium visual quality.||540p|
|High visual quality. Not recommended for full-screen playback.||720p|
|Optimal visual quality, best for HD video playback. Be aware that you’ll be using more bandwidth and viewers on slow Internet connections might experience buffering issues.||1080p|
|Ultra-high resolution 4k. The best possible quality, but most viewers don’t have sufficient internet speed to stream this content.||2160p (4k)|
Step 2: Repeat as Necessary
You can create different ingest recipes for different initial video formats.
For example, let’s say you film most of your content at 1920 x 1080 resolution, 30 frames per second, and recorded using H.264 video codec and AAC audio codec in the .MOV container format.
You can create one ingest recipe for this video content. This recipe might transcode this video into three additional versions: one 720 pixels wide, one 480 pixels wide, and one 240 pixels wide. Plus, you’ll maintain the original format. This will allow viewers to be served the optimal quality via adaptive streaming—a topic we’ll cover shortly.
Sometimes, however, you have footage filmed in an entirely different format: 720 x 480 resolution, 24 frames per second, and recorded using the MPEG-2 audio/video codec in the .AVI container format.
You can create a second ingest recipe for this type of content. When you upload videos in this format, just select this recipe and your content will be automatically transcoded into your chosen formats.
Step 3: Upload Your Video Files
The vzaar bulk uploader can handle hundreds of video uploads at a time. Mix and match video file types and resolutions and we will expertly encode your videos to the highest quality possible using your chosen ingest recipes.
During this stage, we can also create audio-only versions of your video.
Besides selecting the qualities you want to transcode your videos into, you can also add watermarks and generate thumbnails. Our tool also allows you to upload huge video files (50+ GB) with no interruption. The vzaar intelligent video uploader automatically pauses and resumes uploads when your network connection goes down.
The vzaar platform also supports Dropbox upload. You can connect vzaar and your Dropbox account so you can set as many videos to upload as you require. Once the Dropbox Uploader is activated, a folder will be created for you in your Dropbox account to put your files into. Any videos placed in that folder will be automatically uploaded using your default ingest recipe.
Note: It’s Impossible to Increase Quality Retroactively
Before we move on, let’s clear up one common misperception. Encoding can do a lot of things, but magic isn’t one of the. After you upload a video file to vzaar (or any other video hosting platform), there isn’t much you can do to increase its quality.
You can’t make something from nothing. Encoding the video into a larger resolution than you started with will only result in a very bad quality video.
There are ways to upscale video to larger sizes. However, this is a complicated and intensive process. It’s best handled using a dedicated application like Final Cut X, Adobe Premier Pro, or another app.
What is Adaptive Streaming, and Why Is It Important?
Adaptive streaming is also known as “Adaptive bitrate” and “Variable bitrate.” This term refers to delivering an appropriate rendition of a video to the viewer based on the strength and speed of their internet connection.
If you’ve ever watched YouTube or Netflix on a smartphone in a moving car or train, you’ve probably experienced adaptive streaming. When the cell signal is good, video quality is high. When signal strength drops, you’re automatically switched to a lower video quality to avoid buffering.
The underlying technology behind adaptive streaming is transparent to you and your users. Vzaar simply delivers the best version of your video—based on the versions we created using your ingest recipe—to your viewer. This is known as multi-bitrate streaming and it’s a premium feature in the online video industry.
Quality vs. Size
When it comes to video, you can’t always have both high quality and small size. In general, these represent a trade-off.
- High-quality video files are larger, taking longer to upload and requiring more bandwidth for viewers.
- Low-quality video files are smaller, take less time to upload, and require less bandwidth for viewers.
Imagine that your Internet connection is a tube. The faster your connection, the larger the tube. Low speed Internet connections have narrower pipes. Those large files need to squeeze through them. So you run the risk of subjecting your clients to stuttering and buffering streams.
On the other hand, opting for lower quality videos means they’re available immediately, no matter where your clients are watching them. But the footage won’t look as good.
If you have your target bit rate in mind but are struggling to achieve desirable video quality, you’ll need to cut back in some respect. All else being equal (same codec, for example), there are four main contributing factors that determine video file size in relation to quality. These are:
- Time: longer = bigger files
- The number of pixels (resolution): larger = bigger files
- The frame rate: higher = bigger files
- The amount of motion present in the video: more = bigger files
Common Encoding Challenges
My viewers tend to have slow Internet connections.
Video files are typically quite large, so they require good Internet speed (or bandwidth) to display the video properly. When the Internet connection is slow, the video starts stuttering and is often displayed in a very poor quality.
You can use our analytics to determine where most of your viewers live. This information can be matched with average internet speeds to get a sense of the average connection speed of your customers.
Next, you can set your overall bit rate to match their download speed to achieve a reliable playback. We recommend a short trial and error test to determine which settings to use. This test will help you determine how low you can get the bit rate of a video, while maintaining acceptable quality.
Start with a high frame width (say 1280px, which is 720p at the 16:9 aspect ratio) and a relatively low bit rate (around 512kbps). See how the video looks when encoded with these settings. If you are not pleased with the image quality, try either lowering the frame width or increasing the bit rate.
Also, be sure to encode multiple versions of your video. Adaptive streaming (as described above) will ensure viewers get the best quality they can stream smoothly.
I want to save bandwidth.
The more often your videos are played, and the higher quality your videos are, the more bandwidth you will need. Every vzaar plan comes with a certain bandwidth limit. You can use the same approach as in the previous question to reduce bitrates to the lowest acceptable level. This will reduce your bandwidth consumption.
My encoded video has a larger file size than the original.
While encoding can’t increase quality, it always changes file size. Don’t worry too much about a larger file size. Sometimes, this just means you’ve been overly generous with your bitrate settings. Other times, it means you’ve changed from one codec to another.
If you really need to reduce file size to lower bandwidth consumption or serve users with slow internet connections, try reducing bitrate.
After encoding, the audio is out of sync.
This could have something to do with the frame rate of your video. Use a free tools such as MediaInfo to check frame rate of your original file. If the frame rate of your video is unusual, you may discover the audio is out of sync after encoding.
In this case, we recommend you to try the Two-pass Encoding feature. This can solve many issues the encoder might have interpreting frame rates.
If it’s not the frame rate and the audio continues to play up, you will need to check the relative length of the audio and video streams. You can use the same tool mentioned above to get that information. In some cases, source files can be created with different length for their audio and video streams.
When this happens, the encoder doesn’t always succeed in precisely matching up the streams as they were before. Again, try two-pass encoding. However, if the problem persists, you may need to ask your video editor to cut the original file.
My video is already encoded in a web-ready format
If your video is already a H.264 encoded MP4, you can turn off vzaar’s encoding by selecting “no encoding” in your ingest recipe. However, one thing you need to keep in mind is the MOOV atom. MOOV atom is a bundle of metadata. Before saying no to vzaar’s encoding, ensure the MOOV atom is positioned at the beginning of the file.
If this sounds complex, we recommend simply using vzaar’s built-in encoding to re-encode your MP4 file. As long as you choose the same frame size and bit rate as your original file, encoding the video with vzaar will not have any noticeable impact on its quality.
I don’t want my videos in an MP4 format
We only encode content to H.264 in an MP4 container. However, if you feel that you need your videos encoded in another format, have a chat with our Support Engineers and we’ll see what we can do for you.
I uploaded a video and the quality is really poor
Generally, this means the frame size and bit rate of the target video is much lower than the original’s. To get the maximum quality of your videos, be sure to use the “Original” profile in your ingest recipe in addition to any lower qualities you have selected.
This will match the source file’s frame size and ensure you have a high-quality version of your video available.
Video Encoding Glossary
Frame rate is the number of frames displayed per second in a video. The faster the frames flicker along, the more lifelike and immersive the video becomes. The rate at which these still images are displayed is expressed in frames per second (fps). Common frame rates are 24, 25, 30, and 60 fps. Higher frame rates show action better. Lower frame rates give your video a more “cinematic” look.
Bit rate describes how much data a video file contains (measured on a per second basis). In general, a higher bit rate means better video / audio quality. But you can’t make the video look better or improve sound quality by increasing the bit rate if it was low in the first place. Bit rates are usually measured in kilobits per second (kbps) or megabits per second (Mbps).
Aspect ratio refers to the shape of a video recording. Specifically, it’s the proportional relationship between the width and height of the video. This is usually expressed in the W:H format, where W stands for width and H stands for height. Most modern television and computer monitors have an aspect ratio of 16:9. But this will vary – remember the old square television sets? That’s 4:3.
Resolution describes the number of pixels in a video file. In other words, it’s the width and height of the projected image, measured in pixels. For example, a video might have a resolution of 1280 (horizontal pixels) × 720 (vertical pixels). This is usually written as simply 1280×720, or abbreviated to 720p.
Codec stands for “compression/decompression”. It’s a piece of software that compresses raw video and audio files when encoding and decompresses/decodes the files on playback. Codecs are needed because video and audio files are very large and therefore become difficult to transfer across the Internet quickly. There are hundreds of different codecs out there. Common video codecs are: H.264, MPEG-2, DivX, XviD, Theora, VP8, and the WMV family. Common audio codecs are: MP3, AAC, Vorbis, and the WMA family.
Remember that codecs do not determine the file’s extension. That’s the container format. Some of the most popular container formats include mov (Quicktime), P4, OGG, and AVI.
Video encoding is a complex topic. Hopefully, this article has helped introduce you to the topic: what is video encoding.
There’s always more to learn. For example, if you’re interested in a scientific approach to calculating the optimal bitrate for a H.264 video encode, check out the Kush Gauge calculator. And technologies are changing all the time. But with this basic grounding, you should be able to get up and running.
As we’ve shown, vzaar has easy-to-use and powerful video encoding functionality built right into our online video platform.
Are you ready to start transcoding your videos and delivering high-quality multi-bitrate streaming video? Click the button below and sign up for our free trial (no credit card required)!