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.

Frames
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.

Conclusion
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.

30 comments:

andy said...

Web casting, or broadcasting over the internet, is a media file (audio-video mostly) distributed over the internet using streaming media technology. Streaming implies media played as a continuous stream and received real time by the browser (end user). Streaming technology enables a single content source to be distributed to many simultaneous viewers. Streaming video bandwidth is typically calculated in gigabytes of data transferred. It is important to estimate how many viewers you can reach, for example in a live webcast, given your bandwidth constraints or conversely, if you are expecting a certain audience size, what bandwidth resources you need to deploy.

To estimate how many viewers you can reach during a webcast, consider some parlance:
One viewer: 1 click of a video player button at one location logged on
One viewer hour: 1 viewer connected for 1 hour
100 viewer hours: 100 viewers connected for 1 hour…

Typically webcasts will be offered at different bit rates or quality levels corresponding to different user’s internet connection speeds. Bit rate implies the rate at which bits (basic data units) are transferred. It denotes how much data is transmitted in a given amount of time. (bps / Kbps / Mbps…). Quality improves as more bits are used for each second of the playback. Video of 3000 Kbps will look better than one of say 1000Kbps. This is just like quality of a image is represented in resolution, for video (or audio) it is measured by the bit rate.

luannekcoppin said...

nice blog..................................................

天那 said...

成人線上無碼成人禁18成人笑說成人絲襪成人綱成人網站免費成人網絡成人網線上成人網論壇成人網路聊天成人網路電視成人網路視訊頻道成人網路視訊live成人網路咪咪成人破解免費a片影片試看免費色情的影片免費色情動畫影片免費色情無碼影片觀看免費色情視訊影片免費色情影片免費色情影片下載免費色情影片小說免費色情影片小澤圓免費色情影片欣賞免費色情影片直播免費色情影片電影免費色情影片網免費色情影片網站免費色情性愛影片女優做愛女優18女優!!女優女傭性生活女傭影片女f4裸體照女f4的裸體照女f4的amy裸體照圖女f4amy裸體照女f4amy的裸體照女f4amy的羅體照女高中生h圖女藝人桌布女優18xus

紅包 said...

處順境須謹慎,處逆境要忍耐。 ..................................................

健康保寶 said...

haha~ funny! thank you for your share~ ........................................

lesson said...

知識可以傳授,智慧卻不行。每個人必須成為他自己。..................................................

雅芳 said...

幸福是人人都要,又怎麼可能都歸你所有?要知道這世界幸福本來就不多........................................

國昆 said...

成人色情圖片激情聊天室火辣美眉520sex赤裸美女成人自拍貼圖18限性影片觀賞av色情影音聊天手淫激情成人聊天室成人色情圖片網sex520自拍走光照片淫慾18禁成人影音聊天美女台灣性網限制級女生手淫成人聊天春宮裙底風光情趣丁字褲極度震撼情色論壇露點成人視訊聊天avlive show愛愛明星露點台灣色情網站自慰少婦成人聊天網美女視訊成人頻道人妻熟女蕩婦一對多激情成人色情聊天室av成人上空秀巨奶視訊網愛聊天室一夜正妹色情貼片一對多免費美女視訊粉紅乳頭作愛影片美女聊天sexy成人色情圖片網女人胸部圖片視訊色情情色網站性關係辣妹聊天室大奶子

JeremiahRenne332 said...

