Tuesday, October 6, 2009

H.264 Compression

The latest IP cameras are using the new video compression H.264. We have had many questions about this new compression method so here’s an article that provides the information you will need to better understand this new technology.

H.264 is a new version of MPEG4 and it provides about twice as much compression as the older version. Apple has been using this standard for a number of years and it is now available in the latest IP Cameras. A number of manufacturers have begun to introduce this technology. Axis is in the lead at the moment, but other companies such as Sony, IQinvision and others are slowly introducing their new models as well.

This latest video compression standard, H.264 (also known as MPEG-4 Part 10/AVC for Advanced Video Coding), is becoming the video standard of choice.

Compression Concept
The intent of the H.264/AVC project was to create a standard capable of providing good video quality at substantially lower bit rates than previous standards (e.g. half or less the bit rate of MPEG-2, H.263, or MPEG-4 Part 2), without increasing the complexity of design so much that it would be impractical or excessively expensive to implement. An additional goal was to provide enough flexibility to allow the standard to be applied to a wide variety of applications on a wide variety of networks and systems, including low and high bit rates, low and high resolution video, broadcast, DVD storage, RTP/IP packet networks, and ITU-T multimedia telephony systems.

H.264 is an open, licensed standard that supports the most efficient video compression techniques available today. Without compromising image quality, an H.264 encoder can reduce the size of a digital video file by more than 80% compared with the Motion JPEG format and as much as 50% more than with the MPEG-4 Part 2 standard. This means that much less network bandwidth and storage space are required for a video file. Or seen another way, much higher video quality can be achieved for a given bit rate.

Jointly defined by standardization organizations in the telecommunications and IT industries, H.264 is expected to be more widely adopted than previous standards.Video compression is about reducing and removing redundant video data so that a digital video f ile can be effectively sent and stored. The process involves applying an algorithm to the source video to create a compressed file that is ready for transmission or storage. To play the compressed file, an inverse algorithm is applied to produce a video that shows virtually the same content as the original source video. The time it takes to compress, send, decompress and display a file is called latency. The more advanced the compression algorithm, the higher the latency, given the same processing power.

A pair of algorithms that works together is called a video codec (encoder/decoder). Video codecs that implement different standards are normally not compatible with each other; that is, video content that is compressed using one standard cannot be decompressed with a different standard. For instance, an MPEG-4 Part 2 decoder will not work with an H.264 encoder. This is simply because one algorithm cannot correctly decode the output from another algorithm but it is possible to implement many different algorithms in the same software or hardware, which would then enable multiple formats to be compressed. Different video compression standards utilize different methods of reducing data, and hence, results differ in bit rate, quality and latency.

The graph below provides a bit rate comparison, given the same level of image quality, among the following video standards: Motion JPEG, MPEG-4 Part 2 (no motion compensation), MPEG-4 Part 2 (with motion compensation) and H.264 (baseline profile).

Figure 1. An H.264 encoder generated up to 50% fewer bits per second for a sample video sequence than an MPEG-4 encoder with motion compensation. The H.264 encoder was at least three times more efficient than an MPEG-4 encoder with no motion compensation and at least six times more efficient than Motion JPEG.

Depending on the H.264 profile, different types of frames such as I-frames, P-frames and B-frames, may be used by an encoder.
An I-frame, or intra frame, is a self-contained frame that can be independently decoded without any reference to other images. The first image in a video sequence is always an I-frame. I-frames are needed as starting points for new viewers or resynchronization points if the transmitted bit stream is damaged. I-frames can be used to implement fast-forward, rewind and other random access functions. An encoder will automatically insert I-frames at regular intervals or on demand if new clients are expected to join in viewing a stream. The drawback of I-frames is that they consume much more bits, but on the other hand, they do not generate many artifacts.

A P-frame, which stands for predictive inter frame, makes references to parts of earlier I and/or P frame(s) to code the frame. P-frames usually require fewer bits than I-frames, but a drawback is that they are very sensitive to transmission errors because of the complex dependency on earlier P and I reference frames.

