Codementor Events

6 Video Transcoding Tips and Tricks

Published Aug 25, 2019Last updated Dec 03, 2020
6 Video Transcoding Tips and Tricks

Photo by Donald Tong from Pexels

With close to 80% of internet content streaming in video format, we can say that video content is here to stay. However, sometimes users face buffering issues, causing users to walk away from the site, because of the lack of a quality video streaming experience. Good quality video content attracts visitors to our website and encourages them to consume our content. One option to tackle this challenge is to use video transcoding to adapt the video format and size to the target video player.

What Is Video Transcoding?

Video transcoding refers to the process of change the video format, compressing it to meet the format and specifications of the target video player, using video transcoding software. Let’s explain this definition.

Digital video consists basically in still images or frames, that appearing quickly in succession compose a movie. This is what is called “raw” video. As a result, in the early days of digital video, its file sizes were massive. That changed with the advent of the internet, and the need to upload videos. There was a need to compress the videos so they could be streamed over the internet.

In simple terms, compressing a video analyzes the content, grouping redundant data thus reducing the file size. All video compression and transcoding software start from this concept to reduce file size. There are a number of open-source and commercial video transcoding software that can streamline the process, automatically transcoding and compressing the files before upload.

How Does Video Compression Work?

To start explaining video transcoding we need to define formats and codecs. Codecs are tools used for video file compression and playback. As such, a codec is a software that compresses raw video and audio files when encoding and decodes them for playback. Different devices and browsers have different support for various codecs, that is why sometimes you cannot play a video you downloaded.

Video Codec
This refers to any software that compresses a video file. It works by removing redundant data from the video file while keeping as much quality as possible. There are two types of frame compression—inter-frame and intra-frame.

The inter-frame compression identifies redundancies across frames and compresses the files. For example, it will group all blue frames out of one static sky background. The intra-frame compression involves compressing each frame regardless of the others.

Popular video codec types include:

  • Motion Picture Experts Group (MPEG)—this is the most popular type of video codecs. It uses the compression standard which was added to Apple’s QuickTime and Flash.
  • VP9—this codec is available under a BSD Google License, with source code libvpx VP9 codec SDK.
  • Theora—an open-source, no license required lossy video compression format, and it is derived from VP3 codec.

Most smartphones, consumer-grade and professional camcorders record video in the H.264 format. That means, that video compression happens in real-time while the camera is recording. However, this compression is often not enough to playback the video online.

Video Format
The format allows playback devices to know how video and audio should be played. The most common formats are MP4, .Mov, and .Flv. Since the format needs to be compatible with the streaming platform, sometimes you need to transcode the video to a supported format.

The most popular file formats include:

  • MP4—this video format is the most popular as is the most supported by browsers and video players. You can use it to store both video and audio files.
  • QuickTime File Format—Apple’s multimedia format.
  • FLV—this file was very popular but since requiring a plugin using Adobe Flash Player, its popularity has decayed since the advent of HTML5 video.
  • WebM—a Google open-source video container format. It works using the VP8 and VP9 codecs.
  • Ogg—the video format supported by Wikipedia.
  • Advanced Systems Format—a video container format supported by Microsoft, designed for video streaming.

The most common video codec is still H.264 since it is the most widely supported.

The Difference Between Encoding and Transcoding

While most of the time the terms encoding and transcoding are used interchangeably, technically they are different. Transcoding refers to the process of re-encoding a video into a different format while encoding refers to the process of compressing video.

There are a number of reasons you may want to transcode or encode a video, such as:

  1. Reduce the file size
  2. Prevent buffering issues for streaming video
  3. Adjust the resolution
  4. Convert outdated files to supported formats.
  5. Make a video responsive across devices.
  6. Adjust a video for compatibility with certain software.

Tips and Tricks to Ensure a High-Quality Conversion

Here are several tips to ensure a seamless high-quality conversion.

1. Bitrate selection
You should be careful to select the right bitrate while encoding any video. Especially when working with CBR-encoded videos that encode only at the highest bitrate. If working with VBR, the bitrate should be equal to the pixel width of the video.

The right bitrate depends also on the type of video—for instance, animated videos produce high-quality images at low average bitrates.

2. Eliminate blocking artifacts
Pixelation is caused by block coding thus reducing video quality during compression. To reduce successfully blocking artifacts, you need to improve HEVC encoding efficiency, which is done by choosing the frame dimensions as a multiple of 16 for both the horizontal and vertical axis.

3. Control you profile settings
Sometimes a video stops streaming or doesn't stream at all. What appears to be a technical glitch instead has to do with your encoding profile settings. You should choose the correct encoding settings for each video as assigning values that are not compatible can cause the streaming to stall or not play at all.

4. Use progressive rendering
Progressive scanning renders the image in a way that the entire image is captured in one frame in one go.This has the advantage of giving a faster transcoding process resulting in a smooth video with a higher degree of realism.

5. Use a high quality master
You should choose a high quality master copy to start since some quality is always lost in the transcoding process. The highest quality the master, the less chances of a low quality after transcoding.

6. Don't upscale a video too much
When you stretch a video beyond its source dimensions it gets blurry and loses quality.

7. Leverage artificial intelligence (AI)
Today's AI software is based on advanced machine learning (ML) models. Deep learning (DL) algorithms, in particular, are proving to be significantly effective in solving video compression and transcoding issues. You can create your own model and apply it to your existing technology stack, or use ready-made software with AI already integrated into the solution.

Wrap Up

Transcoding is a useful procedure to ensure a smooth streaming of your video content. However, when done manually can be tricky, requiring technical skills. Besides following the tips mentioned above, using a transcoding video software tool can help manage the format conversion and compression in a user-friendly way.

Discover and read more posts from Eddie Segal
get started
post commentsBe the first to share your opinion
Show more replies