Log in

View Full Version : Lagarith lossless codec


Pages : 1 [2] 3 4

totya
17th November 2006, 01:53
This is very-very good codec, fast and result small file, uses 2 processors too... But very often freeze if "use multithreaded" is checked. I use only YUY2 mode.

Well I see, new version 1.3.11, Good news. :)

Problem with new codec (and last version) : codec uninstall not working (under programs add/remove)

Sorry my poor english, and thanks of developer : this is very good lossless video codec.

johnsonlam
17th November 2006, 04:26
I mean, with HuffYUV.

Still lots of people didn't know Lagarith, a direct comparison table can easily let them choose the codec they want. I'm capturing with Lagarith and it works great.

TEB
19th November 2006, 20:43
Lagarith 1.3.12 is out ;)

johnsonlam
25th November 2006, 20:36
Lagarith 1.3.12 is out ;)

I found that if using Largarith with some filter combination in Vdub, the output will have a lot of vertical and horizontal color lines, up to now I can't exactly reproduce it, seems it happen under certain criteria ...

Will report here if I have any progress.

Chainmax
14th December 2006, 02:38
I recently used Lagarith v1.3.12 to make an intermediate file. The process went through perfectly, but when trying to make the final MPEG2 I get two consecutive error messages:

http://img213.imageshack.us/img213/1508/errmsgsok9.png (http://imageshack.us)

That happens when loading the plain intermediate AVI file and a simple script with a couple extra filtering steps. Any ideas as to what could be causing this? I'm using AviSynth_160906 and VDubMod v1.5.4.1b2066.

johnsonlam
18th December 2006, 11:02
I recently used Lagarith v1.3.12 to make an intermediate file. The process went through perfectly, but when trying to make the final MPEG2 I get two consecutive error messages:

That happens when loading the plain intermediate AVI file and a simple script with a couple extra filtering steps. Any ideas as to what could be causing this? I'm using AviSynth_160906 and VDubMod v1.5.4.1b2066.

Sometimes many filters and scripts together will conflict, did you try removing the filter one by one, or just replacing Lagarith with Huffyuv to see still crash or not?

video_magic
21st July 2007, 09:23
Lagarith codec updated:

http://lags.leetcode.net/codec.html

totya
21st July 2007, 10:29
Lagarith codec updated:

http://lags.leetcode.net/codec.html

Good news, thank you!

Fixed a bug that would cause crashes when downsampling to YV12. - This is occurred me with v1.3.13.

GrofLuigi
14th April 2008, 16:27
Codec updated:

Homepage (http://lags.leetcode.net/codec.html)

Changelog (http://lags.leetcode.net/Changes.html)

GL

LeeWilson
1st May 2008, 04:30
Hi,

I am currently trying to implement AVI support into a OpenGL game engine. I have successfully got the engine to decompress AVI frames and render them in RGB. For various reasons I really need to get the alpha channel. I cannot seem to get a reliable AVI file, with alpha and Lagarith compression. I tried VirtualDub-1.7.8 and it seems that it does not support alpha channels in its conversions. I tried the Color Depth option for 32 bit RGB (888) (dummy alpha channel) and it made my movie go all semi transparent with vertical black lines. I also tried creating an uncompressed .mov with alpha, and using the movtoavi from http://lags.leetcode.net/Codec_mac.html and the avi result was black and white gibberish.

Does anyone know a reliable way of creating Lagarith compressed AVI's with the alpha channel?

Cheers in advance,

Lee

Inventive Software
1st May 2008, 14:43
Firstly, try VirtualDub 1.8. It's unstable, but has better colourspace support. Secondly, in Lagarith's config, select RGBA as the output.

LeeWilson
6th May 2008, 04:24
Hi, thanks for the reply.

I tried VirtualDub 1.8.0 with the same results as 1.7.8. It still says Dummy Alpha Channel in the color depth options for 32 bit RGB. And I have the mode set to RGBA in the Lagarith configuration.

I suppose I will have to look writing an app to compress my own avi from images or uncompressed avi with Lagarith.

[P]ako
6th May 2008, 16:14
Avisynth supports RGBA and you could use avs2avi (http://forum.doom9.org/showthread.php?s=&threadid=71493) to encode it to lagarith, in that very same thread you can also find a GUI for it (avs2avidrop).

It just occurred to me, did you set virtualdub to work in fast processing mode?

Zarxrax
7th May 2008, 11:56
I have often created lagarith files containing alpha channel with Adobe After Effects or Adobe Premiere. I think free trial versions may be available. Avisynth can also generate video with alpha channel like [P]ako said, and thats probably the easier way to just test it.

video_magic
26th August 2008, 00:20
I have noticed that the Lagarith codec has been updated to version 1.3.18! Thanks for the updates Ben Greenwood

http://lags.leetcode.net/codec.html

totya
26th August 2008, 00:42
Hi!

Version 1.3.17, and 1.3.18 uninstall function is bad.

if I use lagarith.inf form 1.3.15, uninstall works.
Different is "setupapi.dll" - "setupx.dll"

My system is XP, 32 bit.

benwaggoner
3rd September 2008, 07:06
So, I'm very annoyed by the Adobe video apps (I've seen this in Premiere Pro and After Effects CS3) inabilty to actually take settings with Lagarith. I can choose the options like normal, but when I close the dialog and go back, it's always RGB without multithreading, and regardless of what I set the options to, the output is always RGB single-threaded.

Anyone know of any workaround for this? A reg key I can set for default behavior or something?

squid_80
3rd September 2008, 07:12
Take a look at c:\windows\lagarith.ini.

video_magic
5th September 2008, 23:16
I have been trying out the newest version of MLC and the newest Lagarith, and Lagarith has been my winner!
Capturing from a NTSC Laserdisc at 29.97 720x480 YV12 using virtualvcr and through S-Video to S-Video via BT878a based board. Capturing audio as PCM 44100 stereo.
My PC has a SL9KE chip which is a P4 3.2ghz HT 2mb and 1gb PC3200 2-2-2-5 ram. XP SP2 running clean and defragged.

39 minutes of video resulted in a 12.6GB file! :)

MLC was too slow to be usable even on the fastest setting. Lagarith is excellent!

Capture Stats
Frames Captured: 70261
Frames Dropped1: 0
Frames Dropped2: 1
Time : 00:39:04
Time Left: 07:08:19
Free Space: 148,803,293,184
Video Bytes: 13,163,442,847
Audio Bytes: 413,569,800
Total Bytes: 13,577,012,647
Video Bytes Sec: 5,613,729
Audio Bytes Sec: 176,372
Total Bytes Sec: 5,790,101
Video Compression: 2.767
Video Rate: 29.970013
Audio Rate: 44100.241432
AV Diff: -0.000005
AV Adjust: 0.000000
AV Actual: 0.000000

benwaggoner
10th September 2008, 17:29
Take a look at c:\windows\lagarith.ini.
I don't see any way to set default modes in there, but in my ~\AppData\Local\VirtualStore I see

[settings]
multithreading=1
lossy_option=3

Anyone know what the right numbers are for multithreaded and YV12?

squid_80
10th September 2008, 19:11
I don't see any way to set default modes in thereWell, wherever settings go when WritePrivateProfileInt/String is used.Anyone know what the right numbers are for multithreaded and YV12?
multithreading=1 means use multithreading (who would have guessed?).
lossy_option=3 means YV12. (0:RGBA, 1:RGB (Default), 2:YUY2, 3:YV12, 4:Reduced Resolution)
suggest=1 means always suggest RGB for output.
nullframes=1 means enable Null frames.

From the sounds of it this isn't going to fix your problem though.

benwaggoner
10th September 2008, 19:15
Bummer. So I've got it set correctly, but Premiere and After Effects are somehow overriding the defaults!

smok3
10th September 2008, 19:29
my workaround is to use huffyuv with adobe apps (for RGB and for RGBA), after the project is finnished i would reconvert those huffs to lags for backups.
(ask for bat which controls vdub.exe and converts *.avi to *_lags.avi))

