VP8 (WebM) vs H.264 (MP4) – August 2010

So, while I was making a chart for WebM and H.264 bitrates everyone should use when encoding acceptably high-quality videos for the web, I ended up obviously needing to compare the codecs.

With various tests, I concluded that both codecs are approximately equal, except one is superior in the end. Therefore, I can use two sets of identical bitrates for the same H.264/WebM media. Read on to find out.

In this test, we will be comparing H.264, also commonly known as AVC, with VP8, more renown for its web oriented container called WebM, an MKV (Matroska) based open source file format for streaming videos.

The video featured here is a downconversion of a 1080p HD YouTube video of California Gurls by Katy Perry. For legal reasons, the full video will not be posted here but only screenshots of the results. To watch the full video, you can go on YouTube instead: http://www.youtube.com/watch?v=CwE-SLnLkqY

Each sample was encoded in 960 by 540 pixels at the original frame rate in dual-pass at 1.8 Mb/s. Both samples were encoded with XMedia Recode.

The VP8 sample was encoded with the inclusion of Trellis. No other options had to be specified for the codec.

The H.264 sample was encoded with the default settings of the Baseline Profile. The H.264 specification possesses various “profiles” of encoding for different situations, among which the most common are Baseline, Main and High.

Some profiles, such as High Profile, use increased complexity in order to achieve more efficient coding. Such use is in Blu-ray movies, where the video quality is of utmost importance.

On the other hand, the Baseline Profile is used on the web for its simplicity. Because it is less complex, a larger audience can play back the video. Baseline Profile is also much faster to encode, making it ideal for massive encoding operations such as YouTube. However, Baseline profile is the lesser efficient of the H.264 profiles, so many High Profile encoded videos greatly surpass the quality of a Baseline Profile encode at the same bitrate.

VP8 has supposedly been optimized for web streaming, so it goes accordingly to test it against the Baseline Profile of H.264.

The Results

As you will be able to observe in the following screenshots, the H.264 sample remains superior to the VP8 sample. Both are not without flaws, but at such low bitrate, it is very impressive compared to the likes of DivX, a once popular video codec, Theora, VP8′s ancestor, and Mpeg 2, the codec used in DVDs.

However, both remain close enough that it is safe to assume VP8 could potentially get ahead after the encoders have been optimized. The codec is still young so there is still some place for amelioration. They’re also close enough to assume the same bitrate for both VP8 and H.264 videos yields approximately the same quality.

It’s important to note however that High Profile H.264 is by comparison very ahead of its Baseline cousin, so VP8 may never surpass it.

CPU Usage

While we are comparing VP8 against a Baseline Profile H.264, it is important to note High Profile is significantly more complex to decode. Therefore, to be fair, the competing H.264 encode should use approximately the same CPU resources.

I have thus observed how VLC, the best VP8 player to date, performs on all samples, including the original. The CPU usage is observed at the moment of the scene used for the comparison.

Original: 35%
VP8: 22%
H.264: 18%

As you can see, no single video uses more than a single CPU core from my dual core computer. Considering this is a fairly common processor, a 1.8 Ghz Core 2 Duo, it means most people should be able to read this video with little problem.

The reality of browser based playback is different however, with or without Flash, with really bad performance for the moment, but hopefully this will get fixed in the future.

5 thoughts on “VP8 (WebM) vs H.264 (MP4) – August 2010

  1. I think so Ivan. I’ll have to do more tests to have a definite conclusion on this. But in theory, yes, WebM and VP8 have gotten better.

  2. Observing CPU usage at a point is a very inaccurate way to gauge requirements. There are programs under windows that can do it right, but nothing built-in. Under linux, you can just use the ‘time’ command when invoking the playback.

    WebM is improving, but remember h264 has had a a long head start. From what I’ve read by those more knowledgeable than myself, there is nothing in the bitstream format that would give either one a decisive advantage – it just comes down to which has the most finely-tuned and polished encoder.

  3. Yes, I realize this. In fact, in my oft-postponed revision of this test, I have been using CPU time to measure encoder performance and decoder performance.

    Of course, there is a difference, both since both are from the standard FFMPEG stack, it’s fair to say they’re fairly comparable. Then again, none of this matters once you’ve got a DSP doing the decoding.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>