Skip to content

Comment on Ogg Theora, H.264 and the HTML 5 Browser Squabble

Comments

Amazing; the very first sentence in the article is factually incorrect:

Pundits are roasting Apple over a scuffle raised by Mozilla and Opera to define the free Ogg Theora video codec as the official way to present video on the web in the new HTML 5 specification.

There was never any attempt to define Theora as the "official way to present video". It was merely provided as a baseline, a lowest-common-denominator format that could be relied upon by content providers.

Ogg Theora is based upon VP3 video technology originally proprietary to On2, and subsequently abandoned after it became obsolete.

Theora is not obsolete; it is superior to most popular codecs, such as XVid, WMV, and QuickTime. In standard-definition encoding, it's even superior to modern proprietary codecs such as H.264:

http://people.xiph.org/~greg/video/ytcompare/comparison.html

http://people.xiph.org/~maikmerten/youtube/

Apple has also voiced concerns that Ogg Theora may be encumbered by unknown patents. That risk isn't significant to Mozilla and Opera, both of whom could simply abandon the format for something else [...] Apple also has a bankroll to attract patent trolls that Mozilla and Opera both lack.

This hand-waving ignores that Google will also be supporting Theora, and undoubtedly has deeper pockets than Apple. Besides, a risk of unknown patents applies to any video codec. There's no technical or legal reason to exclude Theora support.

Theora is not obsolete; it is superior to most popular codecs, such as XVid, WMV, and QuickTime. In standard-definition encoding, it's even superior to modern proprietary codecs such as H.264:

Are you seriously this misinformed?

1. Quicktime isn't a "codec", it's a video player. There is no "Quicktime codec".

2. H.264 isn't proprietary.

3. Theora is roughly between MPEG-2 and MPEG-4 SP in potential efficiency; it's nowhere near VC-1 or H.264. Right now it's worse than MPEG-2 because the encoder is so bad, but Thusnelda is working on fixing that. The eventual goal is to become on par with FLV1 and similar formats; reaching more modern levels of compression will require a spec revision.

The purpose of Theora is to provide a patent-free video format, not to be the best out there in compression, since the two goals are basically contradictory. Spreading lies like these are a great way to completely ruin any chance of Theora's adoption, because expectations will be set so high that the Theora developers will never be able to realistically reach them. This is a disservice to Xiph in every way.

Despite the fact that the Theora specification is terrible and even their own developers admit it, they have one thing going their way: the quality of an encoder is far more important than the format itself. In other words, a really good MPEG-2 encoder can give better output than a really bad H.264 encoder, for example. A classic example of this is Quicktime's H.264 encoder, which is so bad that it is widely used across the industry as a marketing tool by competing encoder developers to demonstrate how good theirs is by comparison.

As such, it is possible for Theora to beat some of the lower-end H.264 encoders if they really work hard at it, even if H.264 as a whole is vastly better than Theora. This is why Thusnelda is a big deal for Theora.

This is also why it's such a problem that people consider "H.264" or "MPEG-2" or "JPEG" to be single entities; the compression quality can vary massively between different encoders. That's why I always cringe when someone posts, for example, an "H.264 vs Theora" comparison; they're really doing an "X H.264 encoder vs Thusnelda" comparison and generalizing it far beyond its meaning.

Quicktime isn't a "codec", it's a video player.

What codec is used for .MOV files, then? As far as I know they can only be en/decoded by Quicktime.

H.264 isn't proprietary.

Cool -- so if I start distributing H.264 videos without paying the appropriate licensing fees, there wouldn't be any trouble, right? And there's an encoder/decoder that I can install legally?

Last I checked, the answer to both of those is "no".

Theora is roughly between MPEG-2 and MPEG-4 SP in potential efficiency; it's nowhere near VC-1 or H.264. Right now it's worse than MPEG-2 because the encoder is so bad, but Thusnelda is working on fixing that. The eventual goal is to become on par with FLV1 and similar formats; reaching more modern levels of compression will require a spec revision.

Obviously you've not used Theora for months or years. It is significantly better than MPEG-4 SP, and on par with H.264 for standard-def video.

