Understanding Video Compression
As the CCTV industry continues to move towards digital devices, such as Digital Video Recorders (DVRs) and IP devices, technicians need to be familiar with the subject of Compression – the methods such as MPEG, Wavelet™, and similar. In this article we spell out some of the basics of compression technology.
So first – why is data compression necessary? Because without it, the volumes of data produced by digitising CCTV image streams would swamp the available storage and communications systems.
To overcome this, the process of compression is applied to the image stream, reducing the amount of information that needs to be transmitted and stored. In fact compression of the camera signal is not new - many people do not realise that all ‘analogue video’ has always been compressed.
Similarly, there has long been a need for data compression in the computer industry. Specialist mathematicians have worked for many years on solving the basic problem of how to reduce the image size to produce the best compromise between image clarity, the data size of the image, and the amount of processing power it takes to run the compression method.
Different applications have different priorities regarding clarity of the image, data volumes, and processing power – for example identification evidence has a different picture quality requirement compared to monitoring the length of a queue. So if you are selecting digital equipment, you’ll need to select the compression format that suits the network or the application you are installing.
Different sorts of compression are described as lossless or lossy. In general, the less compression the better the playback and recorded image, so naturally in that sense lossless is always better than lossy; however, less compression means more data to be transmitted and stored, and thus incurs higher system costs.
Compression reduces the signal in three ways. The first is by various mathematical tricks that are lossless to the image, and can be reversed at the time of display so that the full image is viewed. The second is to remove parts of the signal that are redundant to human viewing of the image. The third method is to start to visibly reduce image quality – definition, frames per second, and colour range – and it is this type of compression that is called lossy.
The compression formats used in CCTV vary by manufacturer and by product. But the four most commonly used compression formats are:
- Motion JPEG, also written M-JPEG or M-JPG
- MPEG, also written mpg
H261 is a digitisation and compression scheme for analogue video. It is widely used in video conferencing and is aimed at providing digitised video at a bit rate of 64Kbps-1Mbps, which is the bandwidth range of public data networks.
Compression rates as high as 2500:1 are achieved, but of course at the cost of quality. The format is good for high frame rates, showing movement, but the resolution of those frames is not high. This is not good if, say, person identification images are required. But if the application is a non-security application such as video-conferencing, the quality is likely to be adequate.
Uniquely among the compression formats discussed here, H261 encoded signals can also be decoded or decompressed by reversing the process(es) from a valid reference or I-Frame. That means you can get back to the original high quality if you ever need to.
Motion JPEG (M-JPEG)
Motion JPEG (JPEG stands for Joint Photographic Experts Group) is an adaptation of the popular JPEG image compression for still digital photos. JPEG is a lossless compression technique, losing very little data in the image. Motion JPEG creates a video stream from a succession of JPEG-compressed still photos. Because it is based on these high quality lossless stills, it delivers a much higher quality image than H261. But at a cost – it requires a considerably greater transmission bandwidth and storage capacity compared to its H261 counterparts.
An advantage of Motion JPEG is that, because it is based on still images, it can produce any of its frames as a single image for identification purposes. As we will explain, some compression techniques cannot provide such images.
MPEG (named after the Moving Pictures Experts Group) is purpose designed for moving pictures, rather than being based on still image compression. This means that each frame is defined as the previous frame plus changes, rather than a full frame. The advantage of this is that compression is more efficient – the same quality can be displayed from less data. However, the method has problems when there is extensive motion between one frame and the next – there is a danger that the image gets ‘blocky’ and vague, losing some definition in the areas of the frame where the movement occurs.
There is not one MPEG standard but several , changing over time, of which only the first two are relevant at present.. MPEG -1 was designed to output 15 frames per second video from limited bandwidth sources, such as CD-ROMs. MPEG-2, designed for high bandwidth applications such as High Definition TV. (HDTV), delivers 30 frames per second video at full CCIR 601 resolution but requires special high speed hardware for compression and playback – PCs cannot handle this.
Like Motion-JPEG, Wavelet™ compression delivers high-quality moving images by starting with still images, applying a compression method to them, and putting them together to form moving pictures. It compresses images by removing all obvious redundancy and using only the areas that can be perceived by the human eye. Wavelet™ is up to four times more effective in reducing the volume of data than JPEG and M-JPEG.
Wavelet™ is also seen as offering superior development potential to current MPEG compression, giving a greater amount of compression with equivalent quality. It transforms the whole image and not just blocks of the image, so as the compression rates increase, the image degrades gracefully, rather than into the 'blocky' artefacts seen with some other compression methods. Wavelet™ applications can have their preferred level of compression selected by the user – higher or lower.
Thus, although Wavelet™ is not as established as some other compression techniques, it is growing in popularity.
It all depends on the application - Image Resolution
There is no ‘good’ or ‘bad’ in compression methods. The idea of ‘horses for courses’ applies, and the table below summarises when each method is best.
|Method||Compression Ratio||Bandwidth and Storage Required||Frames per second||Quality|
|MPEG||Low||Very high||25||Very high|
Article taken from Security Matters Magazine and used with permission from Norbain SD Ltd, Europe’s Leading Distributor of CCTV and Access Control including Vista CCTV Products.