#21  
02-20-2015, 01:30 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
OMG, another long post. Sorry,people.

The script below was used for initial chroma cleanup as shown in the previous images. I'll explain the filters and how to get them. Those used here are attached below. All of them are in standard use everywhere. You'll see them often.

Code:
Import("D:\Avisynth 2.5\plugins\chubbyrain2.avs")

AviSource("E:\forum\sirbyron\C\Chs1981Samplecc.avi")
Crop(14,0,0,-10).AddBorders(2,0,0,2)
ConvertToYV12(interlaced=true)
AssumeTFF().QTGMC(preset="medium",EZDenoise=1)
ColorYUV(off_y=-14)
Cnr2("xxx",4,5,255)
ChromaShift(c=-8,u=-2,L=-4)
chubbyrain2()
MergeChroma(awarpsharp2(depth=40))
MergeChroma(awarpsharp2(depth=20))
ConvertToRGB32(matrix="Rec601",interlaced=false)
Like all first efforts, this is a trial run. Can be adjusted later.

Import("D:\Avisynth 2.5\plugins\chubbyrain2.avs") imports the script of an .avs plugin. The developer spent time on this, so don't change anything. All the import statement does is bring a copy of the plugin into Avisynth. It's easier than copying the text of the plugin yourself.

Note that I have some path locations in this script that you'll have to adjust to match the locations in your PC. My Avisynth program folder is at D:\Avisynth 2.5, but yours is probably in C:\Program files\Avisynth 2.5, or whatever.

Also note that your avi sample will have a different location in your system.

Crop(14,0,0,-10).AddBorders(2,0,0,2): Let's cut off most of the black borders to keep from affecting some of these filters. I cut off 10 pixels from the left, none from the top, none from the right border, and 10 from the bottom border. There are crop restrictions depending on colorspace (at this point in the script your video is YUY2). AddBorders adds some black border pixels to the left side and the bottom. Why? Because the script will soon convert the colorspace to YV12 and all dimensions for YV12 must be mod-4 for cropping. (mod-4 = equally divisible by 4). The resulting frame size will be 628x472. We can adjust that again later. Note that this statement involves two steps, separated by a period.

ConvertToYV12(interlaced=true): Most filters that follow the Crop statement require YV12 color.

AssumeTFF().QTGMC(preset="medium",EZDenoise=1): Okay, well, here's the big fella. It's set to "medium" defaults, so its about medium-fast. Or medium-slow, however you want to look at it. It requires a dozen support plugins, all of which are in the attached plugins .zip. They're also available in the doom9 forum. QTGMC will deinterlace this clip, doubling the frame rate and the number of frames. Reason: the filters that follow it require progressive video. So if you look at "File Info" in VirtualDub it will say 746 frames @59.940 fps. AssumeTFF() ("Top Field First") is an Avisynth function. Otherwise it would assume BFF, which is wrong for this video.

ColorYUV(off_y=-14): Reduce the brightness of all pixels by about 14 points. Will be adjusted later. The sample frames posted earlier are from the brightest point in the sample.

Cnr2("xxx",4,5,255)
ChromaShift(c=-8,u=-2,L=-4)

chubbyrain2()

These are chroma cleaners. They're included in the .zip file, each in their own folder inside the .zip. The text string that's fed to cnr2 is a recommended setting for crappy VHS. It can be adjusted. Chubbyrain2.avs requires an additional plugin (BiFrost.dll), which is also in the .zip. ChromaShift.dll will shift the position of colors using a semi-transparent mask and other tricks, in this manner: C=-8 shifts all colors 8 points to the left, u=-2 shifts the blue channel 2 pixels to the left, L=-4 shifts all colors 4 pixels upward. We'll do more of this in RGB later.

MergeChroma(awarpsharp2(depth=40))
MergeChroma(awarpsharp2(depth=20))
Two rounds of this filter to help with smeared chroma. The sharpener itself tends to tighten edges, depending on how much area around the edges we want to work with ("depth"). There are other settings that can get pretty hairy, but keep it simple for now. "MergeChroma" is an Avisynth function. What it does is take the results of the awarpsharp2 filter and apply only the chroma filtering to the existing video, leaving the original "y" (luma) channel as-is to preserve more detail.

ConvertToRGB32(matrix="Rec601",interlaced=false): I guess you know what that does, done here only for viewing. We'll do more YUV work later. Note that "interlaced" is false (because the video is now deinterlaced), so I could just as well have written "ConvertToRGB32(matrix="Rec601". But I like to keep the interlaced thing in there just to make me feel comfy.

The attached .zip contains 4 folders: aWarpSharp2, Cnr2, ChubbhyRain2, and QTGMC. It will unzip into separate folders, and inside each folder are the filters. QTGMC has 3 subfolders and instructions in each subfolder, so be sure to look at the "read Me" stuff and "Where to put these files". Anything with .dll, .avsi, or .avs should be copied into the Avisynth plugins folder. The rest stays put. QTGMC has a couple of "Windows system" dll's that DO NOT BELONG in Avisynth. They are not Avisynth plugins, but you better have 'em around. The subfolder with those two dll's tells you where they go. Most of QTGMC's support plugins can be used alone, and are used by many other filters.

First time around, there are bound to be problems. Nothing that can't be solved. If you get errors, post the exact text of the message.

