prev/next

File Size

What response will concatenated videos return on GetMediaInfo?

Have you recently joined two videos together using our concatenation function? GetMediaInfo will return the details on each source, as below. Each format will be returned back to you in the order submitted.

Request:

<?xml version="1.0"?>
<query>
<userid>####</userid>
<userkey>####</userkey>
<mediaid>11084840</mediaid>
<action>GetMediaInfo</action>
</query>

Response:

<response>
<source>
<bitrate>2153k</bitrate>
<duration>23.82</duration>
<audio_duration>23.825</audio_duration>
<video_duration>23.825</video_duration>
<video_codec>h264 (High)</video_codec>
<size>1280x720</size>
<video_bitrate>2009k</video_bitrate>
<pixel_aspect_ratio>1:1</pixel_aspect_ratio>
<display_aspect_ratio>16:9</display_aspect_ratio>
<audio_codec>aac</audio_codec>
<audio_sample_rate>44100</audio_sample_rate>
<audio_channels>2</audio_channels>
<frame_rate>23.97</frame_rate>
</source>
<source>
<bitrate>1403k</bitrate>
<duration>98.32</duration>
<audio_duration>98</audio_duration>
<video_duration>98</video_duration>
<video_codec>msmpeg4 (DIV3 / 0x33564944)</video_codec>
<size>640x368</size>
<video_bitrate>1301k</video_bitrate>
<audio_codec>mp3</audio_codec>
<audio_sample_rate>44100</audio_sample_rate>
<audio_channels>2</audio_channels>
<frame_rate>25</frame_rate>
</source>
</response>

Have you recently joined two videos together using our concatenation function? GetMediaInfo will return the details on each source, as below. Each format will be returned back to you in the order submitted.

Request:

<?xml version="1.0"?>
<query>
<userid>####</userid>
<userkey>####</userkey>
<mediaid>11084840</mediaid>
<action>GetMediaInfo</action>
</query>

Response:

<response>
<source>
<bitrate>2153k</bitrate>
<duration>23.82</duration>
<audio_duration>23.825</audio_duration>
<video_duration>23.825</video_duration>
<video_codec>h264 (High)</video_codec>
<size>1280x720</size>
<video_bitrate>2009k</video_bitrate>
<pixel_aspect_ratio>1:1</pixel_aspect_ratio>
<display_aspect_ratio>16:9</display_aspect_ratio>
<audio_codec>aac</audio_codec>
<audio_sample_rate>44100</audio_sample_rate>
<audio_channels>2</audio_channels>
<frame_rate>23.97</frame_rate>
</source>
<source>
<bitrate>1403k</bitrate>
<duration>98.32</duration>
<audio_duration>98</audio_duration>
<video_duration>98</video_duration>
<video_codec>msmpeg4 (DIV3 / 0x33564944)</video_codec>
<size>640x368</size>
<video_bitrate>1301k</video_bitrate>
<audio_codec>mp3</audio_codec>
<audio_sample_rate>44100</audio_sample_rate>
<audio_channels>2</audio_channels>
<frame_rate>25</frame_rate>
</source>
</response>
<-- 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

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 2 times):
  • 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 7 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 10 times):
  • BlinkList
  • Del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Newsvine
  • Reddit
  • Sphinn
  • Technorati
  • Twitter

How are my videos being encoded if only part of the video size was specified in the request?

When you specify the encoded video size to be 320x0, the resulting width is calculated based on the source aspect ratio. You will need to know what the exact frame size of your resulting video in order to enter the parameters you wish to keep. First, you can find out the source media aspect ratio. Just send a GetMediaInfo API  More -->
When you specify the encoded video size to be 320x0, the resulting width is calculated based on the source aspect ratio. You will need to know what the exact frame size of your resulting video in order to enter the parameters you wish to keep. First, you can find out the source media aspect ratio. Just send a GetMediaInfo API request, and locate property. If it is not present, just calculate the ratio from the frame size ( property) dividing width by height. Let's now calculate result frame height. Divide the resulting width by the obtained ratio, round it to nearest integer, and then, if it is not even, add 1. For example if source ratio is 1.333 (4:3). 320/1.333 = 240.06 In this case, the height will be 240. For the source ratio 1.777 (16:9): 320/1.777 = 180.07. Therefore, the height will be 180. <-- 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

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 11 times):
  • BlinkList
  • Del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Newsvine
  • Reddit
  • Sphinn
  • Technorati
  • Twitter

What are the best Flash video frame dimensions?

Video codecs perform best when the frame width and height use multiples of 16. While you can use any width and height in your encoding settings, non-optimal dimensions can result in poor image quality and reduced frame rate. For the best image quality and playback, you should always use width and height dimensions that use a multiple of 16 (best),

 More -->

Video codecs perform best when the frame width and height use multiples of 16. While you can use any width and height in your encoding settings, non-optimal dimensions can result in poor image quality and reduced frame rate. For the best image quality and playback, you should always use width and height dimensions that use a multiple of 16 (best), 8 (better), or 4 (good). We would recommend that you refrain from using 4 or 8 multiples unless it is absolutely necessary. 

Note: Both the native encoding dimensions and the playback dimensions should be a multiple of 16. For example, if you encode your FLV file to use a frame dimension of 320 x 240, you should scale to a size such as 512 x 384. 

Refer to the following tables to pick dimensions for your layout.

4:3 aspect ratio sizes:

Best (16)Better (8)Good (4)
640 x 480608 x 456624 x 468
576 x 432544 x 408592 x 444
512 x 384480 x 360560 x 420
448 x 336416 x 312528 x 396
384 x 288352 x 264496 x 372
320 x 240288 x 216464 x 348
256 x 192224 x 168432 x 324
192 x 144160 x 120400 x 300
128 x 96 368 x 276
  336 x 252
  304 x 228
  272 x 204
  240 x 180
  208 x 156
  176 x 132
  144 x 108
  112 x 84

     

16:9 aspect ratio sizes:

Best (16)Better (8)Good (4)
1280 x 7201152 x 6481216 x 684
1024 x 576896 x 5041088 x 612
768 x 432640 x 360960 x 540
512 x 288384 x 216832 x 468
256 x 144128 x 72704 x 396
  576 x 324
  448 x 252
  320 x 180
  192 x 108

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