As online video becomes a big part of our daily internet browsing, it is very likely we are going to encounter annoying buffering issues. Enterprises are distributing their online video to various platforms like iOS, Android and Windows. The challenge they are facing is to provide a good quality video streaming experience to all their users, no matter which platform is used. Let’s see how video transcoding seamlessly provides the optimal viewing experience.
Video Transcoding Overview
Video transcoding is the process of creating multiple versions of the same video. Each version is optimized for a different device type which is used to watch the video. This process allows you to deliver high-quality videos to users with fast internet, and lower-resolution videos to those with slow internet to avoid buffering.
In the video transcoding process, a video file is converted from its original format to another that best suits the target device. This involves translating all three elements of a digital video at the same time: the file format, the video, and the audio.
Video transcoding is a vital function when a target device does not support the current format of your video or has limited storage or bandwidth capacity that requires a reduced file size. It is also used to convert incompatible or obsolete video formats to a supported format.
How does video transcoding work?
Video files consume a lot of memory and bandwidth during transmission over the internet. To address this issue, we compress video files using a technology called video codec. Codecs use complex algorithms to reduce video file size.
When a video recording is made, the resulting file is called the master file. It is in a format unique to the camera or program used to capture it. The master file is the best quality recording that exists. This is typically not the format needed to deliver the video online or play it from another device.
Video transcoding re-encodes the master file by using a different codec or different settings. The subsequent versions creating a few different lower-bitrate, lower-resolution versions. These can provide a better viewing experience by allowing people with slow internet to watch your stream.
Using a video transcoder, you can simultaneously create a set of time-aligned video streams, each with a different bit rate and frame size. This set of Internet-friendly streams could then be packaged into several adaptive streaming formats, allowing you to reach almost any possible device.
An example demonstrating video transcoding
Your master file is encoded using the H.264 codec, with a full HD resolution and bit rate of 6 Mbps.
From this original video, you can create three lower-bitrate and lower-resolution versions which can allow people with slow internet to watch your stream:
- 720p version at 4 Mbps
- 480p version at 1.5 Mbps
- 360p version at 1 Mbps
7 Best Practices for Ensuring High Quality in Videos
While video transcoding is a helpful tool for media delivery, it may result in loss of quality and can be time-consuming. Here are seven best practices that will help in reaching the right balance between video parameters to deliver the best results:
#1. Encode from the best quality source
Providing a high-quality source is critical since your output is only as good as your input. If your source video is interlaced, try enforcing de-interlace settings to achieve the best quality.
#2. Width and height setting
You can use any width or height for your video, but non-optimal settings damage the quality and reduce the frame rates. Video codecs deliver the best performance when the width and height are in multiples of 16. Multiples of 8 are for medium video quality, and lower quality would be with multiples of 4.
#3. Use 2-Pass VBR
Use 2-Pass VBR (Variable Bit Rate) method to transcode video to achieve the best picture quality. Unlike CBR and VBR, 2-pass VBR has 2 stages (passes) of encoding. The first pass calculates the ideal bitrate needed for each keyframe of the video. The second pass renders the entire video depending on those bitrates. 2-pass VBR is useful for rendering high-quality pre-recorded videos but cannot be applied on live streaming.
#4. Create adaptive sets
You should verify that the video playback is running with no issues overall connection speeds. To achieve this, create adaptive sets that are transcodes of the same video but with multiple bitrates. Employ adaptive streaming mechanisms to serve a video copy that catches the viewer’s connection speed thus delivering a seamless experience.
#5. Select the Right Bitrate
It is essential that the right bitrate is chosen while encoding any video. This is especially true for CBR-encoded videos which encode only at the highest bitrate. In the case of VBR, the variable bitrate should ideally be kept equal to the pixel width of the video. Selecting the right bitrate also depends upon the type of video. Animated videos can produce high quality even at low average bitrates while action movies or movies with fast and dynamic changes usually encode at higher bitrates for high quality.
#6. Use median filters
Use median filters to improve picture quality by correcting defects without affecting the sharpness.
#7. Mobile device-specific settings
If you are transcoding videos for mobile devices, make sure that you use the specific settings of the device for the video transcoding process.
This article has introduced you to the concepts around video transcoding for online video and live streaming. We’ve seen that video transcoding is critical when you want your content to be reached by more people all over the world, no matter what device or bandwidth they use.