And don't worry yet. The tough part will be color in VirtualDub.


Attached Files
File Type: zip plugins.zip (30.49 MB, 52 downloads)

Last edited by sanlyn; 02-20-2015 at 01:41 PM.
Reply With Quote
The following users thank sanlyn for this useful post: cicaesar (04-11-2020), sirbyron (02-20-2015)
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #22  
02-20-2015, 11:16 PM
sirbyron sirbyron is offline
Free Member
 
Join Date: Jun 2012
Location: NC, USA
Posts: 46
Thanked 0 Times in 0 Posts
Got everything loaded and working, no problems!

This is a big help and i am most grateful. Had to familiarize myself with Avisynth "plugins" vs "functions"... that threw me for a few secs.

Quote:
Originally Posted by sanlyn View Post
Crop(14,0,0,-10).AddBorders(2,0,0,2): Let's cut off most of the black borders to keep from affecting some of these filters. I cut off 10 pixels from the left, none from the top, none from the right border, and 10 from the bottom border. There are crop restrictions depending on colorspace (at this point in the script your video is YUY2). AddBorders adds some black border pixels to the left side and the bottom. Why? Because the script will soon convert the colorspace to YV12 and all dimensions for YV12 must be mod-4 for cropping. (mod-4 = equally divisible by 4). The resulting frame size will be 628x472. We can adjust that again later. Note that this statement involves two steps, separated by a period.
I understand this for the most part except that if you cut 10 from the left, why does it say "14"?
I understand mod-4 = equally divisible by 4. I am thinking 2 + 14 = 16 (which is still divisible by 4) and -10 + 2 = -8 (also divisible by 4).

I dont think the zip file had the Cnr2 plugin. I found it and downloaded it though. No prob. Thanks for that zip file. Made things a lot easier.

Quote:
Originally Posted by sanlyn View Post
Reason: the filters that follow it require progressive video. So if you look at "File Info" in VirtualDub it will say 746 frames @59.940 fps. AssumeTFF() ("Top Field First") is an Avisynth function. Otherwise it would assume BFF, which is wrong for this video.
So is it TFF because its interlaced, then the QTGMC plugin deinterlaces it and it becomes progressive?

Quote:
Originally Posted by lordsmurf View Post
I hate color correcting in Avisynth, and almost never do it.

I'd rather use:
- VirtualDub, especially Color Mill
- Adobe Premiere, and I use CS4

For me, Avisynth is only used for specific errors that are not as easily done in Vdub or Premiere.

Script-based corrections take forever. This really is a GUI workflow.
Yeah...if possible I do like using the Vdub filters..really like Color Mill from what I've experimented so far. I do need to get me a good program also such as Adobe Premiere, etc. Scripts are a pain but if they correct my ole crappy tapes better I guess I can learn them .... as best as I can anyways! lol.

Ok..Saturday no work so I get to spend some time at home here on the video.
Reply With Quote
  #23  
02-20-2015, 11:45 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Ooops, You caught me red-handed in a typo. The correct numbers for Crop in the script are (14,0,0,-10), so it's 14 pixels off the left side instead of 10. It could have just 12, but there's 2 pixels of solid junk on the side that flutters during play. Anyway, typos do crop up (pardon the term) after you change a script 37 times, LOL!.

Actually the video isn't TFF because it's interlaced. It is interlaced using Top Field First as its field structure. That's in contrast with Bottom Field First (BFF), which is usually for DV. An interlaced frame will play 2 fields each second; the field priority of TFF or BFF tells your playback system which field is supposed to play first.

Any color work done in YUV will be only to secure valid and stable video levels. Those are general prep corrections before getting into RGB and VirtualDub or into other RGB apps for something more precise. Touchy color correction is difficult if not impossible in YUV -- but touchy invalid levels correction is difficult if not impossible in RGB.

It would be an understatement to say that the tape you're working with is thoroughly ruined. The original camera's autogain and autocolor has made, in this one short scene of your sample, what appear to be 3 distinct videos with three different luminance levels and color balance motifs. Color grading this beast involves a 3-stage correction process IMO. You'd need some masking, too, to fix that magenta stain along the top middle. Apparently the original tape was stored for several years in an oven next to an industrial humidifier and a huge electromagnetic device (!). I managed to make some progress with it, but I'm letting it steep overnight.

If you don't have the Lagarith lossless compressor, you'll need it to work with YV12. Simple install. Get it here: http://lags.leetcode.net/codec.html
Reply With Quote
The following users thank sanlyn for this useful post: sirbyron (02-22-2015)
  #24  
02-22-2015, 12:45 AM
sirbyron sirbyron is offline
Free Member
 
Join Date: Jun 2012
Location: NC, USA
Posts: 46
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by sanlyn View Post
Ooops, You caught me red-handed in a typo. The correct numbers for Crop in the script are (14,0,0,-10), so it's 14 pixels off the left side instead of 10. It could have just 12, but there's 2 pixels of solid junk on the side that flutters during play. Anyway, typos do crop up (pardon the term) after you change a script 37 times, LOL!.
Good to hear because I thought my brain quit working. lol