A B-frame, or bi-predictive inter frame, is a frame that makes references to both an earlier reference frame and a future frame.
Figure 2.
When a video decoder restores a video by decoding the bit stream frame by frame, decoding must always start with an I-frame. P-frames and B-frames, if used, must be decoded together with the reference frame(s).In the H.264 baseline profile, only I- and P-frames are used. This profile is ideal for network cameras and video encoders since low latency is achieved because B-frames are not used.

Basic Concepts of Reducing the Data
A variety of methods can be used to reduce video data, both within an image frame and between a series of frames.
Within an image frame, data can be reduced simply by removing unnecessary information, which will have an impact on the image resolution. MJPEG utilizes this algorithm.

In a series of frames, video data can be reduced by such methods as difference coding, which is used by MEPG4 and H.264. In difference coding, a frame is compared with a reference frame (i.e. earlier I- or P-frame) and only pixels that have changed with respect to the reference frame are coded. In this way, the number of pixel values that are coded and sent is reduced.

Figure 3. With Motion JPEG format, the three images in the above sequence are coded and sent as separate unique images (I-frames) with no dependencies on each other.

Figure 4. With difference coding (used in most video compression standards including H.264), only the first image (I-frame) is coded in its entirety. In the two following images (P-frames), references are made to the first picture for the static elements, i.e. the house, and only the moving parts, i.e. the running man, is coded using motion vectors, thus reducing the amount of information that is sent and stored.
The amount of encoding can be further reduced if detection and encoding of differences is based on blocks of pixels (macroblocks) rather than individual pixels; therefore, bigger areas are compared and only blocks that are significantly different are coded. The overhead associated with indicating the location of areas to be changed is also reduced.

Difference coding, however, would not significantly reduce data if there was a lot of motion in a video. Here, techniques such as block-based motion compensation can be used. Block-based motion compensation takes into account that much of what makes up a new frame in a video sequence can be found in an earlier frame, but perhaps in a different location. This technique divides a frame into a series of macroblocks. Block by block, a new frame—for instance, a P-frame—can be composed or ‘predicted’ by looking for a matching block in a reference frame. If a match is found, the encoder simply codes the position where the matching block is to be found in the reference frame. Coding the motion vector, as it is called, takes up fewer bits than if the actual content of a block were to be coded.

Figure 5. Illustration of block-based motion compensation
Improving Compression Even more with H.264
H.264 takes video compression technology to a new level. With H.264, a new and advanced intra prediction scheme is introduced for encoding I-frames. This scheme can greatly reduce the bit size of an I-frame and maintain a high quality by enabling the successive prediction of smaller blocks of pixels within each macroblock in a frame. This is done by trying to find matching pixels among the earlier-encoded pixels that border a new 4x4 pixel block to be intra-coded. By reusing pixel values that have already been encoded, the bit size can be drastically reduced. The new intraprediction is a key part of the H.264 technology that has proven to be very efficient. For comparison, if only I-frames were used in an H.264 stream, it would have a much smaller file size than a Motion JPEG stream, which uses only I-frames.

In this mode, four bottom pixels from the block above are copied vertically into part of an intra-coded macro-block. In this mode, four right-most pixels from the block to the left are copied horizontally into part of an intra-coded macroblock. In this mode, eight bottom pixels from the blocks above are copied diagonally into part of an intra-coded macro-block.

Figure 6. Illustrations of some of the modes that intra prediction can take in coding 4x4 pixels within one of the 16 blocks that make up a macroblock. Each of the 16 blocks in a macroblock may be coded using different modes.

Original source image Intra predicted image

Residual image Output image
Figure 7. The above images illustrate the efficiency of H.264’s intra prediction scheme, whereby the intra predicted image is sent for “free”. Only the residual content and the intra prediction modes need to be coded to produce the output image.

