prev/next

Bitrate

Using Constant Bitrate (CBR)

Sometimes it is required to use Constant bitrate (CBR) instead of Variable bitrate (VBR) , which is default.

Usually it is helpful for video streaming.  

To switch on this option, just add <cbr>yes</cbr> within the <format> section of your XML query. 

Please note that you also MUST explicitly specify  <bitrate> in

 More -->

Sometimes it is required to use Constant bitrate (CBR) instead of Variable bitrate (VBR), which is default.

Usually it is helpful for video streaming.  

To switch on this option, just add <cbr>yes</cbr> within the <format> section of your XML query. 

Please note that you also MUST explicitly specify  <bitrate> in this case.

<-- Hide
tools: email  |  print  |  share  |  click to rate (rated 4 times):
  • BlinkList
  • Del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Newsvine
  • Reddit
  • Sphinn
  • Technorati
  • Twitter

What is the difference between CBR and VBR encoding?

Constant bit rate (CBR) encoding persists the set data rate to your setting over the whole video clip. Use CBR only if your clip contains a similar motion level across the entire duration.  CBR is most commonly used for streaming video content using the Flash Media Server (rtmp)
 
Variable bit rate (VBR) encoding adjusts the data rate
 More -->
Constant bit rate (CBR) encoding persists the set data rate to your setting over the whole video clip. Use CBR only if your clip contains a similar motion level across the entire duration.  CBR is most commonly used for streaming video content using the Flash Media Server (rtmp)
 
Variable bit rate (VBR) encoding adjusts the data rate down and to the upper limit you set, based on the data required by the compressor. VBR takes longer to encode but produces the most favorable results.  VBR is most commonly used for http delivery if video content (http progressive)
<-- Hide
tools: email  |  print  |  share  |  click to rate (rated 22 times):
  • BlinkList
  • Del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Newsvine
  • Reddit
  • Sphinn
  • Technorati
  • Twitter

How do I use CBR instead of VBR in your platform?

Occasionally compression requirements dictate that you use a Constant Bit Rate (CBR) instead of a Variable Bit Rate (VBR). This is especially helpful for video streaming.  In our encoding platform, VBR is the default setting for Encoding.com since it generally provides much higher quality. For scenes where there is a high amount of action or detail, VBR will

 More -->

Occasionally compression requirements dictate that you use a Constant Bit Rate (CBR) instead of a Variable Bit Rate (VBR). This is especially helpful for video streaming.  In our encoding platform, VBR is the default setting for Encoding.com since it generally provides much higher quality. For scenes where there is a high amount of action or detail, VBR will often spike up to 300% of the target bitrate. The reverse is also true, VBR will dramatically pull back on scenes with low detail.

Why would you use CBR?

CBR is far more constrained, with the actual bitrate only floating about 20% above and below the target. Some video playback devices have cheaper "chips", hardware decoders with limited buffer that are unable to handle VBR. With MPEG-4 being built into most modern chipsets, this issue is largely going away. CBR is also often used in satellite television broadcasts, where many channels will be multiplexed into one transport stream with limited bandwidth.

Sample API tags for CBR:

<format>
<cbr>yes</cbr>
<bitrate>768k</bitrate>
</format>

 

 

If you wish to check your encodes, Winhoros Bitrate Viewer is a great way to scan your files and quickly get detailed bitrate information.

Winhoros Screenshot

If you are having problems getting the bitrate you need, try using a lower value in the bitrate tag. If that doesn't work, please submit a support ticket with the Media ID # of the job.

<-- Hide
tools: email  |  print  |  share  |  click to rate (rated 1 time):
  • BlinkList
  • Del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Newsvine
  • Reddit
  • Sphinn
  • Technorati
  • Twitter

Understanding bitrates in video files

We often field questions from customers about how the bitrate relates to both quality and the total size of the file. This can confusing to people new to encoding, so I'll try to cover the key points here. Generally the higher the bitrate the higher the image quality of the video output. Modern codecs like H.264 will look noticeably better

 More -->

