12
White paper Bit rate Variable, Constant or Maximum?

Bit rate - Axis Communications 1. Introduction This document aims at helping the customers to understand what are the principles behind the different modes to regulate bit rate of

Embed Size (px)

Citation preview

White paper

Bit rateVariable, Constant or Maximum?

Table of contents1. Introduction 3

2. Ideal behavior 3

2.1 Variable Bit Rate (VBR) 3

2.2 Constant Bit Rate (CBR) 3

2.3 Maximum Bit Rate (MBR) 4

3. Actual behavior and limitations 7

3.1 Variable Bit Rate (VBR) 7

3.2 Constant Bit Rate (CBR)

3.3 Maximum Bit Rate (MBR) 7

4. Questions you may ask yourself 8

5. Bit rate optimization (image and video settings) 8

5.1 Image settings that influence the bit rate 3

5.2 Video settings that influence the bit rate 3

5.3 Bit rate optimization work flow 4

3

1. IntroductionThis document aims at helping the customers to understand what are the principles behind the differentmodes to regulate bit rate of a streamed video.

Bit rate (sometimes written bitrate) is the number of bits of data that are conveyed per unit of time.The bit rate is quantified using the bits per second unit (symbol bit/s), often in conjunction with an SIprefix such as kilo (kbit/s), mega (Mbit/s), giga (Gbit/s) or tera (Tbit/s). One byte per second (1 B/s)corresponds to 8 bit/s.

This task is done by the bit rate controller, an algorithm which dynamically adjusts encoder parameters to achieve a desired bit rate. It allocates a budget of bits to each picture or sub-parts of picture in a video sequence. It is not a part of the H.264 standard.

2. Ideal behaviorIn this part we will discuss about the ideal behavior of different modes, each of them will be illustrated by a different scenario so that one can understand what would ideally happen.

We will as such focus on two simple examples:

> Low complexity scene (with little/no motion)> High complexity scene (with medium/big motion)

2.1 Variable Bit Rate (VBR)

Variable bit rate lets the video use the bandwidth it needs. The bandwidth can be really high or really low depending on the scene’s complexity.

VBR allows a high bitrate (and therefore requires more storage space and a network capable of handling it) to be allocated for more complex scenes of a video while using less bit rate for less complex scenes. The average of these rates is then calculated to get the average bitrate for the sequence.

The advantages of VBR are that it produces a better visual quality on a video (has a better rate-distor-tion ratio) compared to Constant Bit Rate or Maximum Bit Rate for the same scene.

The disadvantages are that the bit rate of the video may be really big in complex sequences. VBR may also pose problems during streaming when the instantaneous bitrate exceeds the available bandwidth of the network or the capacity of the recording/playing devices. Ideally, Variable Bit Rate doesn’t require any bandwidth regulation and uses as much bandwidth as needed.

The quality is constant whatever happens on the video.

> Low complexity scene: The bit rate will be low, but as soon as something occurs then the bit rate will jump to a higher level.

> High complexity scene: The bit rate will be high and may overload the recording device, network or video player.

Bitrate

Time

Variable bitrate

4

2.2 Constant Bit Rate (CBR)

Constant bit rate aims at having a bit rate for which a encoder’s output data should be consumed is constant, does not evolve over time and stays at the desired target bit rate whatever happens on the video. CBR is useful for streaming multimedia content on limited capacity channels. It was first designed for the video industry (VCD, DVD, Blu-ray) to ensure that the bandwidth for every device wouldn’t be exceeded and to ensure a continuous playback.

This mode is less good for storage because it may contain padding data and waste storage space for no gain on the video quality. If the video is not complex enough to sustain the target bit rate, the encoder will complete the remaining bit rate gap by doing bit padding: filling the video with unnecessary infor-mation (information not part of the video).

To meet the bitrate target, the bit rate controller changes the video quality and as last option reducethe frame rate.

> Low complexity scene: The bit rate will be the one set as target, bit padding may occur as we may not have enough data to achieve the target. Video will have full frame rate.