Block-based motion compensation—used in encoding P- and B-frames—has also been improved in H.264. An H.264 encoder can choose to search for matching blocks—down to sub-pixel accuracy—in a few or many areas of one or several reference frames. The block size and shape can also be adjusted to improve a match. In areas where no matching blocks can be found in a reference frame, intra-coded macroblocks are used. The high degree of flexibility in H.264’s block-based motion compensation pays off in crowded surveillance scenes where the quality can be maintained for demanding applications. Motion compensation is the most demanding aspect of a video encoder and the different ways and degrees with which it can be implemented by an H.264 encoder can have an impact on how efficiently video is compressed.

With H.264, typical blocky artifacts—seen in highly compressed video using Motion JPEG and MPEG standards other than H.264—can be reduced using an in-loop deblocking filter. This filter smoothes block edges using an adaptive strength to deliver an almost perfect decompressed video.

Figure 8. Blocky artifacts in the highly compressed image at left are reduced when a deblocking filter is applied, as seen in the image at right.

H.264 compression provides a significant improvement in video compression technology. It is supported by many different standards groups making it one of the most accepted standards. Because it provides a dramatic improvement in compression, it reduces the bandwidth and storage required. It provides an 80% improvement over MJPEG compression and about 50% improvement over MPEG4 compression. It is now available in the latest cameras from Axis, and other manufacturers.

Need more information about this compression or the cameras that utilize it, just contact us at 914-944-3425 or by using our contact form.

Thursday, June 4, 2009

Access Control Technology Review

Door access control systems have changed over the years. The early units were quite difficult to install. They used simple card readers with all the intelligence located back at the control panel. Over the years more intelligent devices were developed, and now, in the state-of-the-art solutions, most of the intelligence is located at the reader near the door. The latest IP type readers make use of your Ethernet network and are very easy to install. This article reviews the types of systems available and how they can be integrated with IP cameras.

In physical security, the term access control refers to the practice of allowing entrance to a property, a building, or a room only to authorized persons. Physical access control can be achieved by a human (a guard, bouncer, or receptionist), through mechanical means such as locks and keys, or through technological means such as door access control systems that use magnetic locks. In general, in an automated system, access is controlled using a special RFID type proximity card or by keying in an ID number. If the system accepts the person, a relay is activated that unlocks the door.


Basic non-intelligent Readers: The first automated door access control systems utilized simple non-intelligent reader panels that connected back to a central control panel. All the access requests were forwarded back to the central control panel.

Semi-intelligent Readers: The next generation of readers included some intelligence. These readers included enough intelligence to control the door lock hardware, but did not make any access control decisions. The reader simply passed on the code entered to the main controller and then waited for a response. These readers are usually connected to the main panel via an RS-485 bus.

Intelligent Readers: The first intelligent readers connected back to a centralized control panel via the same RS-485 connection as semi-intelligent readers. They included memory and enough intelligence to make access decisions independently of the control panel. The special control panel provides configuration updates and receives events from the readers and maintains a history of the door access.

Intelligent IP Reader and Controller: This is the latest type of reader (such as the
reader from ISONAS). It’s similar to the intelligent reader in that all the decisions are made at the reader, but instead of using a specialized control panel, it uses a standard computer running access control software. It also uses the standard network infrastructure for communication (CAT 5 or 6 cable). Since it totally eliminates any special wiring and specialized control panels, it is the simplest to install and maintain.


The latest door control systems use an IP reader and special software that runs in a Windows computer. The IP reader is attached to the Ethernet network. Magnetic locks and strikes secure the doors which are opened by the IP Reader when the right access card (or other RFID device) passes near the IP Reader. Each Reader contains a list of people who are allowed to enter the door. Software running in a Windows computer is used to control the system, add the people who are allowed to enter the door, send the list to the readers and provide reports of who and when people entered.