Quote:
Originally Posted by sanlyn View Post
It would be an understatement to say that the tape you're working with is thoroughly ruined. The original camera's autogain and autocolor has made, in this one short scene of your sample, what appear to be 3 distinct videos with three different luminance levels and color balance motifs. Color grading this beast involves a 3-stage correction process IMO. You'd need some masking, too, to fix that magenta stain along the top middle. Apparently the original tape was stored for several years in an oven next to an industrial humidifier and a huge electromagnetic device (!). I managed to make some progress with it, but I'm letting it steep overnight.
Yes, I do realize the tape is pretty bad. Weird thing though is that it was transferred (recorded) around 1984 or 1985. I have had the tape in the house (not garage) and in its plastic case all these years. It is a Memorex Pro Series T120 tape. Of course all that means nothing if the original copy was trash. Someone else did the transfer all those years ago so I have no idea the quality of the tape he had, or what he recorded it from and to. As I recall it has been pretty much like this since then. I think the camera was just crappy maybe plus over the years I am sure it has deteriorated to some degree.

I realize its never going to be "great" or maybe even under most peoples standards "good" but I just want to go ahead and get it transferred now before it deteriorates more. To be honest there are 2 more competitions on this tape. The 2nd one is about the same but better color ... still chroma issues though. The 3rd is a nightmare because it was recorded at night under football field lights...tons of yellow/green smear. This one and the 2nd year I was marching are great compared to that last one! lol!

I'll get the Lagarith compressor installed tomorrow.

One quick question. On the QTGMC plugin, I assume you are only using "some" of all the tools in that plugin? So if thats the case do you edit the script frequently or just tell it which tools you want to use in parenthesis? i.e. in this case (preset="medium",EZDenoise=1)

Cant say it enough..thanks for the time and help on this!
Reply With Quote
  #25  
02-22-2015, 03:12 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,503
Thanked 2,449 Times in 2,081 Posts
Quote:
Originally Posted by sanlyn View Post
It would be an understatement to say that the tape you're working with is thoroughly ruined.
No. You're overstating things. It's not "thoroughly ruined". The signal simply has mild color damage, which can be compensated for to a degree. Let's save "thoroughly ruined" for nth generation tapes with a dozen flaws or more.

I would actually suggest undersaturating it some, and darkening the luma midtones some.

Also realize that band videos, even now in 2015, are not shot very well. It's always a local budget shop, with lower-grade equipment, often with lower-knowledge folks operating the camera. Only in a few cases (BOA Grand Nationals, for example) do you end up with quality shooting. Most local, regional, and even state-level contests (not to mention plain ol' football games) are a shoddy job.

I've restored a lot of band videos over the years. This is a very typical issue here.

After Avisynth work, run the VirtualDub CCD filter. It will further fix the color bleeds.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
The following users thank lordsmurf for this useful post: sirbyron (02-22-2015)
  #26  
02-22-2015, 06:54 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Quote:
Originally Posted by lordsmurf View Post
No. You're overstating things. It's not "thoroughly ruined". The signal simply has mild color damage, which can be compensated for to a degree. Let's save "thoroughly ruined" for nth generation tapes with a dozen flaws or more.
I'll go along with that.

Quote:
Originally Posted by lordsmurf View Post
I would actually suggest undersaturating it some, and darkening the luma midtones some.
Of course (and I already did that in Avisynth and VDub), but the before/after demos were oversaturated to show the chroma problems better.

Quote:
Originally Posted by lordsmurf View Post
I've restored a lot of band videos over the years. This is a very typical issue here.
I'm sure they're mostly godawful. Add camera shake and kamikaze zoom techniques in the bargain, LOL!

Quote:
Originally Posted by lordsmurf View Post
After Avisynth work, run the VirtualDub CCD filter. It will further fix the color bleeds.
CCD did little for color bleeding here, but I did include it for other reasons.

For sirbyron, this is some of stuff to deal with:

This video has near zero saturation. You see little color density until you saturate a bit and see the reddish-magenta stain along the top and upper middle. There is no identifiable color anywhere, not even white or gray. The O.P. sez the uniform trousers are maybe Navy blue. I don 't think so, as Navy blue comes in varying brightness ranges but has no green and no red in it. The blue trousers in this video aren't even blue, they're slate gray which is ~30% red, ~30% green, and ~40% blue. In the opening frames they have no blue at all. More likely they might have been what's called Royal Blue, which has no red, but has about 25% green and the rest blue. In any event, there's no way a real Navy Blue will show up in the clip unless one can accept a dark blue audience and blue trees in the opening frames. That's a major issue with the old autowhite camera circuits: by the time autowhite or autocolor were through with their dirty work, there were usually no whites at all, just discolored grayish thingies with color casts.

Even with mild saturation you get odd effects. The shadow side of the girl's face in the original isn't darkish tan or near-brown, it's greyed-out purple. She wears blue, white, and pink -- the pink scarf and sash are hardly visible and appear gray at first. The sunlit side of her face is not a skin color, but more like neutral gray wallpaper with a very slight tan tint in it. The band's blouses aren't yellow, but are grayed-out yellow-greens that turn more orange at the upper left of the image. The sun is off to the right and low, it's maybe 4-PM, October-November. But there's no sign of that kind of warmish color balance or contrasty side lighting anywhere. The way in which "auto" features in consumer cameras louse up everything in this manner is what kept me from using them.

