Thursday, May 20, 2010

Google releases VP8 and WebM

Google has released the VP-8 codec and WebM format for use royalty-free. This has the potential to trigger a major change in the online video world. The VP-8 codec is significantly better than the best previous free codec Ogg Theora, and is competitive with, and in at least some cases better than h.264 for web content. If the encoders for VP-8 support the full option set that VP8 is capable of (which is a superset of the VP6 flash options available with Sorenson Squeeze and Rhozet Carbon Coder), VP8 has the potential of improving video quality on the web.

Here are some things that may help VP8 adoption:
  • h.264 has known patents that may in the future require royalties for playback.
  • VP8 can look better at current web video playback rates.
  • HTML5 video has just begun being used. It is relatively easy to add another supported codec now.
  • HTML5 video support is currently split between browsers that support h.264 for quality reasons, and browsers that only support Ogg Theora due to justified worries about known patents on h.264 - no guarantees have been given that playback software will not need to pay royalties in 6 years. Since VP8 is of similar quality as h.264 and similar royalty-free status as Ogg Theora, it might become the only codec supported by all browsers


  • Here are some things that may hinder VP8 adoption:
  • h.264 currently has hardware acceleration on a lot of mobile devices.
  • h.264 already looks pretty good on the web (the good is the enemy of the best).
  • Much of the video on the web just transitioned from Flash Video to h.264. The video providers may decide against another transition this soon.
  • Many of the compression tools out there, including high-end ones, never offered the full range of VP6 options, limiting the quality of Flash video produced by those tools. If they similarly limit the VP8 options, VP8 may be perceived as being of lower quality due to the low quality produced by those tools.
  • The average available bandwidth for video playback on the web keeps going up. At higher bandwidths, VP8 may not have the same quality advantages.



  • Google has released patches that add VP8 encoding into ffmpeg - this makes encoding VP8 possible at low cost.

    We are living in interesting times in the online video world - in the past 5 years, online video has gone from postage-stamp size video to high-definition content, the costs of delivering the video have gone from exorbitant to affordable, the amount of content has skyrocketed, and in the past 2 years most content has moved from Flash to h.264.
    Now we must ask ourselves, will online video stop at h.264 or move to VP8? If it stops at h.264 now, will the patent holders ask for playback royalties in 5-6 years (remember the GIF Patent)? If they ask for playback royalties in the future, will online video switch over to VP8 then or will browsers and users pay the royalties?

    Tuesday, February 23, 2010

    Compression software types

    Compression software falls into roughly 4 groups based on the intended users.

    Type 1 - This is the 'we do it all for you' software. This type usually costs between $20 and $100. With this type of software, all you usually set is bitrate, output size, path and filename. This type of software is sold (often for a very low price) to people who don't want to know anything about compression. There is little incentive for the authors to optimize quality, so quality generally suffers. This type of software generally uses cheaper, lower quality codecs. Since there are so few options, this type of software is generally very easy to use.

    Type 2 - This type is a step up from Type 1. This type usually costs between $50 and $200. This type gives you some settings like 2 pass encoding, CBR/VBR encoding, and so forth, but doesn't give you a lot of settings. This type of software is aimed at people who have to deliver compressed output, but who don't compress as a primary task (video editors, producers, and so forth), but who care somewhat about quality and file size. The quality of this type of software is generally better than Type 1, but cannot be tweaked very much. Any presets provided are generally fairly good. This type of software generally uses moderately priced, good quality codecs. Ease of use is still an important selling point, so this type is generally fairly easy to use. Adobe Media Encoder and Compressor fall into this type.

    Type 3 - This type is the software generally used by compression experts. This type usually costs between $200 and $1,000. This type gives you a lot of settings for every type of compression, comes with a lot of pretty good presets, and includes functions for related tasks like deinterlacing, reverse telecine, noise reduction, batch processing, etc. Since output quality is the primary selling point of this type of software, you can get very high quality. This type of software generally uses higher priced, very good quality codecs, and may offer a choice of codecs for the same output format. On the flip side, since there are so many options, and since ease of use is at best secondary, this type of software is generally hard to use, although there are exceptions. Telestream Episode and Sorenson Squeeze are this type.

    Type 4 - This is the 'we give you enough rope to hang yourself' type. This type usually costs more than $1,000. This type is usually aimed towards high-volume production companies that need a render farm to output massive quantities of compressed video. You can change any imaginable setting of each supported type of compression, and there are features to support many types of workflow. Since you can adjust all parameters, you can get excellent results if (and only if) you know what to set. This type of software generally offers the best codecs. This type of software is generally designed to be set up by someone who knows a lot about compression, and generally is very hard to use outside of using already set up workflows. Some examples of this type are Rhozet Carbon Coder, Inlet Fathom, and Telestream Flip Factory.

    Note that these are general categories, and not meant to be exclusive. Some software may fall between categories, or may fit into more than one category.

    Of special note is ffmpeg and x264, which fall into type 4 in options, quality and difficulty to use, but is available for free. There are front ends for ffmpeg, which generally fall into types 1 or 2.

    Saturday, January 23, 2010

    Compressing for streaming - Moderate speed broadband

    Video compressed for moderate speed broadband (600 kbps) can look surprisingly good.
    You can use 400kbps for video and 64-96kbps for audio. This permits 480x360 or 640x480 video that looks pretty good. Music sounds good.
    Pauses and other streaming issues will be rare unless the line is shared among multiple users.

    For download video, I recommend 700kbps for video and 96-160kbps for stereo audio. This will allow 640x480 looking excellent or 1280x720 looking OK. Music will sound very good to excellent.

    Friday, January 22, 2010

    Compressing for streaming - Slow broadband

    Compressing for slow broadband (150 kbps or so) is much easier than compressing for dialup.
    You can expect to get halfway decent video and acceptable audio.
    Pauses and other streaming problems will be less common than on dialup.
    I would recommend 100kbps for video and 22kbps for audio.
    this will give you 320x240 video and decent mono audio.


    For download video, I recommend 250 kbps for video and 56kbps for audio.
    This permits 400x300 video and very good mono audio or decent stereo.
    If the audio is speech recorded in stereo, I would recommend stereo. If the audio is primarily music, I would recommend mono audio.

    Tuesday, January 19, 2010

    compression for streaming - dialup users

    Trying to compress video for dialup users is almost impossible. Whatever you do, the quality will be poor. You might even want to avoid trying and just target people with broadband.
    You have almost no bandwidth to use (50 kbps max, and usually less than 40)
    In order to provide even barely acceptable video, you have to encode for the best connections, and assume that the connection will stay above 40 kbps.
    At 40 kbps, you only have 32 kbps for video and 8 kbps for audio.
    In regards to video, this will allow you only 200x150 resolution or lower, and quality will be poor even at that small postage-stamp-like size.
    In regards to audio, you will have to use mono audio, and speech will sound acceptable, but music will suffer.
    With streaming video or progressive download, expect users to suffer from pauses and other streaming problems.

    For download video, you can encode to a higher rate, as the video will not be watched until the download finishes.
    I would recommend 100 kbps for video and 22 kbps for audio. This allows 320x240 resolution video and higher quality mono audio - speech will sound good, and music acceptable.

    Friday, July 3, 2009

    Quality Control for Web Video

    Web video need to balance quality and size - you can't afford the bandwidth to make your video look perfect, so you have to accept some loss in quality. On the other hand, you don't want the loss in quality to be distracting to the viewers of the video.
    When checking quality, you have to look closely at the video, and that can lead to your paying attention to artifacts that won't be noticed by the people watching your video, and possibly missing other artifacts that don't look as bad to you, but which are distracting when actually watching the video.

    My method for identifying problems and knowing when I have fixed them is this:
    First, I watch the compressed video straight through without pausing. I remember what distracts my attention from the video, and take notes.
    I use these notes when working on fixing problems. I concentrate on those areas that distracted me the most. Although I might try to improve other artifacts that I see when working on problems, I make sure these artifacts are visible when playing at full speed.
    When I think I have fixed the problems, I watch the fixed video again without pausing, trying to watch the way the expected audience would. If I don't see any problems watching like this, then the video quality should be acceptable.

    Tuesday, May 12, 2009

    VP6 Maximum Quantizer - the real meaning

    This setting is sometimes called Minimum Quality.

    This limits the amount of difference from the original frame that is allowed. The lower the Max Quantizer (or the higher the Minimum Quality) setting, the closer the compressed frame will be to the original. This will often increase the percieved quality of the video by preventing keyframes from being encoded poorly (which would lead to the video quality dropping for a long period of time).

    This setting will override other settings in the VP6 codec, and can cause the video size to increase substantially, potentially causing the bitrate to go significantly above the target bitrate. To help keep the bitrate from going too high for good streaming, you should lower the target bitrate and increase the variability of VBR encoding when increasing this parameter - doing this will allow the codec to save bandwidth in other areas of the video so the keyframe looks good and the average bitrate stays reasonable.

    When encoding HD video with this setting set for higher quality, you will sometimes get timeouts on the encode leading to every frame being encoded as a keyframe. To avoid this, encode on a fast machine and avoid any bottlenecks during encoding and encode (sample bottlenecks are USB hard drives and running other programs that use the CPU or hard drive.)


    Technical terms - this setting actually controls the maxumum # of the Discrete Cosine Transform coefficients that can be dropped, and has a range from 0 (keep all coefficients) to 64 (allow the codec to discard all coefficients).
    When this setting is called Minimum Quality, the meaning is inverted and the range is 0 (equivalent to 64) to 100 (equivalent to 0)