We often field questions from customers about how the bitrate relates to both quality and the total size of the file. This can confusing to people new to encoding, so I'll try to cover the key points here. Generally the higher the bitrate the higher the image quality of the video output. Modern codecs like H.264 will look noticeably better at the same bitrate vs. older codecs like H.263, and variable bitrate (VBR) will look better than constant bitrate (CBR) in most applications. Keep in mind, there are 8 bits in a byte. So 1 megabyte per second would be 8 megabits per second (mbps). For reference, HD Blu-ray video is generally around 20mbps, standard definition DVD around 6mbps, high-quality web video about 2 mbps, and video for phones in the kilobit range (kbps). Here is the math from testing VP6 output for a video with a duration of 93 seconds: On2 Flix VP6 = 2,080 kbytes x 8 = 16,640 kbits / 93 secs = 179 kbits/sec ffmpeg VP6 = 3,051 kbytes x 8 = 24,408 kbits / 93 secs = 262 kbits/sec But for everyday use, there are a few different tools for detecting bitrate and codecs: MediaInfo is a nice basic tool for quickly seeing all the stats on a video file. http://mediainfo.sourceforge.net/en For MacOS, you can use the Inspector window in QuickTime Player. I strongly recommend having the Perian codec pack to read non-native codecs. http://www.perian.org/ For analyzing Blu-ray Discs, see BDInfo for Windows http://www.cinemasquid.com/blu-ray/tools/bdinfo/

<-- Hide
tools: email  |  print  |  share  |  click to rate (rated 5 times):
  • BlinkList
  • Del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Newsvine
  • Reddit
  • Sphinn
  • Technorati
  • Twitter

Suggestions for improving quality with H.264 settings

Since users often will be uploading a wide variety of videos, I generally like to break them down into two types:

Static/Low Action - stable tripod shots, very little background movement, actors standing still 
Active/High Action - panning/jerky camera, lots of action, sports-like movement

A good starting point is to choose a variable bitrate setting equal

 More -->

Since users often will be uploading a wide variety of videos, I generally like to break them down into two types:

Static/Low Action - stable tripod shots, very little background movement, actors standing still 
Active/High Action - panning/jerky camera, lots of action, sports-like movement

A good starting point is to choose a variable bitrate setting equal to the width of the video. So, for example: 640x480 SD at 640 kilobits per sec (kbps), or 1280x720 HD at 1280 kbps. Higher action video may require a slightly higher bitrate to prevent blocking artifacts.

Noise Reduction

Applying some noise reduction is useful to save bits for high detail regions, but be careful not to overdo it. I've seen video samples where whole areas of ocean and grassy fields disappear to achieve a lower bitrate. This of course, falls under artistic preference, but generally I'd rather see a smaller framesize and more detail. At low bitrates, it is increasing important to improve the quality of noisy video sources, such as film containing lots of grain or video shot in low light. The 3D noise reduction in ffmpeg allows control over both luma and chroma values for fine-tuning your output image quality.

	<noise_reduction>4:3:6</noise_reduction> 

luma_spatial – Spatial Luma Strength. Allowed values: [0,255]
chroma_spatial – Spatial Chroma Strength. Allowed values: [0,255]
luma_temp – Temporal Luma Strength. Allowed values: [0,255]

General recommended starting value is 4:3:6. [luma_spatial:chroma_spatial:luma_temp] Noise reduction is also available via our web interface as the High Quality 3D Denoiser option.

 

Single Pass vs. Two Pass

For most purposes 2-pass encoding achieves very good results. It's a tradeoff of diminishing returns, 2-pass gaining perhaps 10% quality bit-for-bit but doubling the encoding time. Do not lower qcomp, CBR is horrible on quality. I'd experiment with values floating between 0.60 and 0.80 if you want more VBR. if qcomp = 1.00 then quantizer is constant for second pass. Real variable bitrate with constant quality. if qcomp = 0.00 then bitrate is constant for second pass. Real constant bitrate with variable quality.

<two_pass>yes</two_pass>

I'd recommend having two sample videos, tell your users to choose Low or High Action content setting, experiment a bit with your B-frames then define two "baseline" settings for each bitrate. For web video it's best to narrow your targets to four different bitrates at most, especially if you are going to be processing thousands of users uploading. Most folks have a slow (up to 240kbits), good (~700kbits), or fast (2mbits and higher) connection. I'd say H.264 over 2mbits is generally overkill for website content. For general purposes, I'd recommend 2-pass and we push a 10 second keyframe interval (300 frames) which may not be appropriate for "high-action" source video.

