Colorspace Confusion

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
Locked
User avatar
Nicho Void
Joined: Fri Mar 12, 2010 8:51 pm
Location: St. Paul, MN
Org Profile

Colorspace Confusion

Post by Nicho Void » Mon Jan 13, 2014 9:34 pm

Hey Guys,

I recently built a new rig and in the process of getting everything reinstalled, I'm trying to update/improve my process. I'm running into confusion about colorspaces, so let me detail what I'm doing:

1. I have the following AVS script I put together via information from l33tmeatwad's site:

FFVideoSource("source.mkv")
animeupscale(widescreen=true,strength=2,fullhd=true,degrain=0)
ConvertToRGB(Matrix="Rec709")

If I don't convert to RGB, I get a warning saying "couldn't locate decompressor for YV12" and only direct steam copy is available. So, I convert to RGB and go to the next step:

2. I load that script into VirtualDubMod. Now, the absolute everything guide suggests I use UtVideo for my codec (I previously used lagarith), specifically stating to use the "i420" one because that one encodes to YV12 colorspace, but is that really the correct thing to do? There is a second UtVideo codec that just says "iyuv", should I be using that one for RGB sources? And finally, is it important to set Video to Fast Recompress? I don't know what effect that setting is supposed to have on the output.

Thanks a bunch
ImageImageImage

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Colorspace Confusion

Post by mirkosp » Tue Jan 14, 2014 8:10 am

Don't use virtualdubmod, it's an ancient software, all the good things it did are part of the main virtualdub, as are a LOT of bugfixes and improvements.
http://virtualdub.sourceforge.net/
Grab the 32bit stable from here.
Now, I have to ask, what is the resolution of your source? Because I see that animeupscale does not seem to internally handle the colormatrix, so using the Rec709 if you have SD footage is wrong.
Instead, you should indeed keep the I420 colorspace, but convert the matrix.
So, assuming you have a SD source:

Code: Select all

FFVideoSource("source.mkv")
animeupscale(widescreen=true,strength=2,fullhd=true,degrain=0)
colormatrix("Rec.601->Rec.709")
If you instead have a HD source just remove the converttorgb line.

At that point you should be able to load the avs in virtualdub and have it all work correctly, if animeupscale is a good filter (one that breaks is not ─ I see it discourages use of 1.10.x, probably suggesting 1.9.x instead, but 1.10.x is stable now and should be the reference by all means).
Image

User avatar
Nicho Void
Joined: Fri Mar 12, 2010 8:51 pm
Location: St. Paul, MN
Org Profile

Re: Colorspace Confusion

Post by Nicho Void » Tue Jan 14, 2014 11:27 am

My source is 1920x1080 @ 23.976 fps...so leaving it in YV12 is correct?

I don't understand why the resolution of my source effects the color space I should be working in. :oops:
ImageImageImage

User avatar
l33tmeatwad
Joined: Wed Feb 16, 2005 3:22 pm
Location: Christiansburg, VA
Contact:
Org Profile

Re: Colorspace Confusion

Post by l33tmeatwad » Tue Jan 14, 2014 12:06 pm

Nicho Void wrote:My source is 1920x1080 @ 23.976 fps...so leaving it in YV12 is correct?

I don't understand why the resolution of my source effects the color space I should be working in. :oops:
I wrote some of the guides before Ut codec added support for Rec.709 and never got around to changing or including that when I was updating. It would be fine to keep it yuv if you use that codec to encode to (UtVideo YUV420 BT.709 (ULH0) VCM). Also, you should not direct stream copy, you should be using fast recompress (and also you should be using the latest version of VirtualDub and not a mod). I'll probably update the guides to reflect that in the near future. If you are using the AviSynth tutorial on my website, I would recommend taking a look at the basic guides on amv101.com for a direct example on how to save files from VirtualDub since my site did not currently have that information.
Software & Guides: AMVpack | AMV 101 | AviSynth 101 | VapourSynth 101
PixelBlended Studios: Website | Twitter | YouTube

User avatar
Nicho Void
Joined: Fri Mar 12, 2010 8:51 pm
Location: St. Paul, MN
Org Profile

Re: Colorspace Confusion

Post by Nicho Void » Tue Jan 14, 2014 9:27 pm

Thanks, that helped clear up a lot of crap.

I'm having a problem with LWLibavVideoSource(). It just says unable to load "C:\Program Files (x86)\AviSynth 2.5\plugins\LSMASHSource.dll". It clearly has the correct path and AvsPMod formats it as a valid function name. Any ideas on that one?
ImageImageImage

User avatar
l33tmeatwad
Joined: Wed Feb 16, 2005 3:22 pm
Location: Christiansburg, VA
Contact:
Org Profile

Re: Colorspace Confusion

Post by l33tmeatwad » Wed Jan 15, 2014 1:55 am

Nicho Void wrote:Thanks, that helped clear up a lot of crap.

I'm having a problem with LWLibavVideoSource(). It just says unable to load "C:\Program Files (x86)\AviSynth 2.5\plugins\LSMASHSource.dll". It clearly has the correct path and AvsPMod formats it as a valid function name. Any ideas on that one?
Make sure you copied the 32bit version and that you also copied the other DLL (msvcr120.dll) to the SysWOW64 folder (if you are using a 64-bit OS) or the System32 folder (if you are using a 32-bit OS).
Software & Guides: AMVpack | AMV 101 | AviSynth 101 | VapourSynth 101
PixelBlended Studios: Website | Twitter | YouTube

User avatar
Nicho Void
Joined: Fri Mar 12, 2010 8:51 pm
Location: St. Paul, MN
Org Profile

Re: Colorspace Confusion

Post by Nicho Void » Wed Jan 15, 2014 12:32 pm

Ah, didn't realize the other .dll was a windows driver. Thanks a ton.
ImageImageImage

Locked

Return to “AviSynth Help”