During the zoom, camera autogain washes out everything and blows away all highlight detail. Near the middle of that zoom you encounter the magenta stain, and the gray rear fence and trees turn pink. What you can play with are saturation and midtones. The midtones can be lowered by decreasing gamma or lowering the middle point with color mill or curves. This will make the upper shadows look dark around RGB 64, so use curves to brighten that a bit. Unfortunately if you make the ending scene look OK the beginning will look dim and too contrasty. If you fix up the beginning, the ending will be out of whack.

Cleaning tape noise, spots, dropouts, and edge shimmer wasn't all that difficult. My script and filters are a total mess right now, so I have to clean them up before I can post.

And, yes, you can set up QTGMC with a number of values that change the way it behaves. You can play with awarpsharp2 as well. I already did that, as you'll see. However, the default settings are optimized for decent speed performance. The more options you change, the slower things go.

Last edited by sanlyn; 02-22-2015 at 07:06 AM.
Reply With Quote
The following users thank sanlyn for this useful post: sirbyron (02-22-2015)
  #27  
02-22-2015, 07:46 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,503
Thanked 2,449 Times in 2,081 Posts
Quote:
Originally Posted by sanlyn View Post
I'm sure they're mostly godawful. Add camera shake and kamikaze zoom techniques in the bargain, LOL!
No, the biggest irritant is left/right camera movement with the marching band. It really gives you a headache. What it says is that the shooter didn't have a wide enough lens. At least in the digital age, we have more resolution, better wide lenses, and widescreen. (WS because the top/bottom was always nothing. Sadly, no thanks to compression, many squander the extra res.)

Band videos are one of the things that push my Avisynth skills.

Aside from this mini topic (not ruined!), I think your explanations and samples are excellent. I have nothing to add here.

For example, I don't think he'd gain much by tweaking QTGMC.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
The following users thank lordsmurf for this useful post: sirbyron (02-22-2015)
  #28  
02-22-2015, 09:02 PM
sirbyron sirbyron is offline
Free Member
 
Join Date: Jun 2012
Location: NC, USA
Posts: 46
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by sanlyn View Post
The O.P. sez the uniform trousers are maybe Navy blue. I don 't think so, as Navy blue comes in varying brightness ranges but has no green and no red in it. The blue trousers in this video aren't even blue, they're slate gray which is ~30% red, ~30% green, and ~40% blue. In the opening frames they have no blue at all. More likely they might have been what's called Royal Blue, which has no red, but has about 25% green and the rest blue. In any event, there's no way a real Navy Blue will show up in the clip unless one can accept a dark blue audience and blue trees in the opening frames. That's a major issue with the old autowhite camera circuits: by the time autowhite or autocolor were through with their dirty work, there were usually no whites at all, just discolored grayish thingies with color casts.
Royal Blue would be a better guess. Navy, after thinking about it, is too dark.

I added a pic to this post so you can see the "real" colors.

Quote:
Originally Posted by sanlyn View Post
What you can play with are saturation and midtones. The midtones can be lowered by decreasing gamma or lowering the middle point with color mill or curves. This will make the upper shadows look dark around RGB 64, so use curves to brighten that a bit. Unfortunately if you make the ending scene look OK the beginning will look dim and too contrasty. If you fix up the beginning, the ending will be out of whack.

Cleaning tape noise, spots, dropouts, and edge shimmer wasn't all that difficult. My script and filters are a total mess right now, so I have to clean them up before I can post.
I'll work with these suggestions and see what i can do. Thanks.

Quote:
Originally Posted by lordsmurf View Post
Band videos are one of the things that push my Avisynth skills.
Seems like I always pick the best videos to transfer!! lol!
And thanks for the suggestions Smurf. Look fwd to trying some of the Avisynth tips you mention on your Avisynth tips post.

I managed to email the classmate who originally made the transfer. He said that mine was a copy of a copy (3rd Gen). He also said that he copied mine from his copy. In addition to that, he stated that when he made his copy from the original, he recorded at LP instead of SP. When mine was copied it was done at SP on my tape ...So... I have an SP copy of an LP copy. He stated that he "thinks" he still has his original but cant get it to me for several months. Would there be a huge difference in quality perhaps, being that his was recorded at LP mode? He did copy his from the original though.


Attached Images
File Type: jpg Chs8182.jpg (117.8 KB, 24 downloads)

Last edited by sirbyron; 02-22-2015 at 09:33 PM. Reason: added pic
Reply With Quote
  #29  
02-22-2015, 10:36 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Thanks for the image. Yep, that's royal blue, the shiny kind. Photo's kinda orange and oversaturated, but I get the idea.

I was just about finished when family matters interrupted everything and killed half the day. I wish the folks didn't live 50 minutes away! Oh, well, it was time for a day away from the PC (whether I want one or not, LOL!). Thanks for your patience.

-- merged --

Quote:
Originally Posted by sirbyron View Post
Seems like I always pick the best videos to transfer!! lol!
Don't feel alone.

Quote:
Originally Posted by sirbyron View Post
I managed to email the classmate who originally made the transfer. He said that mine was a copy of a copy (3rd Gen).
Ouch! And double ouch! And I might add, OMG! At least he didn't make a copy at EP. Yes, slower speed = lower quality. All speeds with VHS = color inaccuracies wholesale. Each copy = more corruption. No exceptions.

