Digital video recording and compression techniques

October 2004 Surveillance

Everything you wanted to know and cannot get an answer to!

There are two basic types or styles of compression in the digital world. Lossless and lossy (often referred to as lousy).

It is entirely possible for a man to wave his arms in a frantic gesture and have them disappear or fall off of his body in one or more frames. This would leave you having to explain an armless man performing an armed holdup.

Continuing on with the whole idea of going digital, we must finally delve into one of the bigger mysteries at hand - compression. Now, take a deep breath ... count to 10 ... relax ... and think. Compression, for some reason, is one of those most baffling subjects that seems to have everyone up in arms. So, to start out in the right reference, we must first understand that compression of the video signal is nothing new. We have been compressing the video signal or rather digital image since the conception of the video recorder. I know, we never really called it compression, we called it recording. However, the facts are plain and simple. If we had ever recorded the full analog video signal, of our recent past on VHS tape, we would have required a two or three inch tape ... not the half-inch cassette that we have so fallen in love with.

To the beginning. As with everything else digital, we must first tear apart our analog ancestor in order to understand our new digital master. First, analog signals are frequency based and technically far superior to digital signals, which are binary based. However, analog signals are hard pressed for accuracy and too complex to add various featured enhancements to, in an affordable format, so digital wins out. Frequency refers to a wave form basis. Binary refers to a two digit code based upon zero (0) and one (1). The three key factors that make digital signals easier to work with are their: filing or organisational and search capability; affordable enhancements; and the infallible resistance to transient interferences. The two things that make analog signals far superior are: the infinite potential of information contained within a final recorded image and the capability of retained detail in a close up mode. Either way, the final battle is fought and the analog is on the way out. So, we discuss compression.

The first step to compression is understanding exactly what we are doing. Imagine an image made up of tens of thousands of tiny squares of colour. Now imagine that each square represents a drop of coloured, chemical induced water. Now add up the total sum of those drops and imagine that you have four litres of liquid. Now imagine that you have to store that four litres of chemical induced water in a one-litre jar or that you need to transmit or flush that litre of fluid image through a 2 mm hose. No way! Yes, both can be done, but at what cost of time or resource ... we must compress ... first we will evaporate the fluids, but that still leaves us with one and one half litres of pigments ... so we will combine the various reds into one red ... the various blues into one blue ... the various yellows into one yellow and voila ... we have one litre of picture. Now the problem ... after a couple of days or months we want to put the image back together ... so we add the liquids at least a rough composition of what the liquids were but we are still missing some things ... clarity, detail, colours, fluid transitions between squares of colour.

So compression got the image into our jar, but cost us some potentially important details. So we must learn and pay attention.

To start, we must first get the language right. We are no longer working with CCTV, we are now working with digital imaging systems (DIS). This too, is part of the process of converting and compressing our industry into the future. The second step is to understand that we have no fixed standards with the new digital compression engines. So what? Our entire visual industry, from the first CCTV camera to the latest and greatest DVD recorder, has been built upon a mountain of equipment, imaging techniques, storage scenarios and visual evidence ... and very little of it compatible to itself or its industry. So why would you expect DIS to be any different? Thirdly, the manufacturer has always had the advantage of the language. They invent it to market, sell and promote their equipment, tools or products. So why would you expect any one of them to find fault with a compression engine used by their own equipment? I want you to remember this at the end of this article, all will fall into place at that time.

To start, there are two basic types or styles of compression in the digital world. Lossless and lossy (often referred to as lousy). Lossless compression allows the original data to be reconstructed exactly from the compressed data while lossy compression has loss of certain elements of the original product ... resolution, colour, pixels, frames and/or a combination of each. Lossless compression is big in the medical industry where extreme resolution is necessary, there is lots of storage space and the transmission rate or speed of a visual image is not a major factor of operation.

