Biz & IT —

Ogg Theora vs. H.264: head to head comparisons

A streaming video consultant has conducted a hands-on comparison of Ogg Theora …

Streaming video websites like YouTube face growing pressure from consumers to provide support for native standards-based Web video playback. The HTML5 video element provides the necessary functionality to build robust Web media players without having to depend on proprietary plugins, but the browser vendors have not been able to build a consensus around a video codec.

Although the h264 codec has gained dominance due to its excellent compression and broad support in the consumer electronics ecosystem, it is covered by patents that preclude broad royalty-free usage. Several browser vendors, including Opera and Mozilla, favor the Ogg Theora media codec, which is believed to be unencumbered by patents. Ogg may offer advantages from a licensing standpoint, but there are still many unanswered questions about its quality and suitability for Internet video streaming services.

Streaming media consultant Jan Ozer conducted a hands-on comparison of Ogg and h264 in order to shed some light on the relative difference in encoding quality and performance. He has published the results of his comparison, including screen captures and sample clips, in a report at the Streaming Learning Center.

In the videos and still images that he provides for comparison purposes, the h264 content has better color quality and higher detail than the Ogg Theora content. Comparing 468 kbps clips, one can detect a very noticeable difference in quality between the two codecs. Even the 1mbps Ogg Theora clips are not on par with the 468 kbps h264 clips. Based on the results, Ozer concludes that h264 will have the upper hand in many Internet streaming scenarios.

Image credit: Streaming Learning Center; click image for full-size

"These tests are very aggressive, but purposefully so—at very high data rates, all codecs look good. In particular, YouTube encodes their H.264 video at 2mbps, about 2.5X higher than my tests. So my conclusion isn't that Ogg is a bad codec; it's that producers seeking the optimal balance between data rate and quality will find H.264 superior," he wrote.

Indeed, the outcome of such tests generally seems to differ depending on the nature of the source material and the target bitrate. Last year, Xiph's Greg Maxwell conducted a test that focused on comparing Ogg Theora clips against h264 videos on YouTube. Based on a comparison that is specific to the encoding parameters and bitrate used by YouTube, Maxwell found that Ogg Theora was competitive.

"It can be difficult to compare video at low bitrates, and even YouTube's higher bitrate option is not high enough to achieve good quality. The primary challenge is that all files at these rates will have problems, so the reviewer is often forced to decide which of two entirely distinct flaws is worse. Sometimes people come to different conclusions," Maxwell wrote.

These comparisons provide a lot of insight into the relative adequacy of Ogg Theora, but it's still unclear if Theora is suitable in all of the settings where the HTML5 video element will be used. There is hope that Google, which recently acquired video compression technology company On2, will end the HTML5 video codec debate by opening up On2's high-performance VP8 video codec.

In an open letter to Google that was published last week, the Free Software Foundation urges the search giant to liberate the Web from proprietary video plugins by making the underlying technology behind VP8 available perpetually under royalty-free terms.

"With your purchase of On2, you now own both the world's largest video site (YouTube) and all the patents behind a new high performance video codec—VP8," the letter says. "Just think what you can achieve by releasing the VP8 codec under an irrevocable royalty-free license and pushing it out to users on YouTube? You can end the web's dependence on patent-encumbered video formats and proprietary software (Flash)."

Some streaming video experts, including Ozer, are not convinced that royalty-free VP8 will solve all of the problems that the industry is facing with standards-based video. He contends that the cost of reencoding existing content will make it difficult for streaming content providers to adopt alternatives to h264 at this stage regardless of whether the alternative is royalty-free.

Streaming video is an increasingly important part of the Web experience and the need for an unencumbered codec that can be freely redistributed seems clear relatively clear, regardless of the technical challenges associated with reencoding existing content. Comparisons seem to indicate that Theora still has catching up to do, but Google has the power to deliver a viable alternative if it decides to open VP8.

Update: Much like benchmarking, there a lot of different opinions about the best way to do video encoding quality tests. Some of the specific parameters that Ozer used for encoding may have negatively impacted the Theora results. Maxwell has commented here with some additional details. You can find another recent comparison of Ogg and h264 here.

Channel Ars Technica