After swearing at this clip for a while, I came up with a trial effort (attached). A bit saturated -- tried for a brilliant blue in those uniforms. But. folks, it won't happen. I'd cut my Vdub saturation figure at least in half. If you want saturation, you gotta have color data to work with. I favored settings for the majorette. Others might differ, but I spent most games watching the ladies --especially when my team was losing. I encoded for MPEG/DVD at 704x480 interlaced, a standard frame size for 4:3 DVD.

I ran the project in 2 steps. Trying to tweak colors with a slow script is sheer torture. So Step 1 deinterlaces and saves the result as YV12. Step 2 is a separate script, takes the input from Step 1 and does the rest. It's fast enough for tweaking in VirtualDub without driving you crazy.

Step 1:
You've seen this before, so nothing new except that I changed the QTGMC settings.

Code:
# ###############################
#       SCRIPT FOR STEP 1
# ###############################

AviSource("E:\forum\sirbyron\C\Chs1981Samplecc.avi") #<-- adjust path and file name.
Crop(16,0,0,-10).AddBorders(0,0,0,2)
ConvertToYV12(interlaced=true)
AssumeTFF().QTGMC(preset="fast",sharpness=0.8)
# ------- Save in VirtualDub as Lagarith YV12 using fast compress" ----------------
Code:
# ###############################
#       SCRIPT FOR STEP 2
# ############################### 

Import("D:\Avisynth 2.5\plugins\chubbyrain2.avs")
Import("D:\Avisynth 2.5\plugins\RemoveSpotsMC.avs")

AviSource("path to Step 1 output\filename.avi") #<--- adjust path and name for step 1 file.
chubbyrain2()
ChromaShift(c=-8,u=-2,L=-4)
mergechroma(awarpsharp2(depth=32, type=1, blur=3, chroma=6))
AutoAdjust(temporal_radius=30,high_quality=true,auto_gain=true,gain_mode=1,\
  dark_limit=1.0,gamma_limit=3.0,auto_balance=true)
SmoothLevels(8, 0.85, 255,16,235,chroma=200,limiter=0,tvrange=true,dither=100)
v1=last
e=v1.SelectEven().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
o=v1.SelectOdd().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
Interleave(e,o)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
Santiag()
ConvertToRGB32(matrix="Rec601",interlaced=true)
AddBorders(8,4,8,4)
return last

# ---- output is RGB32. You can save as Lagarith RGB32 in a
# ---- new file via "fast compress" and then run VirtualDub 
# ---- as a separate step -- or load VirtualDub filters on 
# ---- Avisynth output and save as Lagarith YV12 for an encoder
# ---- via "Full processing mode".

# ------ VirtualDub plugins used later (See .vcf file)
# - fxVHS.vdf (FlaXen VHS) Ise chroma shift only!! Disable all other filters in the window.
# - hue.vdf (hue/saturation/intensity - Donald Graft)
# - ColorMill.vdf
# - gradation.vdf
In Step2 I removed a couple of filters. Face it, this poor critter can't take much denoising. QTGMC and RemoveSpotsMC are about all it could tolerate. Specifically, sharpening just doesn't work here and looks weird. The new filters you see will be attached in a following post.

AviSource("path to Step 1 output\filename.avi"): The input is the YV12 file saved from Step 1. You can run both steps in one script, but it will crawl. Anyway, if you want to change any filters this will save the time and angst of deinterlacing every time you run it.

chubbyrain2()
ChromaShift(c=-8,u=-2,L=-4)
mergechroma(awarpsharp2(depth=32, type=1, blur=3, chroma=6))

Similar to the earlier script, but two chroma sharpeners with awarsharp2 was a bit much. The majorette already has detail loss and looks plastic to begin with. This step sharpens color only.

AutoAdjust(temporal_radius=30, high_quality=true, auto_gain=true, gain_mode=1,\
dark_limit=1.0, gamma_limit=3.0, auto_balance=true):
Autofilters are dangerous business. This one is a very conservative one. It doesn't try to "correct" everything (none of them do anyway!). Mainly it tries to stabilize those haywire luma and chroma changes. The values are set to keep blacks from looking too thick and to calm gamma from jumping through the roof midway. It works a little. At least it made the uniforms more blue. But it made the sky more pink. Don't expect miracles.

SmoothLevels(8, 0.85, 255,16,235 chroma=200, limiter=0, tvrange=true, dither=100): SmoothLevels is in the SmoothAdjust plugin. It's set up here to raise darks just a little to save some dark detail, then at the bright end it contracts the hard brights a bit to avoid overshoot and clipping. It also lowers the high gamma. The first 5 numbers in the syntax correspond to: dark value input (treats dark pixels starting at RGB 8), gamma (lowers gamma and midtones from default 1.0 to 0.85), bright value input (treats RGB 255 as the brightest value), dark output (uses 16 as the output target RGB for those RGB 8 dark input pixels), and bright output (take those RGB 255 input pixels and wind them down so they don't exceed RGB 235). The rest of the stuff is smoothing, with dithering to "fill in" pixel values that are missing in the adjusted luma and color range -- i.e, smooths luma and chroma gaps across the spectrum, often done to avoid banding artifacts.

