
How the video is compressed

Video compression is the reduction and elimination of redundant video data to optimize the storage and transmission of digital video files.
During this process, the original video signal is processed by an algorithm to create a compressed file ready for transmission and storage. To play a compressed file, use
a reverse algorithm that actually produces the same video image as the original video source. The time it takes to compress, send, decompress, and display a file is called latency. With the same processing power, the more complex the compression algorithm, the higher the latency.
A couple of algorithms that work together is called a video codec (encoder / decoder). Video codecs that use different standards are often incompatible with each other, so the video data,
tablets with one standard cannot be decompressed with another standard. For example, an MPEG-4 Part 2 decoder will not work with an H.264 encoder. The reason for this is the fact that one algorithm cannot correctly decode the result obtained using the work of another algorithm, however it is possible to equip software or hardware with many different algorithms so that it can compress different formats.
Different video compression standards use different methods to reduce data size, and therefore results differ in bit rate, quality, and latency.
Compression results may also differ between encoders using the same standard, as the developer of the encoder is free to choose which standard-defined tool sets to use in it. As long as the result in the encoder output corresponds to the standard’s format and decoder, several implementation methods are possible. This is beneficial because different implementation methods have different goals and different budgets. Professional software encoders for non-real-time optical media should be able to provide better encoded video than hardware encoders for real-time video conferencing built into handheld devices.
Therefore, a specific standard cannot guarantee a specific data speed or quality. Also, the performance of a standard cannot be properly compared to other standards or even to different implementation methods of the same standard without first defining a specific implementation method.
The decoder, unlike the encoder, must implement all the necessary elements of the standard to decode the corresponding bit stream. Therefore, the standard clearly specifies how exactly the decompression algorithm should retrieve each bit of the compressed video image.
The following chart compares the bit rate at the same level of image quality for the following video standards: Motion JPEG, MPEG-4 Part 2 (without motion compensation), MPEG-4 Part 2 (motion compensation), and H. 264 (baseline profile).
For the selected sequence of video frames, the H.264 encoder generates up to 50% fewer bits per second compared to the motion compensated MPEG-4 encoder. The H.264 encoder is at least three times more efficient than an MPEG-4 encoder without motion compensation and at least six times more efficient than Motion JPEG.



