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. |
30th May 2012, 17:36 | #1 | Link |
Registered User
Join Date: Sep 2007
Location: Europe
Posts: 602
|
Avoid using VirtualDub to prevent format conversions?
Hey all,
Sometimes when I'm working on DVDs, I'll need to do things in stages. For example, taking a 4:4:4 TIFF image sequence, and using AVISynth scripts to produce a PAL or NTSC res downconvert of this. Then I'll save this file in VirtualDub (as a Lagarith AVI file, usually in YV12 because that's all many of the AVIsynth filters operate in anyway). Downstream, I'll load this AVI file in another AVISynth script to do more processing. The reason for the multiple steps is that combining everything into one big script is just too slow. But, VirtualDub only processes in RGB, correct? So each time I do this, I'm adding a pixel format conversion. Just today I saw one case where the chroma resolution had been mangled by this process. Red text on a nearly black background had colour bleed everywhere. So, my question is, how should I be doing this to preserve quality wherever possible? |
30th May 2012, 17:45 | #3 | Link |
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,843
|
No- Vdub has different processing color spaces, not only RGB. You set it in Color Depth. You can stay in YV12 if you set it.
I use YUY2 and many Vdub filters works in it natively- no need to go through RGB. |
30th May 2012, 18:41 | #4 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Fast recompress just enters negotiation with the compression codec, and if they can
agree on a common format they do not need to convert. However, in eg HuffYUV, you have to set it to ConvertToYUV, otherwise it would actually send HUFFYUV RGB, even if in Fast Recompress. As far as I know all VD filters require conversion to RGB, and so cannot be used in eg Fast Recompress or Direct Stream Copy. In my 1.9.11 when Fast Recompress is selected, it disables Filters (tried it with a builtin filter). Can you give the name any VD filter that accepts anything other than RGB ? I'de kinda like to read it say that in docs as I find it extremely difficult to believe. EDIT: Quote:
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 30th May 2012 at 18:46. |
|
30th May 2012, 18:58 | #6 | Link |
Registered User
Join Date: Sep 2007
Location: Europe
Posts: 602
|
Ah ha! Thanks for this, guys. This wasn't always here:
So basically once I've downconverted to YV12 in the AVISynth script, I can set these options to YV12 in VirtualDub, choose Fast Recompress, and I'm good for avoiding further degradation? Edit: yep - seems like it - the colour bleed is gone. Now let's try to get it into Cinema Craft SP3 (YUY2) intact! Last edited by Lyris; 30th May 2012 at 19:06. |
30th May 2012, 19:17 | #7 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
WOW!!!, Thanks man, that took me by surprise.
Never read the VDub docs for years, probably not since a big chunk of the old docs were abandoned. Am now asking myself how easy it might be to incorporate the VDUBMod Avisynth Script editor in current version of VD. Downloading SDK etc imminent. Again, thanks very much.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
30th May 2012, 19:47 | #8 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Just checked, VD MPEG2 had a reduced version of colorspaces
in your image, me and you have been missing out for a long long time. VDMod, (the one I almost exclusively use except where rendering multipart AVS files [chopped in half]) does not have anything more than 16/24/32 bit rgb.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
30th May 2012, 20:49 | #9 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
As the saying goes, wake up and smell the coffee... |
|
30th May 2012, 21:09 | #10 | Link | |
Registered User
Join Date: Dec 2007
Location: Germany
Posts: 632
|
Quote:
The important part is, if you examine CCE's "way of downconverting YUY2 to YV12 for MPEG2" you will notice that it is equivalent to AviSynth's ConvertToYV12(interlaced=true/false). Whether the interlaced or non-interlaced processing takes place depens on one setting: in the "Picture" settings at the bottom there you can choose between interlaced, progressive and auto (do not use auto). Knowing that CCE works this way we can simply convert from YV12 to YUY2 by doubling the vertical chroma. CCE then downsamples this and in the end it's a NOP without additional chroma bleed. I think it can be done using chromaresample=point and some shifting of the plane as AviSynth's pointresampling introduces a shift. I should investigate this but until now I always used a function called YV12toYUY2 for this which does a point resize that doesn't shift the plane. Do not confuse it with Gavino's YV12toYUY2. For interlaced point YV12->YUY2 you need to wrap the YV12toYUY2 function in between something like separatefields() and weave() but I don't have access to my scripts on this computer. Edit: This is what happens: Code:
ColorBars(pixel_type="YV12") Raw=last YV12toYUY2() ConvertToYV12(interlaced=false) Subtract(last, raw) #it's a NOP, YV12 chroma stays untouched Edit 2: If you use VD in "Fast Recompress" mode it does not matter what color spaces you set in the settings, it's only for filter processing within VD. That means this mode always keeps the incoming color space untouched. Last edited by TheSkiller; 30th May 2012 at 21:22. |
|
30th May 2012, 22:04 | #12 | Link | |
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,843
|
Quote:
SP3 likes YUY2 as input. |
|
31st May 2012, 03:08 | #13 | Link | ||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Quote:
and am yet to find any other version of it that eg inserts the current frame into the script, clip ranges, trimsets and the other script editing functionality of the build in script editor. Having an external editor just dont do it for me, I'm just not that easily pleased. Maybe AVSPmod does that sort of thing, shall really have to try it one day (for more than five minutes). EDIT: having had a brief look a Vd 1.9/10 source, looks like I'll havta stick with VDubMod, looks like too big a job to take on (still gonna explore it a little more though).
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 31st May 2012 at 04:09. |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|