v1=last
e=v1.SelectEven().RemoveSpotsMC().Blur(0.4,0.2). Sharpen(0.3)
o=v1.SelectOdd().RemoveSpotsMC().Blur(0.4,0.2). Sharpen(0.3)
Interleave(e,o)

A tricky sequence, but often used. You have spots, dropouts, rips, etc., some of which endure for multiple frames. This routine splits the frames into two groups with hopes that a streak or dropout will occur only once in each group of frames. v1=last saves a copy of the last thing that happened in the script, and calls it "v1". Then we take all the Even numbered frames from v1 and save them as "e". Then we take all the odd numbered frames from v1 and call them "o". Clever names, huh? Just don't create a name that's the same as a command or function. Each group of frames is filtered with RemoveSpotsMC, then blurred just a bit, then sharpened just a bit. Why? To smooth stuff like split and ragged edges, especially damage that makes the majorette look as if she has two noses. Interleave(e,o) assembles "e" and "o" frames into their original sequence.

AssumeTFF().SeparateFields().SelectEvery(4,0,3). weave(): Reinterlace the reassembled frames using Top Field First. This means separating the progressive frames into 2 fields, as in the original clip. SelectEvery(4,0,3) takes every group of 4 fields and selects only fields 0 and 3 (the first field in a group is always considered field 0, not field 1). Weave() puts the two selected fields into an interlaced frame with the proper pixel lineup and scan line orientation. This line has 4 separate steps separated by periods. Each step feeds the next part of the the statement.

Santiag(): Anti-alias and edge smoothing. Some mighty ragged and noisy edges in this thing.

ConvertToRGB32(matrix="Rec601",interlaced=true)
AddBorders(8,4,8,4)
return last

Go to RGB32 for VirtualDub. Note that at this point, the video is interlaced. AddBorders restores the 640x480 frame size. In this case, you must end this script with "return last". This means to return the last thing the script accomplished. Otherwise, we've named some video copies as "v1", "e", and "o". Avisynth has to know what we want back from this foolishness. What we want returned is the "last" thing that was done.

In the above notes, notice how many coded words have spaces that don';t belong there. That's why we usually post original code inside "code" markers (see the "<>" icon above the reply window).

What I did was take the Step 2 script, read its output in VirtualDub, and load the VDub filters before saving the file as YV12. You'll need YV12 for the encoder anyway, so you can tell VirtualDub to output lossless Lagarith or huffyuv YV12, even though the VDuib filters run in RGB.

I'll attach more filters and the VirtualDub settings in the next post.


Attached Files
File Type: mpg Trial Run.mpg (9.93 MB, 23 downloads)
Reply With Quote
The following users thank sanlyn for this useful post: sirbyron (02-23-2015)
  #30  
02-23-2015, 05:22 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
The attached plugin2.zip has subfolders with read-me and Avisynth plugins for AutoAdjust.dll, SmoothAdjust.dll, RemoveSpotsMC.avs, and Santiag.avsi. And since everybody needs a good sharpener, I included LimitedSharpenfaster. You can use it set strong or weak (the "strength" parameter), but the default 160 is pretty heavy. I had to remove it from this project. Poor Chs1981Samplecc already has oversharpening artifacts from previous dubs.

