Comparing Theora to H264

The debate about HTML5 video is for the most part pretty straightforward: we all want HTML5 video, and we all recognise it’s a better approach than Flash for online video. However, there’s one thing we just can’t seem to agree on: the codec. A number of benchmarks have been conducted recently, and they highlight the complexity of video encoding: they go either way.

I won’t claim here that I know anything about encoding video, and what options yield the best possible results. All I can do is rely on the expertise of others, but in doing so, it becomes quite hard to figure out, as a layman, how all these various codecs compare to one another. Let’s look at three (relatively) recent encoding benchmarks.

Jan Ozer from the Streaming Learning Center. Ozer compared the results from Theora (1.1) to H264 at various bitrates, and they show that H264 simply performs better. “These tests are very aggressive, but purposefully so – at very high data rates, all codecs look good,” Ozer argues, “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.”

Ozer readily admits that this is his first foray into Theora encoding, so he asked for input from the community as to how to yield the best results. Xiph’s Greg Maxwell took up on this, and noted that several of the setting employed by Ozer weren’t optimal. “The bigest reason why the 1.1 clips have surprisingly poor quality is because these are stricly buffer constrained encodes,” Maxwell notes, “The buffer constraint means that user with a very bandwidth limited connection can playback without stalls and excessive buffering. So it’s a good thing to have if you’re streaming. But – its absolutely brutal on the quality and it’s not a restriction that your h264 encode has been subjected to.”

Maxwell performed his own benchmarks last year, and he drew two conclusions. First, that Theora is better than H263. No surprise there. Second, that Theora is competitive compared to H264. “In the case of the 499kbit/sec H.264 I believe that under careful comparison many people would prefer the H.264 video,” Maxwell concluded, “However, the difference is not especially great. I expect that most casual users would be unlikely to express a preference or complain about quality if one was substituted for another and I’ve had several people perform a casual comparison of the files and express indifference.”

So, we have two benchmarks going either way. Luckily, we also have a third benchmark, by Martin Fiedler, which places H264 firmly in first place. “The H.264 format proves that it’s the most powerful video compression scheme in existence,” Fiedler writes, “The main competition in the web video field, Ogg Theora, is a big disappointment: I never expected it to play in the same league as x264, but even I didn’t think that it would be worse than even Baseline Profile and that it’s in the same league as the venerable old XviD which doesn’t even have in-loop deblocking.”

To further prove just how incredibly difficult this whole video encoding business is: Maxwell commented on Fiedler’s benchmark, and together they found out that Fiedler was using the wrong Theora branch, which negatively affected Theora’s performance. It turns out that the branching scheme for Theora isn’t particularly intuitive.

All this illustrates two things: first, it takes experts to do this stuff. Video encoding is hard, with all those options and tweaks you can apply – made worse by the different encoders you can choose from. Second, that the people behind Theora need to make it clearer which version or branch produces the optimal results. Of course, this is also an inherent problem with Theora: always the moving target.

In any case, this all overlooks the big, massive advantage that Theora has over H64: it’s unencumbered by patent nonsense. That alone is a massive win for Theora, and something H264 doesn’t have an answer for.

97 Comments

  1. 2010-02-26 1:18 pm
    • 2010-02-26 1:54 pm
      • 2010-02-26 2:22 pm
        • 2010-02-27 7:45 pm
          • 2010-02-27 7:55 pm
          • 2010-02-27 8:05 pm
  2. 2010-02-26 1:28 pm
    • 2010-02-26 2:46 pm
      • 2010-02-26 3:05 pm
        • 2010-02-26 4:19 pm
  3. 2010-02-26 1:37 pm
    • 2010-02-26 4:45 pm
      • 2010-02-26 10:42 pm
        • 2010-02-27 1:58 am
    • 2010-02-28 1:51 pm
  4. 2010-02-26 1:53 pm
  5. 2010-02-26 2:11 pm
    • 2010-02-26 3:13 pm
      • 2010-02-26 3:29 pm
        • 2010-02-26 3:39 pm
          • 2010-02-26 4:36 pm
          • 2010-02-26 5:31 pm
        • 2010-02-26 3:41 pm
          • 2010-02-26 6:27 pm
          • 2010-02-26 8:04 pm
        • 2010-02-26 8:47 pm
          • 2010-02-26 9:03 pm
          • 2010-02-26 10:03 pm
  6. 2010-02-26 2:31 pm
  7. 2010-02-26 2:57 pm
    • 2010-02-26 9:54 pm
  8. 2010-02-26 3:55 pm
    • 2010-02-26 3:59 pm
      • 2010-02-26 4:03 pm
        • 2010-02-26 4:26 pm
        • 2010-02-26 4:47 pm
        • 2010-02-26 5:25 pm
          • 2010-02-26 6:08 pm
        • 2010-02-26 5:52 pm
          • 2010-02-26 6:11 pm
          • 2010-02-26 10:48 pm
          • 2010-02-26 11:59 pm
        • 2010-02-27 1:49 am
    • 2010-02-27 12:45 am
      • 2010-02-27 1:10 am
        • 2010-02-27 4:14 am
          • 2010-02-27 4:31 am
      • 2010-02-28 11:37 am
        • 2010-02-28 7:08 pm
  9. 2010-02-26 4:06 pm
    • 2010-02-26 5:55 pm
      • 2010-02-26 8:34 pm
        • 2010-02-26 8:49 pm
          • 2010-02-28 9:16 am
        • 2010-02-26 11:57 pm
          • 2010-02-27 12:37 am
  10. 2010-02-26 4:30 pm
    • 2010-02-26 8:54 pm
      • 2010-02-26 9:19 pm
  11. 2010-02-26 5:27 pm
    • 2010-02-26 7:16 pm
  12. 2010-02-26 5:40 pm
    • 2010-02-27 7:06 pm
      • 2010-02-28 11:49 pm
        • 2010-03-01 10:30 am
          • 2010-03-01 10:51 am
  13. 2010-02-26 7:19 pm
  14. 2010-02-26 7:49 pm
    • 2010-02-26 7:57 pm
      • 2010-02-26 8:47 pm
      • 2010-02-27 3:23 pm
  15. 2010-02-26 8:48 pm
  16. 2010-02-26 8:56 pm
    • 2010-02-26 9:38 pm
      • 2010-02-26 10:40 pm
        • 2010-02-26 10:58 pm
          • 2010-02-27 1:01 am
  17. 2010-02-26 9:24 pm
  18. 2010-02-26 9:25 pm
    • 2010-02-28 11:49 am
  19. 2010-02-26 9:37 pm
  20. 2010-02-27 1:53 am
  21. 2010-02-27 2:16 am
    • 2010-02-27 6:50 am
      • 2010-02-27 7:54 am
        • 2010-02-28 3:01 am
  22. 2010-02-27 2:36 am
  23. 2010-02-27 5:55 am
    • 2010-02-28 2:29 am
      • 2010-02-28 11:57 am
        • 2010-03-02 8:51 am
          • 2010-03-03 1:56 am
      • 2010-02-28 5:07 pm
        • 2010-02-28 7:47 pm
  24. 2010-02-27 7:52 pm
  25. 2010-03-01 2:26 pm