> High complexity scene: The bit rate will still be one set as target but the visual quality will be poor as it encoder would need to degrade the quality by raising the compression level to stay at target. The frame rate may be degraded if raising the compression level is not sufficient.

Constant bitrate

Bitrate

Time

Bitrate target

5

2.3 Maximum Bit Rate (MBR)

Maximum bit rate goal is to ensure that you stay under the determined target whatever happens on the video. It uses the same techniques as Constant Bit Rate to ensure that we stay under the set maximum bandwidth. The limit set should be a strict limit which shouldn’t be crossed but the bit rate should still stay just under it. It is designed to ensure that we don’t lose data because of network limitations and that the video will be streamed whatever happens on the video.

To stay under the maximum bit rate, the bit rate controller changes the video quality and as lastoption reduce the frame rate.

> Low complexity scene: The bit rate will be the one set as target, there will be no padding so the video bit rate may be under the target sometimes. Video will have full frame rate.

> High complexity scene: The bit rate will still be one set as target but the visual quality will be poor as it encoder would need to degrade the quality by raising the compression level to stay under target. The frame rate may be degraded if raising the compression level is not sufficient.

Bitrate

Time

Maximum bitrate

Bitrate target

6

3. Actual behavior and limitationsIn this part we will discuss about the expected behavior of different modes, each of them will be illus-trated by different scenario so that one can understand what would actually happen.

We will as such focus on two simple examples:

> Low complexity scene (with little/no motion)> High complexity scene (with medium/big motion)

We will also provide a list of parameters which can influence specifically these modes (available on Axiscameras), please note that image parameters (Wide Dynamic Range, sharpness, Light Finder) or sceneparameters (light conditions, noise level, objects/patterns on the video) will also influence the bit rate byadding/removing complexity from the video.

3.1 Variable Bit Rate (VBR)

Axis cameras are compliant with the H.264 level 4.1, which states that the maximum allowed bandwidth is 50 Mbits/s. Due to this limitation the bit rate has to be limited to 50 Mbits/s even in Variable Bit Rate mode to ensure that it will be compliant with other systems and will stay within this bandwidth limit.This may lead to degradation of quality and/or frame rate if the bandwidth needed by the video is more than 50 Mbits/s, yet again to ensure staying compliant with the H.264 level.

> Low complexity scene: The bit rate should be low, but as soon as something occurs then the bit rate will jump to a higher level.

> High complexity scene: The bit rate will be high and may overload the recording device, network or video player.

Parameters that influence this mode:

> Compression level: Sets the quality required on the video, lower compression will provide higher visual quality but higher bit rate, higher compression will provide smaller bit rate but also worse video quality.

> GOV length: Sets the length of the Group Of Pictures (GOP) used for the video. A smaller GOP leads to more frequent I-frames so a higher bit rate, bigger values will result in less I-frames so lower bit rate. Too big GOP will make the seek function on recorded videos more complicated as it needs to refer to an I-frame to render following P-frames of the video, also in case of data loss, visual artifacts will stay longer as only the I-frames are fully updated frames.

Bitrate

Time

Variable bitrate

H.264 level 4.1

7

3.2 Constant Bit Rate (CBR)

The standard definition of constant is to be understood as in average bit rate, the goal of a bit rate controller is to achieve this target on a short average by changing the quality or frame rate of the video.

This implies that Constant bit rate is never strictly constant in reality, at least from the instantaneous point of view (few frames) which can be critical on a network. The changes are dependent on the scene and the movement, the more complex the scene, the worse visual quality it will be for a same target.

CBR can lead to big bandwidth changes on the short term (few frames), time used by the bit ratecontroller to adapt the parameters to the new scene.

In the Axis cameras, bit padding is not done, that may lead to having a bit rate under the target.

> Low complexity scene: The bit rate should be low, as soon as something happens, the visual quality will be degraded. It is possible that the target bit rate is not achieved because we can’t provide enough data to get to the target bit rate. In case of changes overshoots can occur in the short term (few frames).

> High complexity scene: The visual quality will be degraded and frame rate diminished if needed, this may lead to several (big in amplitude but small in time) overshoots due to frequent changes in the scene.

