Colorspace in post-processing

The old Video Software Help forum, left visible as an archive.

Colorspace in post-processing

Postby CrackTheSky » Fri Oct 06, 2006 3:17 pm

Ok, I exported my video from Vegas uncompressed and as I was reading Absolute Destiny's guide, he says to convert the video to YV12 colorspace because it's needed for certain AVS filters like deen that I want to use. However, when I convert to YV12 my color is all screwed up; i.e. red things appear blue, etc. This didn't happen to me with my last video, so I'm really confused.

I also tried exporting my video from Vegas using a HuffYUV encode but that didn't make a difference. I'd really like to use some of these filters to make my video look better, but I can't do it in YV12 colorspace because of the color problem.

Unless...if I put the line "ConvertToRGB32" or "ConvertToYUY2" at the end of my AVS script, will it do all the filters in YV12 colorspace and then convert the video back to the right colorspace? Or do I just have to go without some of these filters?
User avatar
CrackTheSky
Fancy Balls
 
Joined: 27 Aug 2006
Location: Chicago
Status: Maybe editing?

Postby Kariudo » Fri Oct 06, 2006 3:33 pm

maybe you should try exporting in rgb colorspace then convert in avisynth as needed.
I believe that most editing programs don't handle yv12 footage...and I'm not one to trust any filtering to something not avisynth (the programs usually mess it up in one way or another...at least that's my experience)

colorspace conversions [generally] don't really affect the video quality (save yuy2 conversion)
Image
Image
User avatar
Kariudo
Twilight prince
 
Joined: 15 Jul 2005
Location: Los taquitos unidos
Status: 1924 bots banned and counting!

Postby CrackTheSky » Fri Oct 06, 2006 3:43 pm

But that's what I did...I exported my video from Vegas to an uncompressed (and thus, I believe, RGB) AVI file, and in order to apply certain filters like deen, I need to convert the whole video to YV12, which messes up the color in my video.

So here's my AVIsynth script so far, and I believe the "ConvertToRGB32" line at the end fixes all my problems:

avisource("E:\Documents and Settings\Ben\Desktop\RX Temp\RahXephon5.avi")
converttoyuy2(interlaced=true)
tomsmocomp(1,5,1)
converttoyv12()
deen("a3d",4,10,12)
temporalcleaner()
mftoon()
converttorgb32()


Basically, my question now is does that ConvertToRGB32 line at the end cancel out all the filters I applied because of the change in colorspace?
User avatar
CrackTheSky
Fancy Balls
 
Joined: 27 Aug 2006
Location: Chicago
Status: Maybe editing?

Postby Zarxrax » Fri Oct 06, 2006 3:57 pm

A converttorgb32() at the end should not fix anything. What are you viewing your script in? Virtualdub? What resolution is your video?
User avatar
Zarxrax
 
Joined: 01 Apr 2001
Location: Concord, NC

Postby CrackTheSky » Fri Oct 06, 2006 4:00 pm

I'm using VirtualDubMod, resolution = 720 x 480 before resize. I'm adding

Crop(10,0,-10,-0)
LanczosResize(512, 352)

after ConvertToRGB32 in my script, if it makes a difference.
User avatar
CrackTheSky
Fancy Balls
 
Joined: 27 Aug 2006
Location: Chicago
Status: Maybe editing?

Postby Gepetto » Fri Oct 06, 2006 4:33 pm

First off, remove "converttoyuy2" unless "tomsmocomp" needs YUV2 colorspace.

Second, depending on what codecs you have installed, YV12 footage will appear with a reversed hue (±180°). VLC player's internal decoder, for example, does that. I've never had that problem with virtualdub/mod, but that may be it.

Try exporting a part of the video (never mind the exact filtering) with the converttorgb32 line at the end and playing it. If the colours come out right, your problem is solved. If not, try using the Tweak filter to correct the hue.
And God spoke unto the Chicken, and He said: "Thou shalt crosseth the road", and the Chicken did cross the road, and there was much rejoicing.
My DeviantART profile
User avatar
Gepetto
Mr. Poopy Pants
 
Joined: 10 Jun 2004
Location: The Tokyo Settlement
Status: Bored to tears

Postby CrackTheSky » Fri Oct 06, 2006 5:33 pm

The ConvertToRGB32 line worked fine. I have my video in a nice-looking and usable MPEG file now.

Thanks for all your help!
User avatar
CrackTheSky
Fancy Balls
 
Joined: 27 Aug 2006
Location: Chicago
Status: Maybe editing?

Postby Melanchthon » Fri Oct 06, 2006 5:47 pm

CrackTheSky wrote:Basically, my question now is does that ConvertToRGB32 line at the end cancel out all the filters I applied because of the change in colorspace?

No. All the filters in that script work on the output of the previous filter. So ConvertToRGB32 applies to the output of mfToon, which applies to the results of TemporalCleaner, and so on until it reaches AVISource, which provides a clip itstead of working on one.

From the AviSynth scripting language tutorial:
What if you don't assign the result of an expression to a variable? The answer is that the result gets assigned to a special variable named "last," as though the line had begun "last =". Last is used implicitly in two other situations as well: first, if you use a filter, and the filter takes a single clip as its last argument, and you don't supply that argument, then the value in last will be used; and second, when the script ends, the video clip in last is taken as the "return value" of the script--that is, the video clip that the application opening the script will see.


Unless you name an output clip yourself by using '[variable name] = [filter()]', AviSynth will name it 'last'. Single-filter clips use the clip named 'last' as input unless you specify otherwise. This allows you to write scripts without having to type a variable name every time you call a filter.
User avatar
Melanchthon
 
Joined: 02 Sep 2004


Return to Video Software Help Archive

Who is online

Users browsing this forum: No registered users and 2 guests