Hmm, thanks for that info jagabo. I read some time back on Doom9 about ColorYUV and its nuances. Thanks for the tips.
I note that when I make lots of channel changes in a single statement, it can get to be pretty lengthy and it's easy to change "u" instead of "v" by oversight and so forth, so I separate them. And check the histograms and scopes to make certain I'm getting what's intended. If one also uses something like AutoWhite (yech!) or SmoothLevels with ColorYUV, the sequence can have different effects as well.
+ Reply to Thread
Results 31 to 56 of 56
-
Last edited by sanlyn; 21st Mar 2014 at 10:01.
-
Sanlyn can you help me with post 29: https://forum.videohelp.com/threads/351958-How-to-remove-tint-with-Avisynth?p=2214841&v...=1#post2214841
I'd rather not have 2 instances of Tweak (yours and mine) so I'd like to know what values you would use. -
The line ColorYUV(cont_y=75,off_y=4, cont_v=-20) is equivalent to the ColorYUV I posted.
I'm not sure whether you're saying you added the code you specify, or you replaced the original code with your Tweak and RGBAdjust. Neither method will give a proper image. You're working without histograms or other guides, and an uncalibrated monitor.
The YUV scopes below show what Section 1 and Section 2 look like in terms of luma and color data distribution. This is from the original, unprocessed mpg (Black borders are removed, as they will always show an RGB 0 peak in histograms). Section 1 up to the last good frame (246) is on the left. The image change in the next frame (Section 2) is on the right. You can see that the scopes describe images with an entirely different look.
Section 1 (Left) shows crushed darks, but they don't extend below RGB 16 or so. The data starts cutting off sharply at the green line in the middle of the scope (midtones), but there are specular highlights out to RGB 255.
Section 2 (right) has crushed dark detail that doesn't go below RGB 30 or so, and no bright data above RGB 144. The image looks washed out because of the very limited range of data. The bright spots on the right-hand side of the right scope show bright detail is badly clipped at RGB 144. A simple pixel sampler will give you those values.
[Attachment 15882 - Click to enlarge]
(Below) Original mpg translated into RGB TV range. You can see crushed darks and the limits of dark and bright data. Section 1 on the left, section 2 on the right.
[Attachment 15883 - Click to enlarge]
Section 1 and 2 - rgb original.png
(below) Section 2, YUV (left) and RGB (right). If you mean to add the code you specify, I take it to mean that your statements would this way:
Code:ColorYUV(cont_y=75,off_y=4) ColorYUV(cont_v=-20) Tweak(coring=false,cont=1.4, Sat=1.8) SmoothLevels(0,0.90,255,12,235) Tweak(Hue=-10, Sat=1.5, Bright=-30, Cont=1.2, Coring=False) ConvertToRGB32(interlaced=true) RGBAdjust(1.0, 1.0, 1.2) ConvertToYV12(interlaced=true)
[Attachment 15884 - Click to enlarge]
(below) If you mean that you replace the ColorYUV statements with your Tweak and RGBAdjust, then the code still has crushed darks below the valid TV range, the clipped brights are darker than in the original, and the red tint is replaced with a blue color cast at the bright end.
[Attachment 15885 - Click to enlarge]
(below) Section 2 using the code in post #8. There is still work to be done, which I did in VirtualDub, but the luma and chroma range is within valid RGB TV limits, some dark detail has been elevated, and the clipped brights have been smoothed a bit. You can juice that up with more YUV and RGB statements, but this Section 2 is a closer match to Section 1 as a starting point for more tweaks.
[Attachment 15886 - Click to enlarge]
I don't think you understand the difference between the way valid TV 16-235 range is displayed on PC monitors and TV. They don't display the same way. If you want TV display, you have to process with that intention in mind. If you want a PC range of RGB 0-255, then work that way. But PC range will look rather stark on TV.Last edited by sanlyn; 21st Mar 2014 at 10:01.
-
Yes I want it for a TV display. The script you mentioned - I did the first tweak and you did everything else. As you say it doesn't look right. What script would you suggest to fix the problem? I assume we only need 1 Tweak line?
-
I don't see why two Tweaks would be needed. I just did as much as I could with YUV, then went to VirtualDub and the gradation curves.
I don't think you can fully correct those two sections to look so much alike in YUV alone. The problem is addressing very narrow RGB luma and chroma ranges, which is very difficult in YUV. I don't say it's impossible, but I do say that doing it in YUV alone is a real hassle. I made two versions of the video, matching them as close as I could in YUV (meaning that their histograms looked similar), then opened each section in a separate instance of VirtualDub, used RGB filters, and jockeyed back and forth between the two to make them look (more or less) alike at the joining point-- which, if you're looking for a perfect match, can't be done because both sections are so corrupt to begin with. Mainly, Section 1 has very little dark data and section 2 has very little bright data. It's like trying to make an orange and an onion both look like an apple.
You really can't do this sort of thing without experimenting more with color and using tools like histograms and pixel samplers. It ain't possible. I must have gone through 8 versions of each section before I got what I wanted. If I recall, both sections with their respective scripts came out of Avisynth looking a lot more alike. The rest was in VirtualDub. VDub wasn't that much more, but it couldn't be tweaked that well in YUV.Last edited by sanlyn; 21st Mar 2014 at 10:02.
-
Can't the VDub scripts be used without VirtualDub as I don't use that program? If so could you please give me your final script. If not, I'd be happy with whatever script you had before you used VirtualDub.
-
Yes. Some of them are difficult to configure, some are simple (like DeFlicker, which has only a handful of values to set).
What's the difference between Converting to RGB32 in Avisynth and loading VirtualDub plugins in a script, then converting back to YV12 -- as opposed to Converting to RGB32, loading the video in VirtualDub and running plugins, and then saving the results as YV12?Last edited by sanlyn; 21st Mar 2014 at 10:02.
-
All I was looking for was a script I could use to do the colour and brightness corrections but we keep going round in circles and I needed this 2 days ago. I'm just going to use what you originally told me as it's better than nothing.
-
On another video I have the same colour and brigthness issues as section 2. Only part of the video has that problem so I used the following script on it:
Code:filtered=ColorYUV(cont_y=75,off_y=4, cont_v=-20). Tweak(coring=false, cont=1.4, Sat=1.8, Hue=-5). SmoothLevels(0,0.90,255,12,235) ReplaceFramesSimple(last,filtered,Mappings="[0 5194]")
Code:ColorYUV(cont_y=75, off_y=4, cont_v=-20) Tweak(coring=false,cont=1.4, Sat=1.8, Hue=-5) SmoothLevels(0,0.90,255,12,235)
-
It would appear to me that the way you used your one line of code, "last" applies to what you did with ColorYUV and Tweak.
Here's one way to do it:
Code:unfiltered=last filtered1=last.ColorYUV(cont_y=75,off_y=4, cont_v=-20). Tweak(coring=false, cont=1.4, Sat=1.8, Hue=-5). SmoothLevels(0,0.90,255,12,235) filtered2=ReplaceFramesSimple(unfiltered,filtered1,Mappings="[0 5194]") # -- use the next statement ONLY if you have MORE code --- # to execute. If not, DON'T USE this statement. ------ # This statement applies remaining code to filtered2 --- filtered2 ...blah... ...blah... ...blah... return last # --- if the ReplaceFramesSimple line is the ---- # --- END of the script, Use THIS statement ---- return filtered2
Last edited by sanlyn; 21st Mar 2014 at 10:03.
-
I tried the 1st 3 lines of that and it still looked different than if I hadn't used ReplaceFramesSimple.
I tried trim instead and it worked:
trim(0, 5194). ColorYUV(cont_y=75,off_y=4, cont_v=-20). Tweak(coring=false, cont=1.4, Sat=1.8, Hue=-5). SmoothLevels(0,0.90,255,12,235)Last edited by VideoFanatic; 23rd Jan 2013 at 16:43.
-
Did you say this trouble spot was "on another video" ? Not the same video the last clip came from?
Last edited by sanlyn; 21st Mar 2014 at 10:04.
-
Yes I'm working on a few other videos which have the exact same colour and brightness issues. I tried the 1st 3 lines of what you last suggested and it still looked different than if I hadn't used ReplaceFramesSimple.
I tried trim instead and it worked:
trim(0, 5194). ColorYUV(cont_y=75,off_y=4, cont_v=-20). Tweak(coring=false, cont=1.4, Sat=1.8, Hue=-5).
SmoothLevels(0,0.90,255,12,235)
I'm a bit confused because I started using ReplaceFramesSimple because it would allow me to have part of each script on a new line which trim didn't allow me to do. Yet I tried trim as above and it DID allow me to enter stuff on a new line. There must have been a different kind of filter like trim that I used before but I can't remember it.
Thanks for your help. The settings make quite a difference. -
Glad it's working.
For video in poor shape like this, you should start experimenting with VurtualDub's color filterws. Two are all you need. Many times, nothing else will do. Hell, Adobe and Vegas charge big $$$$ for theirs. VirtualDub's are free!Last edited by sanlyn; 21st Mar 2014 at 10:04.
-
Sorry to mess you about but it seems it's not working again and I remembered why I stopped using trim in the first place. It was because the 2nd trim and subsequent trims must all be on the same line which doesn't make it easy to read what you're doing when you have to use the horizontal slider to see everything.
I tried the 1st 3 lines of what you said in post 41 and got a different brightness than if I hadn't used ReplaceFramesSimple such as using the colour filters on their own like this:
Code:ColorYUV(cont_y=75,off_y=4, cont_v=-20) Tweak(coring=false, cont=1.4, Sat=1.8, Hue=-5) SmoothLevels(0,0.90,255,12,235)
Is DAA3 just for anti-aliasing or does it do other stuff as well? If I'm keeping the video interlaced should I just use Daa3 like this?
Code:Daa3() AssumeTFF() QTGMC(Preset="Super Fast") SeparateFields() SelectEvery(4,0,3) Weave()
Last edited by VideoFanatic; 23rd Jan 2013 at 18:41.
-
There are a great many filters that won't run in MT.
I have no idea what your script is doing. Can you post it? Don't need the open file statements, etc., just the lines that show your processing.Last edited by sanlyn; 21st Mar 2014 at 10:04.
-
Why is a period needed when it works without one?
Are there any other useful little scripts like Daa3 (not necessarily anti-aliasers) that work on any video which will make improvements to a video?Last edited by VideoFanatic; 24th Jan 2013 at 10:33.
-
A period pipes the output of one filter to another. A space is the same as a newline, white space, indicating a new command. For example:
Code:AviSource(...) inv = Invert().FlipVertical() FlipHorizontal()
Code:AviSource(...) inv = Invert() FlipVertical() FlipHorizontal()
In the second case inv is created from the source inverted. Then the source is flipped vertically and flipped horizontally. The final output is the video flipped vertically and horizontally. inv isn't used.
The second script is the same as:
Code:AviSource(...) inv = Invert() FlipVertical() FlipHorizontal()
Code:last = AviSource(...) inv = Invert(last) last = FlipVertical(last) last = FlipHorizontal(last) return(last)
Last edited by jagabo; 24th Jan 2013 at 17:57.
-
@jagabo, your explanation is what I was trying to describe. Thanks for putting that thought into words.
Last edited by sanlyn; 21st Mar 2014 at 10:04.
-
-
The problem is not a lack of documentation, the problem is that the documentation is not easy to understand for the average guy especially if you're not a coder.
I read the grammar page and didn't see it mention periods. I looked at that other page but that just contains links to lots of other pages, a clicked on a few but the way it explains things is not easy to understand and is really off putting so I don't bother looking at the other pages.Last edited by VideoFanatic; 29th Jan 2013 at 18:07.
-
Why go on the internet for the Avisynth docs? They're installed on your computer.
I don't think any of them run in MT Mode AFAIK, I don 't use MT because it's not ready for prime time and too many filters either won't work in MT or just ignore it. Maybe other members can suggest. It's surprising you don't know about other anti-alias filters, you've previously used at least SangNom (dll) and/or Santiag (avs). And there's also the original Daa, which is slower, been around a long time, is stronger, but doesn't know if it's in MT or not.
You can always run one script with your MT plugins, save it, then use the results to run non-MT stuff that won't work in MT. People do this all the time.
The business with periods was explained earlier in Post #49. Avisynth docs do mention it, describing it as a form of OOP notation (Object Oriented Programming) . But you don't need to know OOP programming to see what the periods do: they join a sequence of operations into a compound procedure. Scripts you see posted here often use periods to chain a sequence of operations that apply to a single object. If you copy those statements and paste them from script to script, why would you leave out the formatting that worked in the original? Omitting punctuation invites problems, and doesn't make scripts run faster.Last edited by sanlyn; 21st Mar 2014 at 10:04.
-
Hi, iīm having a similar problem
The video is from an old VHS or telecined film. The images are:
http://i41.tinypic.com/23hx853.jpg
http://i40.tinypic.com/2wlxzps.jpg
I tried to follow the instructions at http://www.engon.de/audio/vhs4_en.htm
but it didnīt worked -
Those instructions don't work with any and all videos. In this case there's little anyone can do with jpg's after multiple colorspace conversions. You have to work with the original video in YUV first. The jpg of the figure on the mountain looks like tinted monochrome. You would first convert to grayscale in its original colorspace, then fix levels and restore a more even sepia tint (or just leave it monochrome).
Last edited by sanlyn; 21st Mar 2014 at 10:05.
Similar Threads
-
How to remove or smooth away tape header noise with Avisynth?
By VideoFanatic in forum RestorationReplies: 3Last Post: 20th Oct 2012, 21:18 -
how to remove logo by avisynth scripts and filters?
By poluhale2 in forum EditingReplies: 15Last Post: 8th Oct 2012, 08:31 -
Remove an opaque logo using Xlogo in Avisynth
By AlanHK in forum User guidesReplies: 34Last Post: 4th Oct 2012, 23:17 -
Color/tint brightening with avisynth?
By darkdream787 in forum DVD RippingReplies: 8Last Post: 18th May 2012, 12:48 -
Avisynth filters to remove mosquito noise without softening
By AlanHK in forum RestorationReplies: 8Last Post: 7th Jan 2010, 23:49