Since digital code sequences (binary strings) can be very large, we compress them to take up less bandwidth for transmission and/or space on a hard drive or floppy drive. Lossy compression is what we use in the video industry and it comes in a large variety of standards. These compression standards are called engines. Right off the bat, the confusion is set in place as we, the common men and women of the world, think of an engine as a mechanical or physical device. In actuality, a compression engine is an algorithm, a series of binary codes (individual groups of eight 0s and 1s) set into a specific string or order as a set of instructions telling the computer what part of the digital information to change or remove. These are referred to as codecs. When you play the information back, it must be uncompressed using a compatible decoder. The reality is that there are probably several tens or possibly hundreds of individual codec schemes and several tens or hundreds of individual variations on each of these. This is why it is possible that you have a file with the right identifier (ie: AVI and MOV) and yet you cannot play it back. We in the DIS industry are most aware of only a few of these 'engines' and their variations ... JPEG, Motion JPEG, MPEG, Wavelet, H-263, etc. So for kicks and grins, let us take a look at how a few of the more popular compression engines work and what could go wrong.

First JPEG (joint photographic experts group). Motion JPEG (M-JPEG) is one compression engine that we use in the DIS industry. It records every frame. The compression comes from the combining of neighbouring groups of pixels into larger blocks. As a consequence of this combining, fine detail within an image is lost while larger, less defined areas are retained. A secondary downfall is that JPEG creates a 'Jug Head' effect. That is, as the picture is decoded and made larger, it becomes apparent that it is made of squares of colour causing the rounded edges of objects to be squared off. The man's head appears to be a group of squares of colour with no definition. The higher the compression ratio, the more little squares are combined to create one larger one. The higher the compression ratio, the smaller the image must be kept to discern detail. Explain your one-inch by one-inch printout to the police and watch them try to find the bad guys and gals, eh?

Wavelet: This is a very popular form of compression as it is easy to work with and can be easily duplicated or altered to fit each individual need. Unlike JPEG, Wavelet does not block together groups of pixels. It works on the frequency of like pixels. Unlike M-JPEG, Wavelet does not create the Jug Head effect, it also drops the fine details but instead creates a soft appearance or slightly out of focus look. The end result is loss of quality of image when exploded or blown up beyond X ratio.

MPEG (motion picture experts group): According to sources all around the DIS industry, MPEG-4 is the compression factor of the future. However, let us take it apart and go forward. We start with MPEG 1 & 2 ... at least these are the variations of the compression standard that we are accustomed to at our end of the industry. They are all upgrades to the original factor and work on the same principal. The whole idea of MPEG is to retain as much of the detail or resolution of the image as possible. This is accomplished by recording one image in full resolution with high detail and then, in the following frames, only recording what changed in the image. So, the first frame is the moving car with full background while the following frame is only the car and the background where the car was in the previous frame. This whole process is accomplished through the use of three frame types. The Intra Frame (I frame), Bi-linear Frames (B frame), and the Preceding and Subsequent Frame (P frame). The I frame is the only real, full frame of uncompressed information.

It is used as the background for the rest of the scene. The B frames look back and compare the current position of objects in the image with the present position and then holds only that information that has changed. It then looks forward to the next B frame to verify that the objects it held continued to move. If they do, then it records those items that have moved. (If you think this sounds confusing, you should be a B frame during decompression) The P frames only look back and tie the whole sequence together. The net result is that you would have a chain that would look like:

I B B P I B B P. The problem comes with extreme compression. The more B frames, the less bandwidth to transmit or store. So you could have a sequence such as: I B B B B B B B P I. However, the fewer I frames, the more chance of corruption within the playback. Additionally, there is no time, date or sequence reference in the B frames. Consequently, you could technically add, remove and/or reorganise the B frames and have no way of knowing that it had been done. This could and does, from time to time, cause a problem in playback or as presentation in court. MPEG file sizes range from 1,4 to 12 Kb - a very efficient form of compression, but one to learn about in detail, just the same. The latest buzzword is MPEG 4. However, there is so much confusion over what MPEG 4 is really about, even the experts do not agree and everyone has their own opinion about the changes or options that MPEG 4 brings to the table. We know it is better, faster and far more accurate than its predecessors, but it is still a compression factor.

H-261, H-263, H-263+, and H-263++ are all formats of the same compression engine. These format standards were originally designed for video telephony and conferencing for the Internet. They use JPEG-like compression with motion compensation prediction. That mouthful means to say that, once an object - let us say a car - is established as moving, the compression factor gets busy and recreates the car in the future positions where it predicts it to be going. It does not record the differences, but moves the car forward and refreshes the background. The file sizes range from ,54 Kb to 8,77 Kb, very nice compression size. The down side is that the H series compression engines do not deal with sudden or fast movements well. Such motions throw off the prediction process.