What codec is used for .MOV files, then? As far as I know they can only be en/decoded by Quicktime.

MOV files have used dozens of different video and audio formats over the years. Currently, the most common is H.264 video and AAC audio, and they can in fact be played by nearly everything, mainly because the MOV format is basically the same as MP4. You might have to remux the file though, as there are some subtle differences between MOV and MP4. Yes, this is yet another reason to hate Apple.

Cool -- so if I start distributing H.264 videos without paying the appropriate licensing fees, there wouldn't be any trouble, right? And there's an encoder/decoder that I can install legally?

"Proprietary" has a very specific meaning in the multimedia format world; it revers to formats like Real Video, VP6, and so forth which are completely closed. In other words, there is no public specification, nobody can implement an encoder or decoder without reverse-engineering it. If you want something to describe H.264, say "patent-encumbered" or similar; don't misuse words with a specific meaning.

Obviously you've not used Theora for months or years. It is significantly better than MPEG-4 SP, and on par with H.264 for standard-def video.

I've read the spec. Here's the basic summary:

1. Prediction. DC/AC coefficient prediction is somewhat similar to MPEG-4 Part 2. Intra prediction is similar, as is motion compensation, which is basically the same as MPEG-2/4 halfpel except that the center position averages between the diagonals instead of all four neighbors, which is slightly lower quality but much faster (a smart decision, H.264 does the same for qpel). 4MV mode is supported in the same way as in MPEG-4 SP.

2. Transform is basically the same as MPEG-2/4, though it's bit-exact like VC-1's and H.264's in order to avoid decoders disagreeing on the correct output. It's slightly slower though because of how On2 originally designed it.

3. Entropy coder is bizarre but not too terrible; it should probably give results similar to MPEG-4 SP's entropy coder, though I can't be entirely sure just because of how weird it is. Speed-wise the entropy coder is a real problem, especially for hardware implementations. The reason for this is because every single data element is coded in a massive bitplane, requiring that the entire frame be decoded before a single inverse transform is done. This requires a cache larger than the decoded size of the frame itself, as DCT coefficients are stored in 16-bit precision as opposed to the 8-bit precision of the actual pixels. It's probably fine compression-wise though.

That's for residual coefficients though; the primary problem in terms of compression with Theora is the motion vector coding...

3a. Motion vectors can be coded in three modes: "use the previous vector", "use the previous previous vector", or "write an entirely new vector". The last mode requires writing 12 bits of raw data with no compression; X and Y vector components. The problem with this is twofold. First of all, it means you can't have motion vectors longer than 16 pixels, which is crippling for high resolutions. Second, it means the motion vector coding is actually worse than H.261 (the original standardized video format from 1988); Theora probably loses at least 10-30% compression solely because of this. It would in fact simplify the specification to fix this, which is why many have been pushing to revise the spec and release a "Theora 2".

"What codec is used for .MOV files, then? As far as I know they can only be en/decoded by Quicktime."

.mov is a container format. It can potentially contain any of many different actual types of encoded media.

I agree that the complaining about Theora's quality is blown of of proportion by people who don't know any better. Theora is definitely better than low-definition FLV files as streamed by YouTube and better than MPEG-2. But can you really claim it is better than H.264? I don't see many differences in the Theora vs H.264 images on the comparison page, but I can clearly see the differences in the actual videos. H.264 is better than Theora, although not by too much.

I'm more curious about how Theora compares to XviD/DivX, which is (was?) the standard in the video encoding community. But so far I haven't seen any comparisons.

I don't know how to help if you can't tell the difference between the examples at < http://people.xiph.org/~greg/video/ytcompare/comparison.html >. The H.264 examples are significantly blurrier than the Theora versions.

Theora is slightly better than XviD, which is much better than DivX. They are still the standard as far as I know, though being supplanted by H.264 encoders for high-end use.

"In standard-definition encoding, it's even superior to modern proprietary codecs such as H.264"

That's arguably true in some senses, but not in the way most people will take it and it's not really backed up by your link.

Theora only needs one qualification, being in the clear with respect to patents. If Apple's lawyers don't find anything (and it's an interesting question as to whether Apple would be pleased if they did) then there's still a chance Apple will support it.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.