IP Reader
An IP based system, such as the one from
ISONAS, utilizes the latest IP readers. It does not require a centralized control panel. Since this system uses network attached components and standard computer systems it provides a very flexible door control system. The reader is powered over Ethernet (PoE) so you don’t require any additional power wires. The reader includes door sense input connections and provides an output that controls the electric door lock.

These readers are designed for both indoor and outdoor use. The optional keypad can be used for additional personnel verification. There are models that use the HID format RFID proximity devices. The devices are available in many different formats from plastic cards, to keychain fobs.

Magnetic Locks and Strikes
There are a variety of automated door locking systems available. You can select either a magnetic lock or electric strike to secure a door.

Magnetic locks are used in high security areas where you need to monitor the movement of people. Since people are required to use their access cards in both directions, you can track who enters and leaves a secure area.

The locking system uses an electromagnetic and armature plate to secure the door. The electromagnet is attached to the door frame while the armature plate is attached to the door. A current passes through the electromagnetic so that it is magnetically attracted to the armature plate holding the door closed. The magnetic strength can provide over 1500 lbs. of holding force. Locks with higher magnetic force can be used to secure an outer door, while lower force locks can be used to secure inner doors.

The locks require special power supplies that can be integrated into a fire panel. It is important to assure that the locks can be released if an emergency situation occurs.

The electric strike are easy to install and are used to secure outer and inner doors, but do not prevent egress from an area like the magnetic lock. It replaces the fixed strike place in a standard lock. Like a fixed strike, it normally presents a ramped surface to the locking latch allowing the door to close and latch just like a fixed strike would. To exit from a secured area, the door can be opened by using a knob or level.

To simplify installation, it is important to use locks that require less than 500ma of current. This allows the reader to be powered over Ethernet. The electric locks from Rutherford Controls are examples of this type of low power lock.

Electric strikes generally come in two basic configurations:
  • Fail-secure. Also called Fail-locked or non-fail safe. In this configuration, applying electrical current to the strike will cause it to open. In this configuration, the strike would remain locked in a power failure, but typically the knob can still be used to open the door from the inside for egress from the secure side. These units can be powered by AC which will cause the unit to "buzz", or DC power which will offer silent operation, except for a "click" while the unit releases.
  • Fail-safe. Also called Fail-open. In this configuration, applying electrical current to the strike will cause it to lock. In this configuration, it operates the same as a magnetic lock would. If there is a power failure, the door would open merely by being pushed/pulled open. Fail safe units are always run using DC power.

Adding video to a door control system increases the overall security of the system. By viewing and recording the video, you can keep a visual record of all the people entering your facility as well as determining if the access tag matches the person. You can also catch multiple people entering with only one access (tailgating). Adding additional software will even allow you to do this automatically.

IP camera
By adding an IP camera you can view who enters and leaves an area. The video is captured at the computer running the special NVR software. Cameras from Axis, JVC, IQinvison and others can be used to capture the video.

Adding audio: By using an IP camera that supports audio you can even record the audio at the time of entry. There are many cameras that support audio but you must also select cameras that are also supported by the NVR software. Cameras from Axis and Sony are supported by a number of NVRs and are available with 2-way audio support.

It is important to select access control and the video recording software that are compatible. For example, the Isonas Crystal Matrix software and OnSSI’s NetDVMS software work well together.

The IP reader system notifies the Crystal Matrix Software that a person has opened a door. The Crystal Matrix software then notifies the NetDVMS surveillance software that the door has been accessed causing the NVR software to record the video from the specific camera that is watching the door. Since the video is time stamped you can easily match video to the door access software timeline.

Adding additional Intelligence
There is also optional analytic software available (such as AgentVI) that can automatically watch for tailgating and provide alarms if more than one person tries to enter an area.


As an alternative to an automated system, you can control access by just using an IP camera at each entry door. This works only if you have a centralized security person. Using a camera and intercom, the security person can talk to the person at the door, make a decision based on the picture he sees on his monitor, and then press a lock release button to open the remote door. All communication is done over your Ethernet network so it’s easy to implement.
Here’s what you need to implement the system:

Cameras with Audio
In almost all cases a camera that includes audio, supports MPEG4 compression. This form of compression includes data packets for audio transfer as well as video. picture3For example, the Axis 210A includes two-way audio. It has audio input and audio output so you can attach a microphone and powered speaker. Other cameras with audio include Axis214PTZ and Axis211A.

The intercom and microphone are connected to inputs on the IP camera. All the information from the camera is sent over the standard Ethernet network back to a Windows type PC server.

Doorway Intercoms

picuture7To have a two-way conversation with someone at a doorway requires both a microphone and speaker. The microphone and the speaker must be compatible with the input and output requirements of the camera. It’s best to use a directional microphone to minimize any extra noise in the area. Here’s an example of a two way system that is compatible with most cameras.

Bi-directional Speakerphone. Surface Wall mount speakerphones are designed to interface with various modes of audio/video transmission systems. They provide bi-directional audio with the IP Network cameras that support audio, and video servers with audio support. It contains a built-in electret condenser microphone and a 4" speaker. Also control potentiometers for adjusting the sensitivity of both transmitted and received audio. It can be used outdoors but requires protection from direct exposure to the elements.

NVR IP Software
Special software that runs in your Windows PC computer is used to communicate with the intercom and allows you to view and record the video. For example, NetDVR and NetDVMS from OnSSI provide two-way audio support as well as recording both the video and audio.

These systems are easy to implement but I’m sure you will have questions about all the details. Just contact us at 914-944-3425 or use our contact form to get more information.

Thursday, January 22, 2009

What's a Watt

Knowing more about voltage, current and power can help when you are putting together an IP camera system. This is especially true when you are selecting the power supply and running the wire. Computers, light bulbs and cameras have a power rating that is measured in Watts and sometimes in Volt-Amps (VA). Ever wonder what a Watt is, or why we sometimes use watts and other times Volt-Amps? It’s important to know about the power, because if you don’t have enough of it you’re in trouble. This article provides the information you need to stay out of trouble.

Current is the flow of electric charge. The unit of measure for current is the ampere, or abbreviated it’s “amp”. If you stick your finger in an outlet (please don’t do this), it’s the current that knocks you on your rear. The more current you have, the larger the size (or gauge) of the wire you need to carry the flow of the current. If the wire gauge is too small, it resists the flow of the current and it gets hot. (See the description of a resister below.)

Resistance is what generates the heat when voltage and current are applied to an electric circuit. An electric heater is an example of a resister. The more current that follows through a resister the hotter it will get. Resistance is measured in ohms.
C:\Documents and Settings\Bob Mesnik\My Documents\My Pictures\voltage current no resistance example.jpgVoltage and current are related in electrical equipment by Ohm’s law. Voltage (V) is related to current (I) by the resistance (R) of the electrical circuit. The formula is V=I X R. This means that if you run 2 amps of current through an IP camera that has a resistance of 6 ohms you will get 12 volts (2 X 6 = 12 volts).

Almost everything, including wire, has some resistance. The thicker the wire the less resistance it has to the flow of the current. It’s like having a larger size pipe for water. The thinner the wire gauge the more resistance the wire will have, and the lower the voltage will be at the end of the wire. Also, the longer the length of the wire the more resistance is added. When you have a long run of wire, you should use a larger gauge size wire (thicker) to reduce the resistance.