Therefore, it is entirely possible for a man to wave his arms in a frantic gesture and have them disappear or fall off of his body in one or more frame. This would leave you having to explain an armless man performing an armed holdup ... an oxymoron to say the least.

OK, so now you have the layman interpretation of compression standards, how they work and what the problems are. You only have one more question to ask about compression engines.

Which one is the best for recorded video? The answer to that is not so easy. If you ask any of the hundred or so manufacturers of digital video recording equipment you will hear the same answer - 'Ours is the best'. Does not matter what your application is, does not matter what your budget is, does not matter much about anything. The manufacturer that you are speaking to will have the best compression engine for you. Bottom line, each format has its problems. The only way to find the best engine for your application is to first design your requirements and then apply the theory of each engine's operation to your application. Finally, I always recommend an extensive, on-site test whenever and wherever possible. This, after all, is the only true method of verification.

The summary and conclusion that you should have reached by now is that you must be careful not to purchase equipment that has a proprietary compression engine, otherwise you may very well find yourself standing on the outside looking in at a potentially expensive upgrade. Do not worry, this only knocks out about 85% of the overall digital video recorder industry as it stands today.

Charlie Pierce has been working in the security industry since 1974 and consults and speaks in the electronic security area internationally. He can be contacted at LeapFrog Training & Consulting (LTC), 091 563 322 6669, fax 091 563 336 8853, [email protected], http://www.ltctrainingcntr.com/</a>





Share this article:
Share via emailShare via LinkedInPrint this page



Further reading:

AI human detection cameras vs outdoor detectors
Provision ISR SA Surveillance
The advancement of technology has revolutionised many aspects of security systems, notably in the transition from traditional outdoor alarm detectors to modern, AI-based, human-detection IP cameras, which offer many benefits.

Read more...
Safeguarding farmland with digital solutions
Axis Communications SA Surveillance
Marlenique Estate, located in the Western Cape, opted for an Axis end-to-end solution to protect its premises with access management, remote monitoring, and property and asset protection.

Read more...
Cutting costs and enhancing security
Secutel Technologies Surveillance
[Sponsored] Visual verification, powered by the Secutel Visual Verifier, detects and verifies intrusions and physical attacks and ensures comprehensive protection in areas where high-value losses are at risk.

Read more...
Supercharge surveillance with AXIS Camera Station Pro
Duxbury Networking Surveillance Products & Solutions
Designed to put efficient surveillance at users’ fingertips with an intuitive interface that is easy to operate, AXIS Camera Station Pro 6.2 provides a customisable video management and access control solution for companies of all sizes.

Read more...
Easy, secure access for student apartments
Paxton Access Control & Identity Management Surveillance
Enhancing Security and Convenience at Beau Vie II Student Accommodation, a student apartment block located at Banghoek Road, Stellenbosch, with Paxton's access control and video management solution

Read more...
SMART Surveillance at the Indaba
SMART Security Solutions Editor's Choice Surveillance Videos
SMART Security Solutions hosted its second SMART Surveillance conference, focusing on a range of topics related to the video surveillance market, on July 11th, 2024, at the Indaba Conference Centre in Fourways.

Read more...
Horn speakers from Sunell
Forbatt SA Products & Solutions Surveillance Residential Estate (Industry)
Horn speakers are an effective tool for actively deterring intruders from entering estates. By emitting loud, clear audio warnings, horn speakers can alert trespassers that they have been detected and are being monitored.

Read more...
Sunell’s range of thermal cameras
Forbatt SA Products & Solutions Surveillance Residential Estate (Industry)
Thermal cameras offer significant value to estate security. Their ability to provide reliable surveillance in all lighting and weather conditions ensures continuous monitoring, providing a constant sense of security and reducing the likelihood of security breaches.

Read more...
Integrating radar and surveillance
Forbatt SA Products & Solutions Surveillance Residential Estate (Industry)
Integrating radar with CCTV video systems significantly enhances estate security by providing long-range threat detection and comprehensive monitoring capabilities. This combination leverages the strengths of both technologies, offering several key benefits.

Read more...
Sunell anti-corrosion cameras
Forbatt SA Products & Solutions Surveillance Residential Estate (Industry)
With Sunell’s anti-corrosion range of cameras, the initial investment in anti-corrosion CCTV cameras may be higher than standard cameras, but the long-term benefits outweigh the upfront costs.

Read more...