go2av-視訊網 蕃薯藤交友 視訊聊天sexy girls get fucked辣妹 視訊交友天堂90739 高雄視訊34c正妹 免費視訊34c辣妹微風論壇 月宮貼圖色妹妹嘟嘟情人色網 免費視訊gogo 080豆豆出租情人視訊 999成人性站 拓網成人 視訊 純愛迷情成人綜合論壇 性感遊戲 辣妹自拍哈尼視訊 情色視訊 拓網交友情色視訊 520sex-情色視訊 拓網視訊交友 sexy girl色妹妹視訊 sex520貼片援交視訊聊天室 新浪視訊 色妹妹視訊高雄援交 34c視訊網愛聊天室 一對多視訊拓網辣妹視訊 176視訊聊天室 av最前線 視訊交友90739南台灣視訊 性愛貼圖 視訊聊天室90739 show-live視訊情色 網 美女米克綜合論壇視訊 日本avdvd女優美女寫真 完美女人辣妹鋼管脫衣秀 全裸美女圖片 辣妹視訊自拍美女聊天室 777美女dvd辣妹視訊 網路美女辣妹陪聊 台灣美女寫真集圖 成人卡通美女a片 視訊美女免費試玩 日本美女短片 色情漫畫777美女dvdav 亞洲藝人美女寫真 台灣亞洲名模美女 美女自拍走光貼圖 無碼女優美女圖光碟 護士美女自拍貼圖 巨乳美女寫真 自拍情趣美女 性感熱辣美女女優寫真

淑慧 said...

happy to read~ thank you!..................................................

巧生 said...

^^ 謝謝你的分享,祝你生活永遠多彩多姿!........................................

玄雨 said...

Thx ur share........................................

韋于倫成 said...

靠山山倒,靠人人老,靠自己最好。..................................................

佳蓉 said...

微風成人wellen 台灣無碼女優 av女優短片 性趣 十足,性愛教學 85cc成人片 av美美色網影片 成人小遊戲 成人 影片,性愛故事 後宮視訊聊天 正妹交友hibb tw 免費成人情色 線上看av 5278影片網 免費線上 aa 片試看成人論壇 tvnet 影音聊天室 八大娛樂網 ut387視訊聊天 百人斬視訊妹真人真事 hilive,蔡依林性感影片 視訊sex888movie影城 視訊辣妹,網路援交 拓網免費視訊辣妹 視訊kk69 85cc免費視訊辣妹脫衣秀 情色視訊做愛 080情人網,免費a片欣賞 sex520-視訊 桃園援交小魔女自拍天堂 視訊聊天室777美女 av短片-免費a片 Alice Japan免費影片 成人情色 ez打砲 性愛情慾視訊自拍aio 視訊交友90739南台灣視訊 sod特輯 免費av自拍影片成人 情色 日本avdvd光碟 天下第一色站 浪漫月光論壇 dudu sex,av無碼 甜心寶貝視訊妹 xxxpanda com 免費影片-無碼a片 免費線上歐美A片段觀看 黃金girls色論 34C正妹拓網交友 xvediox免費a片 金瓶梅視訊聊天室 卡通美女短片免費試看

桂竹桂竹 said...

志不立,天下無可成之事。........................................

D415_evonN_Risinger0 said...

More haste, less speed............................................................................

reeselane said...

真是太猛了,請受小弟一拜Orz(>O<)..................................................

benjaminga said...

^^~~輕輕鬆鬆的逛部落格,多謝有您的分享哦~~~..............................

欣來 said...

If the quantity is not a lot, I will hand carry..................................................

韋富 said...

不只BLOG內容很棒留言也很精采 XDDDD

陳淳 said...

人不能像動物一樣活著,而應該追求知識和美德.................................................................

毅筠毅筠 said...

很棒的分享~~~來留個言囉~~~~.................................................................                           

倩亮倩亮 said...

成熟,就是有能力適應生活中的模糊。.................................................................

夏康如 said...

要保持更新呦,加油!!!期待你的新文章!!!.......................................................

玉苓玉苓 said...

命運,就是自己行為的結果。..................................................

陳韋夏陳韋夏益東富益東富 said...

看著你的BLOG 好多朋友都回應 真厲害..................................................................

文郭ss華賴ss添卉顏俊s任 said...

晚上好,很喜歡你的blog哦...............................................................

吳勇佩吳勇佩 said...

當你真心渴望某一樣東西,整個宇宙都會聯合起來幫助你。..................................................

香昱信張君林 said...

馬丁路德:「即使知道明天世界即將毀滅,我仍願在今天種下一棵小樹。」............................................................

莊雅和莊雅和莊雅和 said...

享受你自己的生活,不要與他人相比。............................................................