The attached VirtualDub_Files.zip has FlaXen's fxvhs plugin and ColorTools if you don't already have them. Also has a handy desktop RGB pixel sampler called Csamp.exe (don't leave home without it). Why VirtualDub doesn't already have a built-in pixel reader is beyond me.

Also in the VirtualDub file is a copy of the .vcf file with the settings I used for the RGB filters. Make sure you have these 4 filters in your VirtualDub plugins: fxVHS.vdf, hue.vdf, ColorMill.vdf, and gradation.vdf. A .vcf is a text file that you can read in Notepad if you want to. You load the filters in VirtualDub using "File..."-> "load processing settings...", then navigate to where the .vcf is located and click Open (or OK, or whatever the dialog wants). Once they're loaded, you can look inside each filter to see the settings.

The best place to keep .vcf's is with your project. Don't save it in VDub by overwriting it -- save it with a new name or version number. You never can tell when you want it back again.

Everyone is bound to mumble and disagree over specific settings. I'm not very satisfied, myself. But that's a given.


Attached Files
File Type: zip plugins2.zip (1.54 MB, 34 downloads)
File Type: zip VirtualDub_Files.zip (257.8 KB, 34 downloads)
Reply With Quote
The following users thank sanlyn for this useful post: sirbyron (02-23-2015)
  #31  
02-23-2015, 10:14 PM
sirbyron sirbyron is offline
Free Member
 
Join Date: Jun 2012
Location: NC, USA
Posts: 46
Thanked 0 Times in 0 Posts
"Trialrun.mpg" looking good to me. I was going great on Step 1, got it completed and saved with Lagarith. Trying to open Step 2 in Vdub I came up with the error I attached as a jpg. Hopefully you can read the errors. Looks like according to the error it is hanging up on line "16" in my script and on lines "44" and "13" in the "RemoveSpotsMC.avs" script. Here is my Script in notepad (which I copy and pasted from the forum and then edited my filename for the video:

Code:
# ###############################
#       SCRIPT FOR STEP 2
# ############################### 

Import("C:\Program Files\AviSynth 2.5\plugins\chubbyrain2.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\RemoveSpotsMC.avs")

AviSource("C:\Documents and Settings\Administrator\My Documents\My Videos\Chs1981SampleStep1.avi") #<--- adjust path and name for step 1 file.
chubbyrain2()
ChromaShift(c=-8,u=-2,L=-4)
mergechroma(awarpsharp2(depth=32, type=1, blur=3, chroma=6))
AutoAdjust(temporal_radius=30,high_quality=true,auto_gain=true,gain_mode=1,\
  dark_limit=1.0,gamma_limit=3.0,auto_balance=true)
SmoothLevels(8, 0.85, 255,16,235,chroma=200,limiter=0,tvrange=true,dither=100)
v1=last
e=v1.SelectEven().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
o=v1.SelectOdd().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
Interleave(e,o)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
Santiag()
ConvertToRGB32(matrix="Rec601",interlaced=true)
AddBorders(8,4,8,4)
return last

# ---- output is RGB32. You can save as Lagarith RGB32 in a
# ---- new file via "fast compress" and then run VirtualDub 
# ---- as a separate step -- or load VirtualDub filters on 
# ---- Avisynth output and save as Lagarith YV12 for an encoder
# ---- via "Full processing mode".

# ------ VirtualDub plugins used later (See .vcf file)
# - fxVHS.vdf (FlaXen VHS) Ise chroma shift only!! Disable all other filters in the window.
# - hue.vdf (hue/saturation/intensity - Donald Graft)
# - ColorMill.vdf
# - gradation.vdf
I do have "RemoveSpotsMC.avs" in my Avisynth plugin file. I uploaded a screenshot of that folder also. On this computer I am running the following:

Windows XP 32bit
P4 2.0 Ghz
2.0 GB Ram

Quote:
Originally Posted by sanlyn View Post
Thanks for the image. Yep, that's royal blue, the shiny kind. Photo's kinda orange and oversaturated, but I get the idea.

I was just about finished when family matters interrupted everything and killed half the day. I wish the folks didn't live 50 minutes away! Oh, well, it was time for a day away from the PC (whether I want one or not, LOL!). Thanks for your patience.
Ah..no problem at all, thank YOU for your help. Good to get away from the monitor for a while and yes ... Family always first!


Attached Images
File Type: jpg Vduberror.jpg (43.4 KB, 8 downloads)
File Type: jpg AvipluginsScreenshot.jpg (57.2 KB, 10 downloads)
Reply With Quote
  #32  
02-24-2015, 07:04 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Quote:
Originally Posted by sirbyron View Post
Trying to open Step 2 in Vdub I came up with the error I attached as a jpg. Hopefully you can read the errors. Looks like according to the error it is hanging up on line "16" in my script and on lines "44" and "13" in the "RemoveSpotsMC.avs" script.
Say, one error is pretty good for starters. And that was due to a frequent oversight (mine, of course).

The error message says that RemoveSpotsMC is looking for a function called "SCselect". That function is in the RemoveDirt.dll, and -- darn it -- RemoveDirt almost always trips up people because people think it's part of RemoveGrain and comes with QTGMC. But it doesn't.

Two versions of the RemoveDirt.dll's are attached. Use RemoveDirtSSE2.dll.

Your looks script looks OK, but start using the code markers in the reply window. Click the "#" icon above the reply window and copy code inside the code markers. For some reason, this and other forums put spaces between letters sometimes and breaks up a word. That's why a straight copy of the following line in your script looks like this:
Quote:
Originally Posted by sirbyron View Post
e=v1.SelectEven().RemoveSpotsMC().Blur(0.4,0.2).Sh arpen(0.3)
o=v1.SelectOdd().RemoveSpotsMC().Blur(0.4,0.2).Sh arpen(0.3)
Interleave(e,o)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).We ave()
If you paste code inside code markers, they'll look like this:
Code:
e=v1.SelectEven().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
o=v1.SelectOdd().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
Interleave(e,o)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
Nice work. You should have seen me kicking and screaming the first time I used Avisynth. Hope you're getting a feel for working with it, if for nothing more than simple tasks. You might want to have a look at this web page if you haven't seen it before: http://www.animemusicvideos.org/guid...post-qual.html. It's about anime, but the filters can be used anywhere. Anime samples help show the filter effects more clearly.


Attached Files
File Type: zip RemoveDirt.zip (27.3 KB, 19 downloads)
Reply With Quote
The following users thank sanlyn for this useful post: sirbyron (02-24-2015)
  #33  
02-24-2015, 07:14 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,503
Thanked 2,449 Times in 2,081 Posts
Quote:
Originally Posted by sanlyn View Post
You might want to have a look at this web page if you haven't seen it before: http://www.animemusicvideos.org/guid...post-qual.html. It's about anime, but the filters can be used anywhere. Anime samples help show the filter effects more clearly.
@sirbyron:

However, realize that most AMV users severely overfilter their videos. They look terrible more often than not. So do NOT use that site for ideas on how to restore video, but rather ONLY to see how filters work. That's just not a good site for video restoration techniques. Beware.

I want to give this thread some attention, but I can't this week.

sanlyn has mentioned several interesting things, and I've been following along with the conversation.

@sanlyn

How about I give you access to the new glossary, and you can add (seed it with) Avisynth info? I really like what you did with the filter breakdown here. I realize that Avisynth.org has a wiki, but that's not what I want to do. This site focuses on restoration, not just any ol' filter.

It's not ready yet, and won't be for another month or two. But it's on my docket for the spring.

Interested?

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
The following users thank lordsmurf for this useful post: sirbyron (02-24-2015)
  #34  
02-24-2015, 07:41 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Nice offer, lordsmurf, much appreciated. Will be glad to contribute whatever I can....pending your approval, of course. Would be nice to have such a guide.

Indeed, anime fans filter like crazy. Agreed, it's a decent page at AMV to show what the filters do, but like you I wouldn't recommend throwing everything in sight at a video. I wish there was more of the original data in the sample I worked so I could avoid something like RemoveSpotsMC and didn't have to deinterlace to clean it up. Keeping that sample around to see what can be done with it later. Those spots and dropouts were driving me crazy, though. Well, but sometimes you just have to live with a few glitches and do less cleanup....

Thanks for the feedback.
Reply With Quote
The following users thank sanlyn for this useful post: sirbyron (02-24-2015)
  #35  
03-01-2015, 10:35 PM
sirbyron sirbyron is offline
Free Member
 
Join Date: Jun 2012
Location: NC, USA
Posts: 46
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by sanlyn View Post
Say, one error is pretty good for starters. And that was due to a frequent oversight (mine, of course).
Thanks ... I try to really study before I do something. Sometimes it works, sometimes it doesn't! lol

Quote:
Originally Posted by sanlyn View Post
The error message says that RemoveSpotsMC is looking for a function called "SCselect". That function is in the RemoveDirt.dll, and -- darn it -- RemoveDirt almost always trips up people because people think it's part of RemoveGrain and comes with QTGMC. But it doesn't.

Two versions of the RemoveDirt.dll's are attached. Use RemoveDirtSSE2.dll.
That fixed it! Yayyy! Getting in late so dont have time to do anything else tonight but at least I know "Step 2" is loading now. Thanks!

Quote:
Originally Posted by sanlyn View Post
Your looks script looks OK, but start using the code markers in the reply window. Click the "#" icon above the reply window and copy code inside the code markers. For some reason, this and other forums put spaces between letters sometimes and breaks up a word.
Ahh...I see that # sign now ... took me forever to notice it for some reason. I'll definitely use it next time.

Quote:
Originally Posted by sanlyn View Post
Nice work. You should have seen me kicking and screaming the first time I used Avisynth. Hope you're getting a feel for working with it, if for nothing more than simple tasks. You might want to have a look at this web page if you haven't seen it before: http://www.animemusicvideos.org/guid...post-qual.html. It's about anime, but the filters can be used anywhere. Anime samples help show the filter effects more clearly.
Thanks, it has stretched my brain a bit.. but I am understanding it somewhat. Cant wait to gradually explore things and break down the script you used and just experiment to see what changes visually. Of course I'll keep that script and definitely not overwrite it! I cant wait to put it in use on the complete show.

Quote:
Originally Posted by lordsmurf View Post
@sirbyron:

However, realize that most AMV users severely overfilter their videos. They look terrible more often than not. So do NOT use that site for ideas on how to restore video, but rather ONLY to see how filters work. That's just not a good site for video restoration techniques. Beware.

I want to give this thread some attention, but I can't this week.

sanlyn has mentioned several interesting things, and I've been following along with the conversation.
Definitely understand on the "overfiltering". Yes, I'll just use it to see how filters work. Always look fwd to any suggestions you have also. Thanks!


Quote:
Originally Posted by lordsmurf View Post
It's not ready yet, and won't be for another month or two. But it's on my docket for the spring.
Glad to hear! Cant wait.

Quote:
Originally Posted by sanlyn View Post
Keeping that sample around to see what can be done with it later
This sounds good too! Thanks.

I'll hopefully get to really spend some time tomorrow night on this and using it on the full video. I'll check back in then. So thankful...

-- merged --

Sanlyn, I downloaded TMPGEnc Authoring Works 5 trial version and it doesn't let me load my avi file type. It says it is an "audio only" file but it isn't because it plays fine on my computer. I saved Step 2 as "Lagarith" via full processing. If TMPGEnc is not a recommended authoring program for this particular file can you recommend one? Thanks.
Reply With Quote
  #36  
03-02-2015, 12:53 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,503
Thanked 2,449 Times in 2,081 Posts
You must encode to MPEG before authoring.
TAW5 is excellent authorware.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
VHS restore filters using Avisynth and VirtualDub - advice? Zoink187 Restore, Filter, Improve Quality 13 07-24-2014 09:38 PM
Applying different filters to different parts of the video in VirtualDub naripeddi Restore, Filter, Improve Quality 2 03-13-2013 03:22 AM
Unfolding fields before applying Virtualdub filters unclescoob Restore, Filter, Improve Quality 10 10-02-2011 09:18 PM
VirtualDubMPEG - applying different filters to different sections, color correction unclescoob Restore, Filter, Improve Quality 10 09-28-2011 10:05 AM
VirtualDub (with Filters Pre-loaded) for Restoring [DOWNLOAD] admin Restore, Filter, Improve Quality 0 12-11-2010 06:11 AM

Thread Tools



 
All times are GMT -5. The time now is 06:11 PM