Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th November 2005, 12:06   #1  |  Link
ariga
Learning...
 
ariga's Avatar
 
Join Date: Nov 2005
Location: 12.97°N, 77.56°E
Posts: 135
lossless YV12 codecs (was: YV12 FAQ)

I am looking for a lossless YV12 codec to save the output of avisynth. Seems like vble and loco can do it. But neither can handle interlaced video, is that correct ? Are there any new codecs now ?
ariga is offline   Reply With Quote
Old 28th November 2005, 14:07   #2  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Quote:
Originally Posted by ariga
I am looking for a lossless YV12 codec to save the output of avisynth. Seems like vble and loco can do it. But neither can handle interlaced video, is that correct ? Are there any new codecs now ?
ffdshow has a YV12-capable HuffYUV codec. You need to install the vfw support for it to be available I think.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 28th November 2005, 16:19   #3  |  Link
ariga
Learning...
 
ariga's Avatar
 
Join Date: Nov 2005
Location: 12.97°N, 77.56°E
Posts: 135
That's nice. But ffdshow looks like one of the all-in-one codec packs. Will it interfere with my existing codec setup ? Is it possible to limit it to just the yv12 encoding/decoding ?
Also, how can I determine which codec is being used by avisynth (or other app) at any time ?
ariga is offline   Reply With Quote
Old 28th November 2005, 16:23   #4  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Look in the documentation of AviSource and the fourCC option.

I splitted the thread from the sticky if you don't mind.

Quote:
That's nice. But ffdshow looks like one of the all-in-one codec packs. Will it interfere with my existing codec setup ?
No, you can select which decoders in ffdshow should be used for decoding some format.

Quote:
Is it possible to limit it to just the yv12 encoding/decoding ?
Yes, that's also possible.
Wilbert is offline   Reply With Quote
Old 28th November 2005, 17:35   #5  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Quote:
Originally Posted by ariga
I am looking for a lossless YV12 codec to save the output of avisynth. Seems like vble and loco can do it. But neither can handle interlaced video, is that correct ? Are there any new codecs now ?
You can try Lagarith lossless codec, supporting RGBs, YUY2 and YV12

Edit: Not sure about interlacing....

http://lags.leetcode.net/codec.html
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]

Last edited by Poutnik; 28th November 2005 at 17:40.
Poutnik is offline   Reply With Quote
Old 28th November 2005, 19:22   #6  |  Link
Anonymouses
Guest
 
Posts: n/a
Quote:
Originally Posted by ariga
That's nice. But ffdshow looks like one of the all-in-one codec packs. Will it interfere with my existing codec setup ? Is it possible to limit it to just the yv12 encoding/decoding ?
It's not a codec pack. And yes you can limit it to only encode/decode whatever you want. If you don't want it decoding something you just disable that feature.
  Reply With Quote
Old 28th November 2005, 23:47   #7  |  Link
Hellworm
Registered User
 
Join Date: Aug 2005
Posts: 132
In ffdshow you can also try FFV1, pretty good compression, slow, can handle yv12, afaik.
Don' t know about interlaced.
Hellworm is offline   Reply With Quote
Old 29th November 2005, 00:07   #8  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Think about it guys. A YV12 frame does not know it is interlaced it just has 3 planes of data a Y plane and 2 of 0.25 sized U and V planes. A lossless codec will just store the plane data and return it unchanged.

As for being able to tell the codec the plane data is interlaced there may be a slight improvement in correlation within a single field that might allow a slightly better compression but it is probably not worth the hassle with intermediate workfiles. If your are really worried about it do a SeparateFields() at the end of the script and an AssumeFieldBased().Weave() when you re-import the data.

Last edited by IanB; 29th November 2005 at 00:09.
IanB is offline   Reply With Quote
Old 29th November 2005, 00:35   #9  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
Think about it guys. A YV12 frame does not know it is interlaced it just has 3 planes of data a Y plane and 2 of 0.25 sized U and V planes. A lossless codec will just store the plane data and return it unchanged.

As for being able to tell the codec the plane data is interlaced (...)
I guess it only matters when you feed or request RGB from the codec.
Wilbert is offline   Reply With Quote
Old 29th November 2005, 01:24   #10  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Quote:
Originally Posted by Wilbert
I guess it only matters when you feed or request RGB from the codec.
Which you probably should not do, else why bother with the lossless "YV12" codec. Letting arbitary unknown code do your colour space translations is fraught.
IanB is offline   Reply With Quote
Old 29th November 2005, 01:37   #11  |  Link
GrofLuigi
Member of a Library
 