Parameters that influence this mode:

> Compression level: Sets the best quality possible for the video, lower compression will provide higher visual quality but higher possible bit rate, higher compression will provide smaller bit rate but also worse video quality and also may lead to lower bit rate than target.

> Target bit rate: Sets the target to achieve (in kbits/s)> GOV length: Sets the length of the Group Of Pictures (GOP) used for the video. Lower value will lead

to smaller GOP, more frequent I-frames so higher bit rate, bigger values will result in less I-frames so lower bit rate. Too big GOP will make the seek function on recorded videos more complicated as it needs to refer to an I-frame to render following P-frames of the video, also in case of data loss, vi-sual artifacts will stay longer as only the I-frames are the fully updated frames.

> Priority: Set the priority of the bit rate controller to none, quality or framerate. These parameters load different margins for possible quality levels and frame skipped at once. Quality option will lead to the best visual quality at anytime, most likely at the cost of frame rate. Framerate option will lead to a possible worse visual quality but ensuring a certain frame rate.

H.264 level 4.1Bitrate

Time

Constant bitrate

Bitrate target

8

3.3 Maximum Bit Rate (MBR)

Maximum Bit Rate was designed so that the bandwidth of a video stays under the selected maximum bit rate and should ensure that both long term and short term bandwidth stays under this limit.

To do so it reacts fast on scene changes to limit spikes on bitrate as much as possible (most of the time only a few frames long) during a change. It drops frames if needed to ensure an overshoot as small as possible on the instantaneous level.

This can lead to the impression of frame rate drop when not reaching the set maximum bit rate, this is due to a mismatch between the average bandwidth displayed and the instantaneous bit rate as this rate controller works on both time scales.

In the Axis cameras, bit padding is not done, that may lead to having a bit rate way under the maximumvalue desired.

> Low complexity scene: The bit rate should be low, as soon as something happens, the visual quality will be degraded. It is possible that the selected maximum bit rate is not achieved because we can’t provide enough data to get close to the maximum bit rate. In case of changes, overshoots in the short term will be very limited.

> High complexity scene: The visual quality will be degraded and frame rate diminished if needed, this may lead to several (small in amplitude and in time) overshoots due to frequent changes in the scene, frame drops will be used to ensure a minimal spike on the bit rate.

Parameters that influence this mode:

> Compression level: Sets the best quality possible for the video, lower compression will provide higher visual quality but higher possible bit rate, higher compression will provide smaller bit rate but also worse video quality and also may lead to lower bit rate than target.

> Target bit rate: Sets the target to achieve as maximum (in kbits/s).> GOV length: Sets the length of the Group Of Pictures (GOP) used for the video. Lower value will lead

to smaller GOP, more frequent I-frames so higher bit rate, bigger values will result in less I-frames so lower bit rate. Too big GOP will make the seek function on recorded videos more complicated as it needs to refer to an I-frame to render following P-frames of the video, also in case of data loss, vi-sual artifacts will stay longer as only the I-frames are fully updated frames.

> Priority: Set the priority of the bit rate controller to none, quality or framerate. These parameters load different margins for possible quality levels and frame skipped at once. Quality option will lead to the best visual quality at anytime, most likely at the cost of frame rate. Framerate option will lead to a possible worse visual quality but ensuring a certain frame rate.

H.264 level 4.1Bitrate

Time

Maximum bitrate

Bitrate target

9

4. Questions you may ask yourselfQ: Is there any bitrate limitation whatever the mode I choose ?

There is always a hard coded (non changeable) limit of 50 Mbits/s whatever mode you choose. Please be aware that this limit is more strict with Maximum Bit Rate than with Constant Bit Rate. You can’t avoid this limitation as soon as it is built in the cameras to ensure compliance with the H.264 level and also avoid camera to overload.

Q: I use Maximum Bit Rate and the overlay displays that I am under the target but I havea lower frame rate, how come ?

