Without any form of compression in video streaming, the network can’t transmit the raw data. Also, due to large file sizes, storing data on limited capacity of disk drives is not possible. That’s why we need to use compression, especially in video surveillance systems. Video compression removes redundant video data, so that the video file can be transmitted or stored effectively. Video content is encoded and decoded by using a video codec method, inside a container format, so the video quality is not degraded at the time of transferring over the network. We study the concept and some different types of video codecs and video containers along with their differences.
What is video codec?
A codec is a software used to compress or decompress a digital media file for transmission over a data network. In fact, a pair of encoding and decoding algorithms that work together is called a video codec, so that encoder uses these algorithms to effectively compress the size of the video file, and then decoder decompress it when needed. Some codecs include both of these components and others include one of them. Moreover, codecs are divided into two categories: lossless and lossy codec. In lossless codec all the information is kept in the original stream, thus the video quality is preserved. On the other hand, in lossy codec due to using lower data bandwidth and missing some of the original data to achieve the best compression, the quality will be reduced.
There are different standards of codec which use different technologies to encode and decode the video file related to intended application. Since video content that is compressed using one standard cannot be decompressed with other standard, different implementation of video codecs are normally not compatible with each other. Because, one algorithm cannot correctly decode the output from another algorithm.
However, implementing many different algorithms in the same software or hardware is possible, so multiple formats can be compressed. Utilizing different methods of compressing data leads to variant bitrate, quality and latency. The time it takes to compress, send, decompress and display a file, called latency.
How video compression can help video surveillance?
Video compression methods use a codec to reduce or eliminate unnecessary files or frames from video files, without any significant degradation in final video. This makes the video file smaller, so more video can be stored on NVR hard drives or files can be kept for longer periods of time.
Due to large capacity of high resolution video files, video compression is a valuable tool when the surveillance system has storage and bandwidth limitation. It is worth mentioning that to achieve desired image quality in spite of compression, the best balance of image quality and compression method should be found.
In IP video, encoding would be done by the IP camera encoder and the decoding is normally done on the computer or device which is displaying the live video.
Compressing video leads to file transferring over network without significant delay, resulting in high speed data transfer, which is especially important in mobile viewing with a smart phone in video surveillance.
Different types of video codec:
Similar to a digital picture camera, a network camera captures individual images and compresses them into a format. The camera captures and compresses individual images per second (fps), and then make them a continuous flow of images over a network to a viewing station. At a frame rate of about 16 fps and above, the viewer will perceive full motion video. Since each individual image is a complete compressed image, they will have the same quality, determined by the compression level defined for the network camera. So, Video compression is performed automatically by surveillance camera and choosing the compression level is an important issue to achieve the best video quality. Here, we study some of video compression methods.
Motion JPEG (MJPEG) is a video codec where each video field (frame) is separately compressed into a JPEG image. As JPEG is a compression method to compress the images, MJPEG is an algorithm to compress multiple frames of videos and send them as individual JPEG images. The resulting quality of videos is independent from the motion in the image, so quality is not decreased when the video contains lots of movement.
Due to offering minimum latency in image processing and maintaining image quality during transmission over low bandwidth availability, MJPEG is still a usable compression format in spite of being an old lossy codec.
MPEG, standing for Moving Picture Experts Group, is one of the biggest families in video codec and the most common video format. Its algorithms compress data into small bits that can be easily transmitted and then decompressed. Since some of data will be removed in MPEG, this method is a lossy compression, but this defect is generally invisible to the human eye. The most common types of MPEG include MPEG1 (used in the production of VCD and the download of some video clips), MPEG2 (used in the production of the DVD and also in some of the HDTV and high demand video editing), and MPEG4. MPEG4 transmits video and images over a narrow bandwidth, meaning that it reduces the network bandwidth used by the surveillance system. Also, MPEG4 reduces the amount of needed storage and increases the amount of time that video can be stored, which make it beneficial for video surveillance. On the other hand, MPEG4 can identify and deal with separate audio and video objects in the frame, which allows individual elements to be compressed more efficiently. Hence, it can mix video with text, graphics and 2-D and 3-D animation layers.