monitors

Digital video encoding and compression

Encoding (compressing) digital video information can seem like a difficult issue to understand if you don’t know why it’s important, what to look out for, and generally how it works.

Why is video compression important?

The use of digital video capture was introduced in the 80’s. It was completely uncompressed, pure video information that required huge amounts of memory and playback system resources to play and store the files. But even today, compression and encoding is a prerequisite for recording any video information, despite the tremendous leap in the development of digital electronic technology. Otherwise, downloading, processing, editing, playing and storing video files will become a test of your nervous system’s endurance and the capabilities of your equipment.

How does video encoding work?

In the process of video encoding, the stream of video information is continuously analyzed by special software, and unnecessary/unimportant data fragments are simply cut off, this helps to significantly reduce the size of the video file.

There are two types of video compression: frame-by-frame (intra-frame) and inter-frame coding.

Frame-by-frame compression treats each frame of a video recording as a separate still image, similar to a photo in jpeg format. This technology is characterized by good video quality, but the reduction in video file size is insignificant because all frames are saved, even if there are no changes in the image for a dozen or even a hundred frames. In other words, out of a hundred identical photos, all one hundred are saved, not just one.

Inter-frame compression works on the polar opposite principle: during signal processing, the whole frame is analyzed, but only key changes from frame to frame are saved, as in animation, when you need to show the movement of the object, but the background and the surrounding environment are the same. This allows you to significantly reduce the size of the video file compared to the principle of intraframe compression.

Video quality after compression

Even the most advanced video compression algorithms result in loss of quality of the original signal. But the development of software products and codecs has reached the level where the loss of quality is almost imperceptible and indistinguishable from the original by the average human eye, especially the non-professional in the field of digital video processing.

In order to preserve the highest possible video quality while saving on video file size, you need to determine the main key points: video resolution, file size, method of video file transfer and upload, prevalence of static or dynamic scenes, color, contrast and similar conditions. An important factor affecting the quality and size of the resulting video file is the choice of codec and compression format.

Codecs

A video file must be compressed and encoded, and then decompressed and decoded by the same set of software tools – a codec, which includes tools for processing and playing the file. In other words, to view a video file you need to decode it with the same codec it was encoded with, for example, a video encoded in MPEG-4 codec needs to be decoded with the same MPEG-4 codec, otherwise you are guaranteed to have problems playing the file.

M-JPEG (Motion JPEG) compression standard

An unlicensed coding standard created and widely used in the 1990s that uses intraframe compression technology. The digital video sequence produced by this codec is an array of full JPEG images. Despite the fact that this codec allows to use a number of tools that reduce the file size, today it is rarely used because of the low quality of the resulting image, as well as for the minimum compression ratio.

MPEG-4 compression standard

Licensed encoding standard that uses object-oriented (inter-frame) compression, i.e. the movement of each object in the frame is tracked separately and the video signal is recorded based on these movements. The main advantage of this codec is a wide range of compression settings, which can be selected for any – low or high – data rate. This format is universal, it is designed for viewing sweat video in real time.

H.264 compression standard

A licensed copying standard that very significantly reduces the amount of digital video information while making minimal changes to its quality, especially when compared to M-JPEG and MPEG-4 codecs. This codec is designed to record video signal for a long time, as it requires small network bandwidth and hard disk space. The H.264 codec is the best tool when working in video surveillance systems, especially when shooting at high frame rates and high resolution. The only issue with this standard is that it requires more processing power to decompress and view video information than M-JPEG and MPEG-4.

Which standard to use?

In a video surveillance system, the signal from the camera is sent to the DVR, where the video signal is encoded (compressed). Depending on the relevance of the DVR model, as well as your requirements and the selection of the necessary video codec. The choice between standards can be reduced to how often you need to download and view the recorded video.

In non-professional video surveillance systems, with simple hardware characteristics of the equipment, as well as for the formation of several streams of video signal (for example, for video transmission over the network or remote viewing with a cell phone), it is recommended to use codecs M-JPEG and MPEG-4, as they are not demanding on system resources.