For more detail on H.264 controls for scenecut thresholds, B-frames, and more, please refer to:

Advanced H.264 Guide http://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping

H.264 parameters for our API http://www.encoding.com/help/article/advanced_configuration_options_for_the_libx264_video_codec

An excellent collection of HD videos at 2mbits/sec can be found at http://californiaisaplace.com/cali/ 

 

16x16 Macroblocks

H.264/AVC does a much more efficient job when the horizontal and vertical framesize dimensions are multiples of 16. Good examples include:

SD (4:3) aspect ratios: 320x240, 432x320, 480x360, 544x400, 640x480, 768x576
HD (16:9) aspect ratios: 432x240, 576x320, 640x360, 720x400, 848x480, 1024x576, 1280x720, 1920x1080

In 4:2:0 H.264/AVC coding, each block contains 4 luminance samples (Y), 1 blue sample (Cb), and 1 red sample (Cr). Modern video decoding chips (GPUs) are optimized for playback of 16x16 macroblocking.

 

Keyframes and GOPs

Low action scenes generally handle more bidirectional (B-frames) better since they don't have to track interframe motion as aggressively. Higher action content will require more keyframes (I-frames) to keep the picture from breaking apart. Longer GOPs with more B-frames also require more buffering by the playback GPU to recursively track the motion for each macroblock. Fortunately, x264 offers very good scene detection, which is why for most applications, we set keyframes to 300.

H.264/AVC sample for modern mobiles (30 fps with a 10 second GOP)

	<framerate>30</framerate>
	<keyframe>300</keyframe>

For older computers, and early generations of iPod and Blackberry phones, the chips might not have enough processing power and memory to successfully buffer longer GOPs. Keep your bitrates low, try lower framerates, and shorter GOPs.

H.264/AVC sample for older mobiles (15 fps with a 4 second GOP)

	<framerate>15</framerate>
	<keyframe>60</keyframe>

More information about GOPs available on wiki http://en.wikipedia.org/wiki/Group_of_pictures

 

Turbo Mode

NOTE: For bigger or longer HD encoding jobs, turbo mode is absolutely recommended since you will see speed gains in the neighborhood of 3x faster vs. normal mode. Please be aware turbo is running on more powerful encoders, so it costs an extra $1 per gigabyte.

<turbo>yes</turbo>

 

<-- Hide
tools: email  |  print  |  share  |  click to rate (rated 8 times):
  • BlinkList
  • Del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Newsvine
  • Reddit
  • Sphinn
  • Technorati
  • Twitter

How do I determine the optimal bitrate for my video?

The optimal bitrate for your video depends many factors including your source video dimensions, type of video/audio codec, framerate, and delivery method. We love the following calculator on Adobe's site written by Robert Reinhardt: http://www.adobe.com/devnet/flash/apps/flv_bitrate_calculator/index.html
The optimal bitrate for your video depends many factors including your source video dimensions, type of video/audio codec, framerate, and delivery method. We love the following calculator on Adobe's site written by Robert Reinhardt: http://www.adobe.com/devnet/flash/apps/flv_bitrate_calculator/index.html <-- Hide
tools: email  |  print  |  share  |  click to rate (rated 2 times):
  • BlinkList
  • Del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Newsvine
  • Reddit
  • Sphinn
  • Technorati
  • Twitter

What audio bitrate (kbps) value should I use and how will it increase file size and quality?

In most cases you can use the default audio bitrate of 64k. If you need quality stereo sound, use 128k or 192k. For home DVD systems use up to 320k, assuming that your source video has appropriate audio quality. Bit rate/filesize mapping is simple. The size of the audio stream is the audio bitrate multiplied by the duration and divided

 More -->

In most cases you can use the default audio bitrate of 64k. If you need quality stereo sound, use 128k or 192k. For home DVD systems use up to 320k, assuming that your source video has appropriate audio quality. Bit rate/filesize mapping is simple. The size of the audio stream is the audio bitrate multiplied by the duration and divided by 8: size (bytes) = bitrate (bps) * duration (sec) / 8 .

<-- Hide
tools: email  |  print  |  share  |  click to rate (rated 10 times):
  • BlinkList
  • Del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Newsvine
  • Reddit
  • Sphinn
  • Technorati
  • Twitter