Join Date: Oct 2002
Posts: 463
I have used Loco codec few times to store interlaced YV12 with no visible problems, although in the readme it says "interlaced support is todo".

GL
GrofLuigi is offline   Reply With Quote
Old 29th November 2005, 10:33   #12  |  Link
ariga
Learning...
 
ariga's Avatar
 
Join Date: Nov 2005
Location: 12.97°N, 77.56°E
Posts: 135
The author of Lagarith claims the codec is fast and compresses better than other codecs. (FFV1 only slightly better but slower). Tried it, works well, supports interlacing (but then IanB pointed out, it's irrelevant if there's no colorspace conversion)

Is this a good way to determine if the codec is lossless ?
orig=AviSource("orig_pal_dv.avi") # 50 frames, 7041 KB
lags=AviSource("lags_pal.avi") # 50 frames, 10900 KB
Subtract(orig, lags).Histogram("levels")

BTW, uncompressed YV12 was 30385 KB.

EDIT: Interlacing support not available !! Mail from author...
Quote:
On Tue, 29 Nov 2005 Ben Greenwood(RIT Student) wrote :
Adding support for interlaced video is on my 'to-do' list for Lagarith, athough I have no idea when it will be implemented. The reason it is not in there yet is that interlaced YV12 is kinda messy to deal with during colorspace conversions. As the posts say, you should be fine as long as you do not do any colorspace conversions within Lagarith when working with interlaced video.

Last edited by ariga; 1st December 2005 at 16:22.
ariga is offline   Reply With Quote
Old 29th November 2005, 13:46   #13  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
An easier method is a PSNR (or any other metric) comparison. In fact, MSU has a tool for this.

Which brings me around to my suggestion, the MSU Lossless codec is basically the most efficient lossless available, more so than lag or loco, and still reasonably fast (it's around half the speed of huffyuv on mine, I think, but I use the fastest mode). And it does support interlaced YV12, fwiw.
foxyshadis is offline   Reply With Quote
Old 30th November 2005, 15:44   #14  |  Link
ariga
Learning...
 
ariga's Avatar
 
Join Date: Nov 2005
Location: 12.97°N, 77.56°E
Posts: 135
With uncompressed YV12 (480 frames of 720x576 @ 25fps) 292 MB
Code:
Codec  Duration   Size       Settings
MSUD    1:58      137 MB !! Lossless; Mode=Maximise speed; Enable delta frames
MSUD    0:59      121 MB    Lossless; Mode=Maximise speed
MSUD    0:59      121 MB    Lossless; Mode=Max compression,slow decomp
LAGS    0:22      130 MB    Default settings
Lagarith decompression took the same time. Excellent for intermediate files.
MSU decompression was similarly slow. I'd say good for archiving only.
ariga is offline   Reply With Quote
Old 30th November 2005, 15:55   #15  |  Link
gamr
Registered User
 
Join Date: Jul 2002
Posts: 63
am i still the only 1 using vble? can post it on a site if anyone wants it (last i knew it was hard to find)
__________________
My xvid instabuild site: http://xvid.gamrdev.com/
gamr is offline   Reply With Quote
Old 30th November 2005, 16:35   #16  |  Link
ariga
Learning...
 
ariga's Avatar
 
Join Date: Nov 2005
Location: 12.97°N, 77.56°E
Posts: 135
Links vble and loco are available via the YV12 FAQ, particularly in this thread

But it would help if comparison/stats were posted here along with the time. Mostly the comparison is only w.r.t size and not time.
ariga is offline   Reply With Quote
Old 30th November 2005, 22:21   #17  |  Link
Alain2
Registered User
 
Join Date: May 2005
Posts: 236
What about Helix codec 1.2 ? Don't know if it handles interlaced video though
Alain2 is offline   Reply With Quote
Old 1st December 2005, 06:13   #18  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
Guess I was wrong. I'll give lagarith a try then.
foxyshadis is offline   Reply With Quote
Old 1st December 2005, 07:28   #19  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Quote:
Originally Posted by Alain2
What about Helix codec 1.2 ? Don't know if it handles interlaced video though
I am afraid this codec support YV12 in non uncompressed way,
or I recall badly....
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 1st December 2005, 12:26   #20  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by Poutnik
I am afraid this codec support YV12 in non uncompressed way,
or I recall badly....
Yep. The Helix codec takes uncompressed YV12 or I420 and converts it to YUY2 or RGB - so it's more of a colorspace converter than a "real" codec.
Leak is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.