Why We Need AI-Based Video Compression

Why We Need AI-Based Video Compression

This image has an empty alt attribute; its file name is why-we-need-ai-based-video-compression.jpg

Over the past couple of years, there’s been a significant increase in the popularity of videos. The word around the net is that videos are set to replace images. The problem is that video files are huge, and their current compression methods are clumsy.

This article reviews the current state of video compression and explains how Artificial Intelligence can help solve the current challenges.

Video Compression—What It Is and How It Works

Video compression is the process of converting video files. The goal is to reduce the size of the video, so it would take up less space on devices and systems, and consume less bandwidth when loading. You can compress videos through the use of physical or video codecs, which encode and decode video files.

Compression techniques—lossy vs lossless

There are two compression types. Each utilises a different conversion method. The lossy compression technique eliminates redundant data from the file. By the end of the process, you can achieve a compression ratio of up to 300:1 per video. Lossy compression is irreversible, and every time you use it to convert the file, the quality degrades.

Lossless compression algorithms remove redundant data without damaging quality. The algorithm creates statistical models, and then creates bit sequences. The bit sequence rate defines the amount of data that is necessary for each video second. The rest is rendered redundant and subsequently eliminated. A compression ratio of up to 8:1 will preserve the quality, but the file size will still be large.

Video compression models

Compression algorithms typically work in four layers. The modelling layer is in charge of the conversion, the quantise layer removes redundancies, the entropy coder encodes and decodes the converted data into the bitstream, and the last layer scans for errors and applies fixes as needed.

Here’s a review of two common compression algorithms:

  1. Motion compression—the algorithm scans the video frames and identifies moving objects. Using this data, the algorithm then tries to predict where the object will appear next. The algorithm encodes the object shape along with its estimated trajectory path and saves only one object per trajectory.
  2. Residual compression—the algorithm scans the video frames and identifies repeated elements and objects. Using this data, the algorithm then keeps one element and eliminates the redundancies from the rest of the frames. If the video presents a white background for all the frames, the algorithm will encode only white background.

Video Compression Challenges and the Solutions Offered by AI

1. Complicated compression standards

Compression standards define how to achieve compliance with applications and manufacturers. Each standard provides a comprehensive outline of how to compress the video file for certain mediums.

H.264 is the most popular compression standard at the moment, and it spans across 264 pages. H.265, which is set to replace H.264, contains more than 600 pages. The increasing length and complexity of the standards result in clumsy and slow compression processes. This is where Artificial Intelligence (AI) comes in.

AI software uses Machine Learning (ML) algorithms to learn and acquire tasks associated with human intelligence. Where regular software can get slowed by huge amounts of data, ML requires big data to improve. An AI can process standards faster than presently used compression algorithms, and continually improve the process with every added piece of information.

2. Clumsy compression codecs

Video codecs encode and decode video files, through the use of algorithms that scan all the frames, and then either reduce data (lossy) or optimise the size (lossless). These algorithms take in the big picture and offer a compression solution, but they aren’t capable of analysing the little details of the video.

This is the equivalent of trying to form a sculpture with a hammer and trying to refine the final result with a nail file. Sure, the hammer will break the clay into smaller pieces, and the nail file will remove a thin outer layer. However, to truly sculpt, you need tools that give you control over the little details. Video codecs can’t do that on their own. They need AI.

AI software uses machine learning models for computer vision. These models include image recognition, object recognition, facial recognition, and other factors that provide the machine with the ability to detect the details that form an image, and give it meaning (i.e., two eyes, a nose, and a mouth, belong to a face).

AI with computer vision can turn a video codec into a sophisticated compressor. Ideally, the AI-based codec will scan each frame, identify its elements, classify the elements, optimise the frame on a pixel level, and then repeat this process across the entire video. This kind of control provides the ability to sculpt the video into a significantly reduced size while maintaining a high level of quality.

The Technologies that Power AI-Based Video Compression

AI is not new. It can be traced as far back as the 1700s, to the days when classical philosophers imagined the existence of artificial beings. They dreamed of automatons and mechanical men and pondered how these creatures would think. Would they possess human intelligence?

Fast forward a few long centuries, and we arrive at the 1900s, the time of technology, industrialisation and innovation. Computers made a disruptive appearance, and people began to try to achieve what those classical philosophers could only imagine. In 1956, at a conference at Dartmouth College, the term “artificial intelligence” was officially coined.

Since then, the AI journey has been long and arduous. It is only now that we’re starting to see the solutions that would finally put AI on the map. Because, the thing about AI is that it requires a lot of computing resources to operate, a lot of data to form “intelligent decisions”, and a sophisticated learning process to help them function to the best of their ability.

Today, with the proliferation of connected devices and the ever-increasing consumption of the Internet, the amount of generated data are too big to be processed and analysed manually. For AI, this is a game-changer, as the algorithms need a lot of data. The high-performance computing (HPC), aka supercomputers of today, can satisfy the computing needs of AI.

Machine learning algorithms have also evolved to the point they are beginning to tap into the potential of AI, and, essentially, making AI software smarter. Huge credit goes to an ML sub-field called deep learning, which designs a machine learning process based on the design of the human mind. You can find more information about deep learning here.

It’s a Wrap!

When AI software meets video algorithms, video compression turns into sophisticated art. AI can process video data faster than regular video codecs, perform ab image-based analysis, and optimises every pixel of the video.

AI can help you reduce the size of the video and comply with compression standards while maintaining a quality level that surpasses that of lossless compression. Keep in mind that the technology is relatively new, and as such has its limitations, so experiment with the solutions of your choice, and settle on the one that works best for you.

Image Credit: nampix/Shutterstock

Source link