henryho_hk
11th September 2008, 05:18
smok3, you can use the command-line utility avs2avi.exe (http://www.moitah.net/).

I've drafted a batch file (totally untested):

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

if "%~1"=="" (
echo Usage: "%~f0" <source avi>
echo Defaults to RGBA output
echo For RGB24, name it as "blahblah_rgb.avi"
goto :EOF
)

set HOMEDIR=%~sdp0
set WORKDIR=%~sdp1

set PIXTYPE=%~n1
set PIXTYPE=%PIXTYPE:~-4%

if /i "%PIXTYPE%"=="_RGB" (
set PIXTYPE=RGB24
) else (
set PIXTYPE=RGB32
)

set SRCFILE=%~sf1
set AVSFILE=%~sdpn1_%PIXTYPE%.avs
set DSTFILE=%~sdpn1_lags_%PIXTYPE%.avi
set LAGSCFG=%HOMEDIR%lags_%PIXTYPE%.cfg

echo AVISource^("%SRCFILE%",pixel_type="%PIXTYPE%"^)>"%AVSFILE%"


if exist "%LAGSCFG%" (
"%HOMEDIR%avs2avi.exe" "%AVSFILE%" "%DSTFILE%" -w -p 0 -l "%LAGSCFG%"
) else (
"%HOMEDIR%avs2avi.exe" "%AVSFILE%" "%DSTFILE%" -w -p 0 -s "%LAGSCFG%"
)

:EOF

smok3
11th September 2008, 08:24
henryho_hk: oh, sorry for confusion, i allready have a batch, what i meant is if somebody needs an example, i can provide. However, good batches are always welcome.

edit1: why do you need avisynth for this?
edit2: ok, i just realized my batches wont do RGBA to RGBA but for some reason it ends with RGB lags, must take a look into this..

henryho_hk
12th September 2008, 01:37
why do you need avisynth for this?

I use AVISynth because I use avs2avi. :devil: :devil: It seems difficult to fiddle with Virtualdub's (<1.6) VFW config in batch files. Mencoder supports VFW compression too but for unknown reasons it runs slower than avs2avi in my computer.

lilhobo
21st September 2008, 18:05
how can i install for vista64?? the bat wont work for me :(

henryho_hk
22nd September 2008, 07:01
how can i install for vista64?? the bat wont work for me :(

Sorry, I dun have any Vista (32 or 64) for testing. But you can send me the error messages (seems out-of-topic for this thread) and see if I can help.

lilhobo
24th September 2008, 23:32
well vista u need the admin rights or something which the bat doesnt give

LoRd_MuldeR
25th September 2008, 00:12
well vista u need the admin rights or something which the bat doesnt give

What if you run it from an Admin account?

lilhobo
25th September 2008, 11:31
the first user on a fresh vista install is the admin i would guess

foxyshadis
30th September 2008, 11:46
how can i install for vista64?? the bat wont work for me :(

Same way you install huffyuv in win64 (xp or vista): http://www.dvinfo.net//conf/what-happens-vegas/126319-installing-huffyuv-vista-64-bit.html

totya
10th October 2008, 10:11
Hi!

v1.3.19 uninstall function is bad under XP32 again (and again and again and again...)

I wrote this (http://forum.doom9.org/showpost.php?p=1175081&postcount=66) before.

Thx.

ipanema
23rd November 2009, 18:49
Does anyone know if Lagarith is still being developed? I submitted a bug report a couple of times to the author a few months ago but there was no reply.

I'll pasted the details below in the hope that he may see it here.

I'm getting crashes with the Lagarith encoder when it is configured to YUY2 or YV12 in its settings. This only happens when the input video size is 1280x720, there is no problem when it is 1920x1080.

I'm feeding 1280x720 RGB24 video frames from Mainconcept or Elecard H.264 decoders to Lagarith for encoding. Both of these H.264 decoders cause Lagarith to crash with an access violation at the first sample delivered - here is a stack traceback when using the Mainconcept decoder:

lagarith.dll!0b581b7b()
lagarith.dll!0b584e9c()
lagarith.dll!0b5852d2()
lagarith.dll!0b587863()
msvfw32.dll!6c2718e6()
msvfw32.dll!6c274fb7()
qcap.dll!6c32a394()
qcap.dll!6c349455()
qcap.dll!6c349840()
......

However, when the ffdshow H.264 decoder filter is feeding Lagarith then there is NO crash and the filter graph runs fine. Having looked at the media types it looks like the sample size and actualdatalength for ffdshow are set to

sample actual data length 2764800
sample size 3686400

but for Mainconcept and Elecard, the sample size and actualdatalength are BOTH set to 2764800.

I therefore wonder if Lagarith is making an incorrect calculation of the sample size giving it a size beyond 2764800 which leads to an access voliation for Mainconcept and Elecard; but not with ffdshow because its sample size is much larger at 3686400.

If lagarith is set to RGB in its options sheet then this also avoids the crash and the filter graph runs OK. So maybe lagarith is getting the data size incorrect when doing its internal RGB to YUY2 conversion? Strange that this doesn't happen for 1920x1080 sized video though.

I also noticed that one of the last fixes is "Fixed a bug that would corrupt video when downsampling to YUY2 and the resolution was not a multiple of 32". Notice that 720 is not an exact multiple of 32, so maybe this has something to do with the problem too.

Also if "Use multithreading" is selected in Lagarith's options when the above crash happens, the program seems to terminate but Task Manager shows that there is a thread still running inside Lagarith and using approx 40% of CPU time. The only way to get rid of this is the End Process button in Task Manager.

If "Use multithreading" is NOT selected then this vestigial thread is not left running and the process disappears completely from Task Manager's list.

weaker
23rd November 2009, 23:22
The homepage http://lags.leetcode.net/codec.html had an update in July 2009, so I guess it is still developed.

Jim_Pansen
24th May 2010, 15:12
Hi folks,

is there any chance to see the Lagarith Codec for MAC in future? :)

For easier handshakes on exchanging material PC <--> MAC it would be a great plus for the workflow.

THX a lot for developing this great codec.

Jim

johnsonlam
25th May 2010, 10:56
Mac OSX should have some lossless codec, both video and audio!

Jim_Pansen
25th May 2010, 20:21
Mac OSX should have some lossless codec, both video and audio!

My question was related to interoperability, not to the general question "Is there any losless MAC codec"!

Your answer doesn't match my question.

Jim

Boolsheet
25th May 2010, 22:59
I believe the lagarith source itself is Windows specific. I also read it uses a floating point arithmetic (or range?) coder, which makes portability less fun. Nathan Caldwell started a yv12 decoder for FFMpeg and they came up with something to emulate the problem with the entropy coder. The git of the fork is here (http://repo.or.cz/w/FFMpeg-mirror/lagarith.git). Looks like everyone is busy with higher priorities, so it's more likley the far future. ;)
Once it gets finished, it probably gets comitted to FFMpeg and usable with perian (I'm assuming that's the ffdshow equivalent on OS X) or something.

I don't know if there are any other porting projects for lagarith.

Jim_Pansen
27th May 2010, 13:43
I believe the lagarith source itself is Windows specific. I also read it uses a floating point arithmetic (or range?) coder, which makes portability less fun. Nathan Caldwell started a yv12 decoder for FFMpeg and they came up with something to emulate the problem with the entropy coder. The git of the fork is here (http://repo.or.cz/w/FFMpeg-mirror/lagarith.git). Looks like everyone is busy with higher priorities, so it's more likley the far future. ;)
Once it gets finished, it probably gets comitted to FFMpeg and usable with perian (I'm assuming that's the ffdshow equivalent on OS X) or something.

I don't know if there are any other porting projects for lagarith.

THX for your reply. This explains something for me!

Jim

benwaggoner
3rd January 2011, 22:06
Another Lagarith question: why are settings not persistant in some apps? I can set Colorspace to YV12 and Multithreading on in VirtualDub 32-bit just fine. But if I "Okay" and go back to the dialog in VDub 64-bit or any Adobe video apps, everything is back at the defaults when I return.

Any ideas/workarounds?

mariush
4th January 2011, 10:21
Settings are saved in C:\Windows\Lagarith.ini - maybe the 64bit windows API functions used by Lagarith report a different folder instead of "C:\Windows", like "c:\windows\Sys64" or something like that.

Use Filemon from SysInternals Suite to see where's is the codec trying to find the ini file.

totya
4th January 2011, 14:20
Run these 64bit apps with admin rights (run with admin), and u see, settings is saved.

My idea: try x264 vfw codec, lossless mode is very good.

Another Lagarith question: why are settings not persistant in some apps? I can set Colorspace to YV12 and Multithreading on in VirtualDub 32-bit just fine. But if I "Okay" and go back to the dialog in VDub 64-bit or any Adobe video apps, everything is back at the defaults when I return.

Any ideas/workarounds?

qyot27
9th January 2011, 09:11
The decoder has been committed to ffmpeg:
http://git.ffmpeg.org/?p=ffmpeg;a=commit;h=2588d70388459e1f6958ee4f0c092d643006af3c

If only I had been aware of this going on on the mailing list over the last few days, I wouldn't have gone to the trouble of adjusting a local clone of the repo.or.cz branch to current ffmpeg manually last night (to use with FFMS2), just 12 hours before the official commit occurred.

Reimar
10th January 2011, 13:41
The decoder has been committed to ffmpeg:
http://git.ffmpeg.org/?p=ffmpeg;a=commit;h=2588d70388459e1f6958ee4f0c092d643006af3c


Please consider it experimental though, it's been committed due to demand and too little time of the original author, but it does have some issues (I am not aware of it decoding anything incorrectly though, but I wouldn't 100% exclude the possibility either).

qyot27
10th January 2011, 17:34
Please consider it experimental though, it's been committed due to demand and too little time of the original author, but it does have some issues (I am not aware of it decoding anything incorrectly though, but I wouldn't 100% exclude the possibility either).
I'm sure it's already known, but there is one specific case that I've seen it choke on. From what I can recall of how Lagarith's methodology was described, if it detects frames of a solid color it stores them as a flag or something rather than a full frame (the video generated by the below script at 640x480 results in a 10KB Lagarith file, as does that same script with a resize to 1920x1080). This behavior can't be turned off, so it can occur in the middle of any given sort of video material. But the fflagarith decoder outputs green frames instead of the intended color.

It can be duplicated by artificial means.
BlankClip(40) ++ BlankClip(40).Invert()
would be sufficient.

Reimar
10th January 2011, 20:57
Upload a sample, preferably as an attachment to an FFmpeg bug report.
A report on this board with instructions to reproduce that require Windows when basically none of the developers (including me) use Windows, if they can avoid it, is unlikely to help getting a fix any time soon.

qyot27
11th January 2011, 05:29
Report submitted with attached sample. Hopefully I did it correctly.

Reimar
11th January 2011, 09:50
Report submitted with attached sample. Hopefully I did it correctly.

I think so. It's very strange that you do not get any error messages in the output though, there's probably more than one bug there.

video_magic
14th February 2011, 12:43
New version 1.3.21
http://lags.leetcode.net/codec.html

The changelog looks like it delivers significant performance improvements.

Version 1.3.21 released on 2-13-2011
Fixed a bug that would cause the codec to crash when downsampling certain resolutions. Thanks to Richard Jones for reporting this bug and tracking down the cause.
Several speed improvements:
- Integrated RLE restoration into range decoder so decoding only takes one pass through the data.
- Increased range decoder hash table size.
- Removed RLE level 2, testing indicates that it doesn't offer any real benefit verses levels 1 or 3.
- RLE compression now encodes all levels in parallel and selects the best one rather than perform an estimation run and then an RLE run.
- RLE compression now has a faster SSE version for processors that support SSE.
- Added and improved existing MMX/SSE/SSE2 optimizations for several functions relating to median prediction and image layout.
Overall I typically see about a 10-30% speed improvement.
Tweaked how RLE level is selected to improve compression by about 1%.
Tweaked how the work is distributed in multithreading to reduce wasting CPU time.
Removed Reduced Resolution mode, I don't think it is useful enough to justify maintaining.