Changing Y in ColorYUV() has absolutely no effect on U and V. And vice versa. But if you want colors to remain similar as you change Y you need to adjust U and V too. Otherwise they will get more or less saturated.
+ Reply to Thread
Results 181 to 210 of 231
-
Last edited by jagabo; 21st Feb 2014 at 07:29.
-
If adjusting Y contrast has no effect on U and V, why do you have to adjust U and V and why would they change?
My experience is that a statement like "ColorYUV(cont_y-30)" changes U and V levels as well. That is, if you are viuewing a YUV histogram and an RGB output histogram at the ssme time, lowering/raising Y contrast also lowers/raises R G B levels at the same time.Last edited by sanlyn; 19th Mar 2014 at 03:15.
-
The RGB cube is rotated within the YUV colorspace. See the "RGB Colors Cube in the YCbCr Space" diagram in the middle of this page:
http://software.intel.com/sites/products/documentation/hpc/ipp/ippi/ippi_ch6/ch6_color_models.html
So changing Y changes R, G, and B by differing amounts.
Changing Y does not effect U and V. You can easily see this by viewing Y, U, and V components while changing Y with ColorYUV():
Code:function AnimateContrast(clip vid, int val) { ColorYUV(vid, cont_y=val) Subtitle("cont_y="+String(val)) } WhateverSource() # use a still image Animate(0, 100, "AnimateContrast", -256, 256) ConvertToYUY2().VideoScope("both", true, "UV", "Y", "UV")
Last edited by jagabo; 21st Feb 2014 at 09:30.
-
I understand that. But monitors and TVs don't display YUV. I was correcting for RGB output. I think I also mentioned rotating within the YUV matrix.
YUV and RGB histograms of a video frame, black borders removed. The image displayed as RGB is too yellow and brights are "hot". Red and green highlights are clipped in RGB.
[Attachment 23702 - Click to enlarge]
After "ColorYUV(cont_y=-60), reducing Y contrast. This is overkill and needs more work, obviously. As expected, Y contrast is reduced but U and V stay the same. In RGB, colors aren't clipped, some highlight detail has been retrieved, and color balance remains the same.
[Attachment 23703 - Click to enlarge]
Y contrast remains the same as original, but here used "ColorYUV_cont_v=-90). In YUV, you can see that Y and U remain unchanged, but V has changed. In RGB, bright highlights are still too hot, red and green are still clipped. Red saturation is reduced, so the image is no longer too yellow. Now it's too green.
[Attachment 23704 - Click to enlarge]Last edited by sanlyn; 19th Mar 2014 at 03:16.
-
Stop trying to weasel out of this. In a discussion of changing contrast with ColoryYUV(cont_y=N) you said:
Then later you said again:
Changing Y has absolutely no effect on U and V. Changing Y will have an effect on R, G, and B -- the colors you finally see on the screen. But that's not the same as changing U and V.Last edited by jagabo; 21st Feb 2014 at 10:59.
-
That's what I said. That's was I showed. By "accordingly" I mean that if you raise/lower contrast in U, U will change accordingly and Y and V will remain the same. If you raise/lower V then V will change accordingly, and Y and U will remain the same. If you raise/lower Y then in YUV the Y channel will change but neither U nor V will change in YUV (but raise/lower Y and the effects in RGB are different). I didn't change the images. They show the differences in YUV and RGB, and I see the different behavior in my editor's window.
I don't disagree with you. I tried to show that YUV and RGB don't behave in exactly the same way.Last edited by sanlyn; 19th Mar 2014 at 03:16.
-
-
Gotcha. Your version is shorter, too!
Last edited by sanlyn; 19th Mar 2014 at 03:16.
-
Back to acquiring filters/plugins used in sanlyn's scripts.
2.0.30.0 = mt_masktools.dll (Jan 2006) aka v.2.0a30. Early version of masktools 2 for Avisynth 2.0. Can still be used with version Avisynth v.2.5.x
MaskTools v2.0a20 Jan 2006
MaskTools v2.0a30 Jun 2006
ContrastMask Couldn't find on avisynth site. Googled & found a couple. Link to proper one, please.
CCD Googled for ccd_sse2.vdf & found link on doom9 from Tempter 57Boulder variant with filter ccd_sse2.vdf (http://acobw.narod.ru/file/ccd.zip) by S.Stolyarevsky -
Hm. Now that is weird. When I downloaded ccd a long time ago I kept a txt file with that same download site URL.
Okay, folks, I've attached the sse2 version below. It once had a text help file, but it was in Russian and the text is corrupt, so not even Google Translate could handle it. Translate just returns the same binary gibberish. Phooey. Fortunately the settings are simple.
ContrastMask function: look at the bottom of the long script in post # 110 here: https://forum.videohelp.com/threads/361379-VCR-Hi8-capture-tests-help-evaluate?p=229942...=1#post2299424. The post shows how to load the text of a function into a script. Don't try it with QTGMC.avsi unless you wanna paste 200+ lines of code. Or you can save short functions like ContrastMask as an ".avs" file and import it.
I'll repeat the function here:
Code:# ------------------- Contrastmask function used above ------------------- function ContrastMask(clip v, float "gblur", float "enhance") { enhance = default (enhance, 10.0) gblur = default (gblur, 20.0) enhance = (enhance>=0.0 && enhance<=10.0) ? float(enhance*0.1) : 1.0 v2=v.Tweak(sat=0) v2=v2.invert() v2=v2.gaussianblur(50.0,50.0+gblur) photoshop_overlay=mt_lutxy(v,v2,"x 127.5 > y 255 x - 127.5 / * x 255 x - - + y x 127.5 / * ? ") merged=overlay(v,photoshop_overlay,opacity=enhance) return merged }
Mask tools": anything that has version 1.x.x. in it is version 1. Anything that just calls itself masktool2 was for Avisynth version 2. Then came higher v2 numbers that also called themselves "masktools_25+something" and "masktools_26+something", for Avisynth 2.5 and 2.6. Of the two you mention, use 2.0.3.0 if an older function calls for it. The function docs usually tell you what they want. Frankly I think they used to just call that one "MaskTools2" as opposed to "MaskTools" or "MaskTools25". When I post a script that calls for ye olde MaskTools2 for Avisynth 2, it's usually because a function is being called that uses the old mvTools v1, which used MaskTools 1.0.x.x. Yep. Clear as mud.
What distinguishes these versions? Most of the internal function names in each version are different.Last edited by sanlyn; 19th Mar 2014 at 03:17.
-
CSamp.exe is here: http://www-personal.engin.umd.umich.edu/~jwvm/vision/projects/csamp.zip
Limited Sharpen Faster: http://avisynth.org/mediawiki/External_filters#Sharpeners -
LSF: http://forum.doom9.org/showpost.php?p=877419&postcount=10
That csamp file looks to be corupt, it's too short. Here's csamp.exe in a zip archive. -
Wonder what's up with the Csamp guy. Retired? Kicked the bucket? (Wouldn't blame him for either. Been around a long time). Csamp attached.
LimitedSharpenFaster: Another thread? Goes back a long way. Are you sure it wasn't LSFmod? (= LimitedSharpenFasterMod)? Anyway, LSF attached. I got this copy from jagabo back during The Flood.Last edited by sanlyn; 19th Mar 2014 at 03:17.
-
LimitedSharpenFaster: Another thread? Goes back a long way.
Thanks for the links. -
Oh, yes. That thread. You'll find lots of problems in that thread. Some of those brilliant ideas (ahem) are from jagabo's efforts elsewhere. Tell the truth, following troublesome samples like those is the way most people learn this stuff. Fortunately your clips look pristine compared to many. I hope the notes from me and jagabo will be helpful.
Last edited by sanlyn; 19th Mar 2014 at 03:18.
-
Beginning sanlyn's basic script for the vhs guitar clips from post 110. Sorry, but afraid it's going to be a series of "stupid newbie" questions.
ColorYUV. Is there any guide, other than exerience, to help determine initial values to try? From what I've seen from posts, looks like there's multiple settings that can give similar results, so I know it's not exact science. But where to start? I looked at analyze=true, but values didn't mean anything to me.
I'm really confused about the masktools version that was used. The LoadPlugin has masktools.dll and the only version that I've got that has that dll is v1.5.6. All the other versions (v2.x) have mt_masktools. Smoothlevels is supposed to use MaskTools v2.0a35. Can multiple versions be run at same time?
Edit1: SmoothLevels.avs is all comments???
Edit2: in ContrastMask - gaussianblur - Photoshop? where?
Edit3: Have script running except for SmoothLevels and ContrastMask.
Errors:
"mt_masktools-26.dll Above plugin names contain undesireable symbols..." <=== "undesireable"
"Exception WindowsError: 'exception: access violation reading... ignored" <=== only sometimesLast edited by dianedebuda; 25th Feb 2014 at 18:41.
-
I assume you've seen the help page on ColorYUV, but in case you haven't (and if you have, ignore the following): ColorYUV is documented here: http://avisynth.org.ru/docs/english/corefilters/coloryuv.htm . the same article that's included in Avisynth's documentation on your PC. Go to your WIndows "Programs" listing, find the Avisynth program group and expand it, then click "Avisynth Documentation".
Using it with a histogram showing at the same time is the best way, although I find that viewing an RGB histogram is more intuitive than a YUV version. A recent sample of working with ColorYUV and Smooth Levels is posted here: https://forum.videohelp.com/threads/360965-Re-Newbie-Needs-Startup-Advice?p=2301059&vie...=1#post2301059, and continued here: https://forum.videohelp.com/threads/360965-Re-Newbie-Needs-Startup-Advice?p=2301063&vie...=1#post2301063. (with pitchers!).
I know what analyze() is saying, but I've seldom used it. Most people look for the "max" and "min" values to check on valid levels. Some people say they can set the correct white balance by working on the "average" numbers. According to what I've seen of their corrections, they're always wrong.
Yes. You can have one version 1 and one version 2 in the plugins folder, but not multiple versions of v1 or v2. This works because their internal function names are different (version 2 functions start with "mt_" or use a different name altogether).
The ContrastMask script refers to a Photoshop-type layer operation. Gaussianblur is part of VariableBlur.dll, which has a fairly new version here: http://bengal.missouri.edu/~kes25c/variableblur.zip , and a wiki page with a list of its functions here: http://avisynth.nl/index.php/Variableblur .
SmoothLevels.avs was replaced long ago with SmoothAdjust.dll, in which SmoothLevels() is one of several functions. The Doom9 thread for SmoothAdjust is here: http://forum.doom9.org/showthread.php?t=154971. The download link is in the first post of that thread (which is 22 web pages long!), so here's download link from that page: http://latoninf.free.fr/d9/SA/SmoothAdjust-v2.95.7z. An early post on that same page has some sample frames showing the use of custom strings with the plugin. They are never explained. I don't have the slightest idea how those custom strings work, but I once managed to construct a few of my own. But that sort of thing is far easier and more precise in RGB (and strings aren't needed).
Likely it's because you have the old SmoothLevels (see above). The "26" version of MaskTools was designed for Avisynth 2.6, but I'm using v2.5. The '26' version gives me an error in 1 out of every 3 scripts I use it in, so I placed mt_masktools_26.dll in its own folder and load it explicitly if a plugin requires it. I can't say I ever saw the error you mention (rather, MaskTools '26' just gives me different errors !). I'm pretty sure the old "avs" version of SmoothLevels won't run with MaskTools '26' anyway. For the new SmoothAdjust.dll you need MaskTools '25' or '26' .Last edited by sanlyn; 19th Mar 2014 at 03:18.
-
ColorYUV() uses scaled integers where positive values increase the channel, negative values decrease it. Mathematically, with gain_y for example, it's Y = Y * (1.0 + val/256). So if the value is 0 you get Y = Y * 1.0, ie no change. If value is 256 you get Y = Y * (1.0 + 256/256) = Y * 2.0, a doubling of Y. If you want to increase Y by 10 percent you set val to ~26 (10 percent of 256). To decrease Y by 10 percent use -26.
-
ColorYUV: Not having a problem with the definitions of the parameters. It's a newbie thing of "where to start" - a "book learning" vs "real life". When you start with a new clip, how do you pick the initial offset & gain values?
In sanlyn's guitar script that I'm looking at, ColorYUV(cont_y=30,off_y=-10,cont_v=-20). When I look at the default avisynth histogram, I see nothing in the left or right "danger" zones. So why cont_y and off_y? What prompted cont_v? And why those values? Where they the first ones tried? Why? When I look at the histogram afterwards, things have been shifted left (some into the "danger" zone). No question the picture looks better, but the histogram didn't suggest changes to me. I'm sure most of the answer is "experience", but I'm trying to figure out how to start for my future captures. Sounds like the "why" stage of a 2-year-old, doesn't it?
You can have one version 1 and one version 2 in the plugins folder, but not multiple versions of v1 or v2. This works because their internal function names are different (version 2 functions start with "mt_" or use a different name altogether)
Thanks for the links. It isn't that I didn't try to find them myself, but ContrastMask wasn't listed as an external filter on the avisynth site and the SmoothLevels was a script of all comments. Yes, I did see the SmoothLevels has been replaced by SmoothAdjust, but I didn't see any indication that SmoothAdjust was now a dll that contained SmoothLevels. Ah, newbie growing pains.
I'm familiar with the Re-Newbie thread. I've plans to look into the scripts there as well as the Advice on What Filters to Use thread.
(Errors) mt_masktools-26.dll -
My guess is he looked at the video and thought it needed a little more contrast, hence the cont_y=30 (probably not his first guess). After that he saw that the black level was too low (and bright level not too high) so he brought it up a bit with off_y=10 (again, maybe not his first guess). cont_v is a little more difficult. That is an increase in saturation of the V channel. Maybe he looked at the U and V graphs and decided that V was consistently less saturate than U so he pumped up V. Or maybe he just thought the video need more intense pinks and cyans.
-
True, the "final version" of those values were not the first guess. None of them were. Usually one would head for contrast first, to bring levels within a desirable range. Normally, lowering the "cont_y" and other contrast settings will "shrink" the histogram bars toward the middle (and it reduces the perceived saturation at the same time when used on the U and V channels). Increasing contrast will "stretch" the bars outward at each end. And, yes, the image does look a bit green in the upper flesh tones, but overall red was oversaturated at first. If you look at what FixChromaBleeding does, it will almost always target overdone reds and leaves them looking a bit pale. The young girl's red dress at first had an unnatural "glow" to it. Once you reduce bleeding, you can tweak particular colors.
The "off" values nudge the entire histogram bar left or right. The "off" is for offset. There is also a parameter called "gain", which is usually not all that useful for me, but it works rather like offset: it does nudge things a bit left or right, but it affects the bright end more than the dark end.
Where you start depends on what you think is the worst problem. Because most VCR's tend to pump contrast and saturation, that's usually the first place to look. But don't take that as absolute. Every video has its problems, and don't forget effects that are caused by the camera. Apparently the camera had both autogain and autowhite going at once. With autogain, if bright objects enter the image, it gets darker; if dark objects dominate or affect the frame, the image changes levels again. The bright red dress affected the bright greens and reds. When the camera zooms in, some of the darks get purple (more blue was used by the autowhite circuit in the darks). Those "auto" features can make life very difficult.Last edited by sanlyn; 19th Mar 2014 at 03:18.
-
Code:
ColorYUV(cont_y=val)
Code:ColorYUV(gain_y=val, off_y=-val/2)
Code:gain: y' = y * val cont: y'= (y - 0.5) * val + 0.5
Last edited by jagabo; 27th Feb 2014 at 09:17.
-
My guess is he looked at the video and thought it needed a little more contrast
After that he saw that the black level was too low (and bright level not too high) so he brought it up a bit with off_y=10 (again, maybe not his first guess).
cont_v is a little more difficult. That is an increase in saturation of the V channel. Maybe he looked at the U and V graphs and decided that V was consistently less saturate than U so he pumped up V. Or maybe he just thought the video need more intense pinks and cyans.And it's -20, so isn't that a decrease in saturation?
sanlyn, were you able to find the script you used for the hi8 TapPractice? You said you'd archived it and would try to retrieve. Post 170 I'd like to work on the 550 and DV versions of that clip so maybe I can better see problems/solutions that have been described. It be great if you could remember/improvise what you first tried at the settings for ColorYUV too.
In general, it looks like ColorYUV is the first filter applied, probably because it uses the same color space as the capture. Subsequent filters may require more tweaking. Got that right? And it looks like it's almost always used, so that's why I'm focusing on it.
Edit: Got SmoothLevels & ContrastMask (VariableBlur) operational. Now to comment out all to start from ColorYUV and add slowly 1 at a time. Wish there was a GoTo/Label, if-then structure in avisynth.Last edited by dianedebuda; 27th Feb 2014 at 13:30.
-
I missed the negative sign. -10 will subtract 10 from every pixel, making the picture darker. So he must have decided that the black level was still to high after the contrast increase. And further contrast increase would push the brights too bright. You would be able to see that easily with VideoScope() or Historgram().
Wow, again I missed the negative sign. -20 would decrease the saturation.
Sorry about those mistakes. But the fact that you caught them indicates you have a basic understanding of the functions. You may or may not agree with Sanlyn's exact adjustments. It's up to you to decide how much contrast or saturation you want. There's not necessarily a "right" value. -
Thanks, jagabo for confirmation that I'm interpreting correctly. I know the settings are subjective and I'm a-huntin' for a method to find "my" way. I don't think sanlyn would be too receptive to my submitting a clip from all of my captures for tweaking.
I've got a 3 pane stack with orig, my test and sanlyn's that I'm playing with right now. His sure looks good. See the girl's white shirt as "too white", so maybe that's why the off_y=-10. But the histogram then shows other blacks in the low "danger" area, so maybe have to play with gain. The girl's red skirt is a touch "too red", so maybe that's why the off_v=-20. -
Actually I didn't even sue ColorYUV. Reason: the levels in the 550 capture were OK, so mostly I tweaked color and midtones with VirtualDub. All I used in YUV was SmoothLevels to smooth out the histogram a little with some dithering that helped soften hard contours in skin tones. Never did get to tweak things entirely. Another project got in the way (big time!). So the script is really an unfinished work.
Did some eperimenting to try to reduce some of the alaising and edge sparkle on motion. It "sort of" worked, but eventually I eneed up making a progressive version that I don't have now. Reducing edge problems is rather destructive of detail, so later I'd try to play around with different methods.
I'm attaching the script I used. It called some filters you might not have. It loads three VirtualDub filters as well, so I included them in the attached .zip.
One note on this script, since I don't have time to totally clean it up: It begins with a line that looks like this:
Code:vidpath="E:\forum\diane04\i\"
Why would anyone do this? If you're have 3 PC's and you copy scripts and videos all over the place, they won't always be in the same location on each PC. Rather than give myself a hard time trying to change all the path statements, I invent a little storage closet called vidpath, so all I have to do is change the text in that path.
Later in the script you'll see vidpath concatenated ("+") with a file name. So this coded statement
Code:AviSource(vidpath+"c_00.avi")
Code:AviSource("E:\forum\diane04\i\c_00.avi")
Code:ppath="D:\Avisynth 2.5\plugins\"
Code:Import(ppath+"HQdering.avs") Import(ppath+"FixChromaBleeding.avs") Import(ppath+"VInverse.avs")
Code:Import("D:\Avisynth 2.5\plugins\HQdering.avs") Import("D:\Avisynth 2.5\plugins\FixChromaBleeding.avs") Import("D:\Avisynth 2.5\plugins\VInverse.avs")
Code:LoadVirtualDubPlugin(Vdubpath+"exorcist.vdf", "exorcist", 1) LoadVirtualDubPlugin(Vdubpath+"ColorMill.vdf", "ColorMill", 1) LoadVirtualDubPlugin(Vdubpath+"gradation.vdf", "curves1", 1)
Code:LoadVirtualDubPlugin("D:\VirtualDub\plugins\exorcist.vdf", "exorcist", 1) LoadVirtualDubPlugin("D:\VirtualDub\plugins\ColorMill.vdf", "ColorMill", 1) LoadVirtualDubPlugin("D:\VirtualDub\plugins\gradation.vdf", "curves1", 1)
Usually I don't load a bunch of VirtualDub filters in a script. It slows things. And changing the values in VirtualDub means changing the script.
As jagabo said earlier, not everyone likes the same color settings. What you can do to test how those VirtualDub filters affect the script is to make another copy of the script and delete the VirtualDub filter lines. Also, if you run an Avisynth script with the original clip and look at it with a YUV histogram or waveform, you'll see that the levels were set pretty well during capture. Saves a lot of work.Last edited by sanlyn; 19th Mar 2014 at 03:19.
-
sanlyn, thanks so much. And the filters too. I have no problem with the paths, variables, etc. I have 6 computers in my bedroom alone (3 active daily), so I can appreciate not hard-coding file locations. I do the same thing. You're a treasure.
-
Identified where WindowsError is happening: Interleave(e1,o1)
It's right after using ColorMill on the even frames (e1) and the odd frames (o1) to match colors.
Actual error says:'exception: access violation reading 0x51D5001F in <bound method PIScriptEnvironment. __del__ of <avisynth.PIScriptEnviroment instance at 0x038CF148>> ignored
Tried to google for WindowsError for Interleave, but found nothing. Something to worry about? -
Often you have to reboot your PC, or shut down VirtualDub temporarily, to regain some RAM. It could also mean that your hard drive is getting somewhat fragmented. Occasionally I move a lot of stuff off of a congested drive and then move it back again.
Last edited by sanlyn; 19th Mar 2014 at 03:19.
-
You may have hit a bug in AviSynth of one of the filters. If you're using a multithreaded build of AviSynth try a different mode or number of threads. Try running the filters in different orders where possible. Try different versions of the filters. Or try running ~half the filters, saving to a lossless temp file, then running the other half on the temp file. I find this sort of problem usually crops up when one uses multiple filters that use mvtools.
Similar Threads
-
Hi8 Capture problem
By manyon in forum Capturing and VCRReplies: 2Last Post: 24th Nov 2013, 18:05 -
Hi8 capture- Suggestions for Harddrives and Capture Cards?
By CMP1223 in forum Capturing and VCRReplies: 7Last Post: 10th Jun 2011, 23:05 -
Should I capture VCR, 8mm and Hi8 tapes to MPEG2 or MPEG4?
By dorenhagen in forum Capturing and VCRReplies: 18Last Post: 25th Jan 2011, 22:00 -
How to evaluate your work
By persephone in forum Newbie / General discussionsReplies: 5Last Post: 17th Jan 2011, 11:42 -
Hi8 VCR help
By Famicoman in forum Newbie / General discussionsReplies: 1Last Post: 27th Oct 2010, 18:32