As the Maximum Bit Rate is calculating and using the instantaneous bit rate of a video (updated every frame), it may occur that the bit rate for a few frames is over the set limit. Even if it reacts fast, it can’t predict the future and then can’t prevent this overshoot but only compensates for it. It does so by drop-ping frames to reduce the bit rate on the next frames. While this overshoot can be seen on an instan-taneous calculation of the bit rate, it may not be seen on an average calculation such as the one on the overlay, giving the impression that the target is not reached. This drop is then due to the small overshoot which the Constant Bit Rate controller doesn’t take into account.

To prevent this, you can enforce a Variable Bit Rate behavior by selecting the frame rate option, having a compression level which ensures that your video is around the desired bandwidth most of the time and setting the target as the absolutely maximum bandwidth you can support.

Q: I use Constant Bit Rate, I am over the target but doesn’t drop frame rate, shouldn’t it be doing it ?

If you want to stay under the target bandwidth set, you need a Maximum Bit Rate controller behavior. In the Constant Bit Rate the frame skipping is based on a buffer level and doesn’t take in account small changes, while with the Maximum Bit Rate it is based on the actual instantaneous bandwidth, which ensures that we drop frames if the target is reached.

Q: I use Variable Bit Rate but have a bad quality on the video, how is this possible ?

This is due to the hard coded limitation of 50 Mbits/s bandwidth, if the video gets close to this limit, the bit rate controller starts degrading the video quality and can even drop frame rate in some cases. This case is really seldom and only occurs when there is a high quality, complex scene which leads to really high bandwidth. It may also be due to network or client limitations which lead to loss of information.

To prevent this, raise the compression level of the video so that it doesn’t reach such high bandwidthand check the rest of the system.

10

5. Bit rate optimization (image and video settings)Image settings that influence the bit rateIdentical object with 6 different camera settings

From the lowest bit rate to the highest bit rate provided:

1. No sharpening

2. WDR off

3. Low contrast

4. Original5. High contrast

6. WDR on

7. Strong sharpeningHighest

Lowest

Strong sharpening

WDR on

Low contrast High contrast

No sharpening

Original

11

Video settings that influence the bit rateHere you can find the parameters which can be changed to influence the bit rate of a video.The parameters are followed by options sorted from the lowest bit rate to the highest bit rate expected.

1. Codec1. H.2642. MJPEG

2. Video resolution1. Lower than High Definition2. High Definition (720p)3. Full High Definition (1080p)4. 4K or upper

3. Frame rate1. 1 frame per second2. 60 frames per second or upper

4. Compression level1. compression 1002. compression 0

4’. Priority option1. Framerate2. None3. Quality

5. GOV-length1. group of pictures of 61440 (1 I-frame for 61439 P-frames)2. group of pictures of 1 (Only I-frames)

6. Image parametersRefer to the “Image settings that influence the bit rate” part for more information

7. Night mode parametersAdjust night mode parameters to reduce noise during night

8. Scene light/viewAdd light during night or rotate camera to avoid unnecessary complex objects on the video

CodecVideo

ResolutionFramerate

Compression& priority

CBR/MBRVBR

Compression

GOV/GOPlength

Imageparameters

Night modeparameters

Scenelight/view

1 2 3

4

4’

5 6 7 8

To set up bit rate, adjust:

Axis offers intelligent security solutions that enable a smarter, safer world. As the global market leader in network video, Axis is driving the industry by continually launching innovative network products based on an open platform - delivering high value to customers through a global partner network. Axis has long-term relationships with partners and provides them with knowledge and ground-breaking network products in existing and new markets.

Axis has more than 2,000 dedicated employees in more than 40 countries around the world, supported by a network of over 75,000 partners across 179 countries. Founded in 1984, Axis is a Sweden-based company listed on NASDAQ Stockholm under the ticker AXIS.

For more information about Axis, please visit our website www.axis.com.

©2015 Axis Communications AB. AXIS COMMUNICATIONS, AXIS, ETRAX, ARTPEC and VAPIX are registered trademarks or trademark applications of Axis AB in various jurisdictions. All other company names and products are trademarks or registered trademarks of their respective companies. We reserve the right to introduce modifications without notice.

About Axis Communications

6627

5/EN

/R1/

1512