View Full Version : Color correction in YV12


alexVS
1st October 2010, 09:00
I can't find answer on these questions, may be someboby will help.
My source is in YV12. I encode in h264 (YV12)
I have to do color correction, convert this to RGB, like this:

converttorgb()
RGBAdjust(0.95, 0.95, 1.0, 1.0) # reduce yellow color
or
RGBAdjust(1.0, 0.95, 1.0, 1.0) # reduce green
or
RGBAdjust(0.9, 1.0, 1.0, 1.0) # reduce red
ConvertToYV12()

I've read that YV12->RGB->YV12 reduces quality of video very much.
How can I do this in YV12? I can't do such simple things with Tweak() function.

mastrboy
1st October 2010, 11:12
only thing i can think of is: http://avisynth.org/mediawiki/ColorYUV

IanB
1st October 2010, 23:20
Have a look at the StartHue and EndHue parameters for range limiting the Sat and Hue parameters of Tweak (http://avisynth.org/mediawiki/Tweak)

Also for very precise color tuning have a look at DDCC (http://forum.doom9.org/showthread.php?t=139389) with a custom matrix.

zee944
2nd October 2010, 00:53
I've read that YV12->RGB->YV12 reduces quality of video very much.
How can I do this in YV12? I can't do such simple things with Tweak() function.

ColorYUV() is the command to replace RGBAdjust(), but in YUV the color tuning is different, you won't be achieving the same results.

BTW, I don't think converting back and forth between colorspaces would reduce the quality much. Each RGB/YUV conversion is lossy but hardly noticeable, unless you do it like ten times or the range is wrongly converted and causes clipping. So if I'd be happy with RGBAdjust(), I'd stick to that.