{"id":2863,"date":"2010-09-07T22:48:54","date_gmt":"2010-09-08T05:48:54","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=2863"},"modified":"2010-09-08T13:09:31","modified_gmt":"2010-09-08T20:09:31","slug":"how-much-h-264-in-each-encoder","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/how-much-h-264-in-each-encoder\/","title":{"rendered":"How Much H.264 In Each Encoder?"},"content":{"rendered":"<p>Thanks to my <a href=\"http:\/\/multimedia.cx\/eggs\/ffmpeg-and-code-coverage-tools\/\">recent<\/a> <a href=\"http:\/\/multimedia.cx\/eggs\/using-gcovr-with-ffmpeg\/\">experiments<\/a> with code coverage tools, I have a powerful new &#8212; admittedly somewhat specious &#8212; method of comparing programs. For example, I am certain that I have read on more than one occasion that Apple&#8217;s H.264 encoder sucks compared to <a href=\"http:\/\/www.videolan.org\/developers\/x264.html\">x264<\/a> due, at least in part, to the Apple encoder&#8217;s alleged inability to exercise all of H.264&#8217;s features. I wonder how to test that claim?<\/p>\n<p><strong>Experiment<\/strong><br \/>\nUse code coverage tools to determine which H.264 encoder uses the most features.<\/p>\n<p><strong>Assumptions<\/strong><\/p>\n<ul>\n<li>Movie trailers hosted by Apple will all be encoded with the same settings using Apple&#8217;s encoder.<\/li>\n<li>Similarly, Yahoo&#8217;s movie trailers will be encoded with consistent settings using an unknown encoder.<\/li>\n<li>Encoding a video using FFmpeg&#8217;s libx264-slow setting will necessarily throw a bunch of H.264&#8217;s features into the mix (I really don&#8217;t think this assumption holds much water, but I also don&#8217;t know what &#8220;standard&#8221; x264 settings are).<\/li>\n<\/ul>\n<p><strong>Methodology<\/strong><\/p>\n<ul>\n<li>Grab a random Apple-hosted 1080p movie trailer and random Yahoo-hosted 1080p movie trailer from <a href=\"http:\/\/davestrailerpage.co.uk\/\">Dave&#8217;s Trailer Page<\/a>.<\/li>\n<li>Use libx264\/FFmpeg with the &#8216;slow&#8217; preset to encode Big Buck Bunny 1080p from raw PNG files.<\/li>\n<li>Build FFmpeg with code coverage enabled.<\/li>\n<li>Decode each file to raw YUV, ignore audio decoding, generate code coverage statistics using gcovr, reset stats after each run by deleting *.gcda files.<\/li>\n<\/ul>\n<p><strong>Results<\/strong><\/p>\n<ul>\n<li>x264 1080p video: 9968 \/ 134203 lines<\/li>\n<li>Apple 1080p trailer: 9968 \/ 134203 lines<\/li>\n<li>Yahoo 1080p trailer: 9914 \/ 134203 lines<\/li>\n<\/ul>\n<p>I also ran this old x264-encoded file (<a href=\"http:\/\/mirror05.x264.nl\/Dark\/Flash\/index_lowbitrate.html\">ImperishableNightStage6Low.mp4<\/a>) through the same test. It demonstrated the most code coverage with 10671 \/ 134203 lines.<\/p>\n<p><strong>Conclusions<\/strong><br \/>\nConclusions? Ha! Go ahead and jump all over this test. I&#8217;m already fairly confident that it&#8217;s impossible (or maybe just very difficult) to build a single H.264-encoded video that exercises every feature that FFmpeg&#8217;s decoder supports. For example, is it possible for a file to use both CABAC and CAVLC entropy methods? If it&#8217;s possible, does any current encoder do that?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Comparing H.264 encoder features sets using one of the most questionable methods imaginable<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2863","post","type-post","status-publish","format-standard","hentry","category-general"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=2863"}],"version-history":[{"count":4,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2863\/revisions"}],"predecessor-version":[{"id":2868,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2863\/revisions\/2868"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=2863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=2863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=2863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}