{"id":142,"date":"2010-06-24T18:04:00","date_gmt":"2010-06-24T17:04:00","guid":{"rendered":"http:\/\/mod16.org\/hurfdurf\/?p=142"},"modified":"2010-06-24T18:04:00","modified_gmt":"2010-06-24T17:04:00","slug":"yet-another-fatwa-or-the-case-against-lagarith","status":"publish","type":"post","link":"https:\/\/mod16.org\/hurfdurf\/?p=142","title":{"rendered":"Yet another fatw\u0101 (or, the case against Lagarith)"},"content":{"rendered":"<p>I seem to be spending a lot of my time on this here blawg yelling at people and telling them what they shouldn&#8217;t be doing or shouldn&#8217;t be using. I see no reason to discontinue this since it&#8217;s low-effort writing, likely to piss at least someone off and is in the best interests of everyone.<\/p>\n<p>Here, then, is the Grand Mufti&#8217;s ruling on the use of Lagarith: <strong>don&#8217;t.<\/strong><\/p>\n<p>The reasons are as many as there are grains of sand in the desert, but the most prominent ones are:<\/p>\n<h3>Lagarith is slow<\/h3>\n<p> If you are using a lossless codec, chances are that you are doing it because your original source is so slow on decoding and\/or filtering that it bottlenecks the encoder (or you could just be doing it because someone told you that&#8217;s how things are done, and then you should seriously reevaluate your encoding practices). Therefore, using a lossless codec that is slow on decoding is extremely dumb. You should take care to use the fastest codec available, in order to bottleneck the encoder as little as possible (you shouldn&#8217;t be using uncompressed, because you&#8217;ll bottleneck on disk read speed instead).<\/p>\n<p>Some of you will undoubtedly hurf a blurf about how Lagarith compresses better, but if you&#8217;re already blowing 20 GB of disk space on a lossless file that you&#8217;ll only keep for a few days at most, why would another few GB matter? If you want good compression there are better alternatives available anyway.<\/p>\n<p>If you were going to say &#8220;eh, the difference isn&#8217;t that big&#8221;, shut up before you embarrass yourself. On encoding, FFmpeg&#8217;s HuffYUV encoder is about <strong>160%<\/strong> faster while compressing about 10% worse (the latter number being source dependent, of course). On decoding, it isn&#8217;t quite as far behind, FFhuff &#8220;only&#8221; being about <strong>150%<\/strong> faster. The comparison gets even more unfavorable when you start taking a look at lossless h264, which (while being annoyingly slow on seeking, something that may or may not matter to you) is not only faster on both encoding and decoding, but also compresses better (except in intra-only mode, which is still faster but compresses worse than FFhuff), even on fastest settings.<\/p>\n<h3>Lagarith is buggy<\/h3>\n<p>Not much needs to be said about this one. Both the encoder and the decoder have had numerous bugs in the past, and some surely remain. The decoder is known to randomly corrupt frames in the decoded output for no particular reason (happens rarely, but still often enough to be annoying). There have also been multiple funny issues with x64 versions.<\/p>\n<h3>Lagarith is a dumb format<\/h3>\n<p>Floating-point arithmetic in a lossless video encoder. Nuff said.<\/p>\n<h3>So what should I use instead?<\/h3>\n<p>FFmpeg&#8217;s HuffYUV encoder (use &#8220;plane&#8221; as the predictor), as featured in ffmpeg itself, mencoder and FFdshow (and FFvfw), or lossless h264, depending on your requirements.<\/p>\n<h3>Exceptions<\/h3>\n<p>If you&#8217;re using a shitty NLE like Adobe After Effects or whatever, use whatever the fuck you want that works, because you&#8217;re most likely fucked anyway. It may also be forgivable to use Lagarith for RGBA (the above numbers on performance etc apply to YV12 only) since not many other lossless codecs support that.<\/p>\n<h3>References<\/h3>\n<p>Mostly <a href=\"http:\/\/saber.kawaii-shoujo.net\/Various\/lossless.temp.v1.3.txt\">DeathWolf&#8217;s lossless codec test<\/a> and personal experience.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I seem to be spending a lot of my time on this here blawg yelling at people and telling them what they shouldn&#8217;t be doing or shouldn&#8217;t be using. I see no reason to discontinue this since it&#8217;s low-effort writing, likely to piss at least someone off and is in the best interests of everyone. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,14],"tags":[],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-encoding","category-fagsubbing"],"_links":{"self":[{"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=142"}],"version-history":[{"count":1,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":143,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions\/143"}],"wp:attachment":[{"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mod16.org\/hurfdurf\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}