offers excellent compression, the MSU Lossless Codec
and FFV1 are the only codecs that outperform Lagarith in terms of compression.
Some features of Lagarith Lossless Video Codec 1.3
Lagarith is able to operate in several colorspaces - RGB24, RGB32, RGBA, YUY2, and YV12. Also, Lagarith will never down-sample video, preventing inadvertent quality loss. For DVD video, the compression is typically only 10-30% better than Huffyuv. However, for high static scenes or highly compressible scenes, Lagarith significantly outperforms Huffyuv. A comparison for various types of video can be found here.
Lagarith is able to outperform Huffyuv due to the fact that it uses a much better compression method. Pixel values are first predicted using median prediction (the same method used when "Predict Median" is selected in Huffyuv). This results in a much more compressible data stream. In Huffyuv, this byte stream would then be compress using Huffman compression. In Lagarith, the byte stream may be subjected to a modified Run Length Encoding if it will result in better compression. The resulting byte stream from that is then compressed using Arithmetic compression, which, unlike Huffman compression, can use fractional bits to encode a symbol. This allows the compressed size to be very close to the entropy of the data, and is why Lagarith can compress simple frames much better than Huffyuv, and avoid expanding high static video. Additionally, Lagarith has support for null frames; if the previous frame is mathematically identical to the current, the current frame is discarded and the decoder will simply use the previous frame again.
The trade-off for this improved compression is speed. Lagarith is significantly slower than Huffyuv on typical video. On my system, Lagarith tends to encode at about half the speed Huffyuv does. Additionally, the decode speed is slower than the encode speed; this is due to the nature of Arithmetic compression and the prediction algorithm. Fortunately, for the situations where the codec offers the most advantages over Huffyuv, the speed difference between the two tends to decrease, and Lagarith can be much faster for simple video.
This codec was build using the Huffyuv source as a template, and uses some Huffyuv code, most notably the routine to upsample YUY2 video to RGB. The function for upsampling YV12 to YUY2 was taken from AviSynth.
Changes in Lagarith Lossless Video Codec 1.3.27
- Fixed a crash that could occur when the source video buffer is not aligned to a multiple of 8 for 32 bit systems. The issue still exists for 64-bit systems, but the fix for them isn't nearly as easy and it is a very rare issue so I am leaving it alone for now. Thanks to Peter Dimov for reporting this and providing a way to reproduce the issue.
- Restored a table entry in the Fibonacci coder I accidently deleted; this would cause video corruption or crashes when playing back high-resolution video.
- Fixed some pointers being treated as 32-bit integers when instantiating the codec; this could result in the pointer being trucated and the application crashing on 64 bit systems. Thanks to Stuart MacKinnon for reporting this and tracking down the cause.
- Added exception handling in the range decoder; I am still getting a few reports of issues with Adobe products, and this will help me determine if there is still a buffer overrun in certain cases.
• Lagarith Lossless Video Codec 1.3.26:
- Fixed a buffer overrun in the decoder that caused crashes with Adobe products. Thanks to the all the people that reported this bug.
- Fixed an error that caused certain solid color frames from 1.3.20 and earlier to be corrupted. Thanks to Luke MacKay-Morris for reporting this and providing a sample video.
Lagarith Lossless Video Codec 1.3.20
on 17 May 2010, reviewed by: Steve
I would concur with everything Kent said above. I haven't used it extensively yet but it seems to work well, is recognized by Pinnacle Studio and Sony Vegas as well as Prism Converter as a codec, and is indeed fast and compact with no noticeable degradation in quality.
I hope this author keeps this codec updated! Great job!
I also use it as an intermediate codec when I'm going to perform multiple edits and renders on a video clip. Another great use is for converting the new (and very problematic) AVCHD MPEG4 video clips to an AVI file wrapper with PCM audio codec so VirtualDub can import them. You can then output VirtualDub in whatever format you like or stay with the Lagarith codec if you are going to further process the output file in another non-linear editing program.
Lagarith Lossless Video Codec 1.3.15
on 21 May 2008, reviewed by: kent elyue
This is my personal favourite Codec. Kudos to the author!! I'd highly recommend it.
It works perfectly for me when used to capture video from my tv card. I find that it's just as fast as HuffYUV and significantly better on compression, which saves me disk space, which in turn allows me to capture more.
I also use it to create an intermediate file whenever I have to perform complex (and tediously slow) editing operations so that I only need to do the slow operation on the video once. I can then use the intermediate file to do a much faster final 2-pass encode, which overall saves me time.