For those who need more details, here they are, otherwise just go to Voltage description below.
C:\Documents and Settings\Bob Mesnik\My Documents\My Pictures\voltage current example.jpgTo illustrate the problem of wire resistance, I will use a slightly more complicated drawing. In this example I added the 2 ohm resister to represent the resistance of the wire. Now there is a total of 8 ohms in the circuit (6 + 2 = 8). Since there is now more resistance in the circuit, the amount of current changes and so does the amount of voltage available at the camera. The equation to calculate the current is: I = V/R. So now the current equals 12/8 or 1.5 amps. The camera that was getting 12 Volts before we added the resistance of the wire is now getting only 9 volts (I used the formula V=I X R for this. 1.5 A X 6 R = 9 volts.) This lower voltage could be a problem for the camera. There are some charts on the Internet such as the one at http://www.interfacebus.com/Copper_Wire_AWG_SIze.html. It describes the American Wire Gauge (AWG) for various gauges vs. the resistance of 1000ft of wire.

Voltage is the difference of potential between two points of an electrical circuit. The higher the potential the more volts you have. For example you can generate a lot of voltage by rubbing your feet on a carpet, and make quite a large spark when you touch a metal surface (or someone else).

Another example can be seen at museums that have scientific displays. Sometimes they have displays that show the effect of voltage. They let kids touch the surface of a large metal ball. When they touch it, their hair sticks out in all directions. This is called a Van der Graf generator (but you probably don’t need to know this). It generates a very large voltage on the surface of the metal ball, and the static electricity makes your hair stand on end.

Now for Watts:
Here’s the definition of a watt: the watt (symbol: W) is equal to one joule of energy per second (and about 745 watts equals 1 horsepower). It measures a rate of energy conversion. It was named after our old friend James Watt. Remember his work with the steam engine? If not, you’re not smarter than a fifth grader.

Here are some examples of the Watt. A human climbing a flight of stairs is doing work at a rate of about 200 watts. An automobile engine can produce mechanical energy at a rate of 25,000 watts (which is equal to approximately 33.5 horsepower) while cruising. A household incandescent light bulb uses electrical energy at a rate of 25 to 100 watts, while compact fluorescent lights typically consume 5 to 30 watts. We also have Kilowatts (1,000 watts), Megawatts (1,000,000 watts) and if you have a power station available Gigawatts (too many zeros (9 actually)).

First off, you may know this, but there are two different types of electrical systems. There is Direct Current (DC) systems and Alternating Current (AC) systems. I’m going to start by explaining DC systems which are simpler than AC systems.

The Watt is related to the voltage and current. The formula for calculating the watt is: Watts (W) equal Current (I) X Voltage (V) or W = I x V. For example if I have a camera that requires 12 V DC and it takes 2 amps, it will require a power supply that can provide at least 24 watts. (2 x 12 = 24).

Volt-Amps or Power in an Alternating Current System
Power is fairly simple, when you are using a DC power supply. It gets a little more complicated when you use an AC power supply. In the alternating current world the voltage cycles up and down. This is called a sine wave. The voltage goes positive and then negative and back again. The current goes back and forth as well. These two cycles can be affected by the load, especially when the load includes other components such as a transformer or motor. Pan tilt cameras with motors are an example of a complex load.

When there is a complex load, the sine wave for the voltage can get displaced from the sine wave for the current and this changes the real power we will need. When we compute power in an AC network we use Volt-Amps instead of Watts.
We use the Power Factor to adjust for this variable power load. Now the Volt-amps equal the watts divided by power factor. The power factor is a number between 0 and 1 and its value is determined by the properties of the load. So if you have a system that needs 20 watt but there is a power factor of 0.5, the Volt-Amp required is 20 / 0.5 = 40 watts. Notice that the unit of measure is the same (further confusing things).

If you have a camera or other device that doesn’t have a complex load then the power factor equals “1”. This is true in most fixed IP cameras. In this case, Watts equals Volt-Amps.

In summary, current, resistance and power are important specifications to consider when installing IP cameras or any type of camera system. The gauge (thickness) and length of wire is important because it can affect the voltage. Power is measured in Watts, but it can also be the same as Volt-Amps, it’s just determined by the type of load (or camera) that’s used.

If you would like more information about how voltage, current and power affect your IP camera system, just contact us at 914-944-3425 or use our contact form.