#1  
09-08-2017, 11:51 PM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
I'm capturing just fine with Virtualdub.. thank you for your help getting me going on that.

My VHS tapes can basically be put into two different categories -- Outdoor with decent lighting, and dark indoor video. I wanted to share the an example of the former first, because to my novice untrained eye I don't know what should be done with avisynth and virtualdub to improve the video but I cannot wait to be enlightened.

I uploaded a 7 second clip (78mb)... if that is too short let me know. I tried to pick something that was on tripod.

Thanks in advance!


Attached Files
File Type: avi Lou test.avi (78.91 MB, 186 downloads)
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
09-09-2017, 11:30 AM
themaster1 themaster1 is online now
Free Member
 
Join Date: Feb 2011
Location: France
Posts: 497
Thanked 99 Times in 83 Posts
try this script with avisynth:

Quote:
AVISource("M:\05-montage\Lou test.avi")
assumetff()
# enhance darks + saturation color
hdragc(max_sat=1.30,shadows=true,avg_lum=255,coef_ gain=1.7,max_gain=1.8,reducer=0.0)
tweak(sat=1.7,coring=false)
# remove chroma noise + sharpen (falcutative)
ConverttoRGB32(matrix="rec601",interlaced=true)
separatefields()
LoadVirtualDubPlugin("C:\Program Files (x86)\VirtualDub\plugins\Camcorder_Color_Denoise_s se2.vdf", "CCD", 1)
CCD(7,1) #0-100 , default 30
LoadVirtualDubPlugin("C:\Program Files (x86)\VirtualDub\plugins\msu_sharpen.vdf", "MSUSmartSharpen", 1)
MSUSmartSharpen(0) # 0 (small overall) to 5 (mad)
weave()
converttoyv12(matrix="rec601",interlaced=true)
separatefields()
## remove halos :
FastLineDarken(luma_cap=28,thinning=220)
main=last
main
DeHalo_alpha(rx=2.0, ry=1.0, darkstr=1.0, brightstr=1.0, lowsens=50, highsens=50, ss=1.5)
mergeluma(aWarpSharp(depth=16, thresh=1.0, blurlevel=1, cm=1))
filtered=last
main
mt_edge().mt_expand
mymask=last
mt_merge(main, filtered, mymask)
# remove grain :
McDegrainSharp(2)#
weave()

Reply With Quote
  #3  
09-09-2017, 03:27 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
Thank you for that sample. It was correctly cut, saved, and posted. You'd be surprised how many attempts it takes some readers to get that far, LOL!

I took a somewhat different approach than the scripts posted earlier:

There are four main problems. The first is the cyan color cast. This was the camera's fault, seeing as how the lighting is subdued, slightly overcast bluish sunlight. That's easy enough to fix.

Second, the capture was made with blown-out highlights. The brightest parts of the image xceed y=255, so it's impossible for digital video to maintain highlight details with brights extending outside the contrast range. You can see bright clipping in the way the bright plates at the lower right lack detail and look like "hot spots". That can be fixed to a certain extent, but brights are going to look little washed out, even with lvels correction. The first step I took was to tame bright luma levels in Avisynth and YUY2 (you can'[t make that initial correction in an editor's RGB, because clipped brights will look even worse when converted to RGB for processing or display). Also, the kids look a little dim and pale, so RGB filters were used to heighten some shadow detail and lower midtones while keeping the deepest shadows a realistic darker level.

Third, there is some oversharpening. This can be seen in dark halos on bright edges and bright halos on dark edges. This can be overcome to some extent, but notice the bright edge ghost 6 pixels to the right of the woman's white shirt. It's also present on other bright edges but is partially masked by other details. This causes the buzzing edges and line shimmer in the image to look worse than it should.

That shimmer is also a result of problem #4 -- I see that there's no line tbc in your capture gear. The wiggly edges and the edge twitter and moire effects on fine-textured objects (checkered clothing bottom left and top right, center girl's t-shirt design, bright forks at bottom center, thin black iron legs at top left)etc.) are the result of oversharpening and scanline sync errors. I know you have an external TBC-1000, but that's a frame-level tbc, not a line tbc. This is also where the twitter and saw-tooth edges come from. Filters can mitigate the noise somewhat, but there's no real cure.

I began by fixing luma levels and blue contrast, then proceeded to denoising in Avisynth (which in this case required deinterlacing with QTGMC and some its noise reduction parameters customized), then edge cleaning, more smoothing with RemoveDirtMC, then reinterlacing, and finally color correction in VirtualDub.

I'll be able to get into more detail with the Avisynth script and VDub filters later (starting to get very busy at my house today). I made two versions from the sample, one encoded for DVD and one square-pixel for mp4 and smart TV or whatnot. The square-pixel version could be deinterlaced for web posting. The script for each version used the same filter sequence, but resizing was a little different for the mp4. Here is the main script I used:

Code:
Import("drive:\path\to\plugins\RemoveDirtMC.avs")
Import("drive:\path\to\plugins\Santiag_V1.6.avs")

AviSource("Drive:\path\to\Lou test.avi")
Crop(20,2,-12,-6).AddBorders(16,4,16,4)

### --- levels fix ---
ColorYUV(gain_y=-15,cont_u=-20)
Levels(20,1.15,255,16,245,dither=true,coring=false)

### --- first stage denoise an smoothing ---
AssumetFF()
ConvertToYV12(interlaced=true)
QTGMC(preset="medium",ChromaMotion=true,border=true,ChromaNoise=true,\
   DenoiseMC=true,NoiseDeint="Generate",StabilizeNoise=true,GrainRestore=0.3)
vInverse2()

### --- Work with edges, aliasing, line twitter ---
DeHalo_Alpha(rx=2.0)
Santiag(strh=3,strv=3,type="Sangnom")

### --- 2nd stage motion/noise smoothing ----
RemoveDirtMC(30,false)
MergeChroma(aWarpSharp2(depth=30))

### --- more edge work ---
ConvertToYUY2(interlaced=false)
FixVHSOversharp(20,16,12)
FixVHSOversharp(20,8,4)

### --- Reinterlace, prepare for RGB color work ----
SeparateFields().SelectEvery(4,0,3).Weave()
ConvertToRGB32(interlaced=true,matrix="Rec601")
return last
VirtualDub filters used: gradation curves and ColorMill.

I'll be able to fill in more detail and notes in a later post. Gotta run with the family now. The biggest improvement you could make to reliee motion nnosie and some of the excess interlace effects would be to find a way to incorporate a line-level tbc into your filter chain. Easiest and least expensive would be a tbc pass-thru device with line-tbc pass-thru circuitry, like a Panasonic ES10 or ES15. More expensive would be a VCR with a built-in line tbc.


Attached Files
File Type: mpg Lou_480i_DVD.mpg (6.03 MB, 85 downloads)
File Type: mp4 Lou_06_640x480i.mp4 (5.29 MB, 88 downloads)
Reply With Quote
  #4  
09-09-2017, 03:58 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,508
Thanked 2,449 Times in 2,081 Posts
The attached test capture looks really good. The hardware in use has taken care of most issues here already. There's no instabilities, no timing problems, nothing unusual, simply some mild chroma and color issues. JVC S-VHS with TBC, external TBC, USB capture, correct? Looks like it.

This clip does have a mild color cast. It's picking up the overcast sky as blueish. If the entire video was that way, or a long clip, I'd consider making it less blue. If it was just a fleeting clip, or if the camera's auto white balancer kept changing some, I'd leave it alone. I do all color work in Adobe Premiere Pro, sometimes VirtualDub Colormill, rarely Avisynth. And in this case, I have a line in my Avisynth MultiScript that would probably fix this, or at least be easily tweakable to fix it.

There is mild chroma offset/shift, aka "color bleeding". This is easy to fix in Avisynth. Follow it up with the Camcorder Color Denoise (CCD) filter in VirtualDub.

I see the usual overscan noise. Mask it. Done.

SoundForge or Audacity would easily wipe out that hiss, if you can find clean print (noise only area) to work with.

I prefer to leave ringing alone, as it was created by the camera as false sharpening. It has to be really bad, usually due to nth generation copying, for me to even bother.

I'd not deinterlace it at all. Our own home movies look like this, most people's do, and archiving as interlaced MPEG-2 15mbps is ideal.

I doubt the highlights were blown out on capture. The camera did it. Very common. Unless I'm having to match other source videos, and for something important (aka paid stupid work), I never bother trying to fix it. For one thing, it's unfixable. All you can do is make it less bad. You risk other color qualities of the image by screwing with it too much.

Order matters:
- chroma offset fix first
- dering if you must, other NR if you must
- color cast fix next
- overscan mask last
- audio separate task, post-video, so also last

- 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
  #5  
09-10-2017, 12:21 AM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
Quote:
Originally Posted by sanlyn View Post
Thank you for that sample. It was correctly cut, saved, and posted. You'd be surprised how many attempts it takes some readers to get that far, LOL!

I took a somewhat different approach than the scripts posted earlier:

There are four main problems. The first is the cyan color cast. This was the camera's fault, seeing as how the lighting is subdued, slightly overcast bluish sunlight. That's easy enough to fix.

Second, the capture was made with blown-out highlights. The brightest parts of the image xceed y=255, so it's impossible for digital video to maintain highlight details with brights extending outside the contrast range. You can see bright clipping in the way the bright plates at the lower right lack detail and look like "hot spots". That can be fixed to a certain extent, but brights are going to look little washed out, even with lvels correction. The first step I took was to tame bright luma levels in Avisynth and YUY2 (you can'[t make that initial correction in an editor's RGB, because clipped brights will look even worse when converted to RGB for processing or display). Also, the kids look a little dim and pale, so RGB filters were used to heighten some shadow detail and lower midtones while keeping the deepest shadows a realistic darker level.

Third, there is some oversharpening. This can be seen in dark halos on bright edges and bright halos on dark edges. This can be overcome to some extent, but notice the bright edge ghost 6 pixels to the right of the woman's white shirt. It's also present on other bright edges but is partially masked by other details. This causes the buzzing edges and line shimmer in the image to look worse than it should.

That shimmer is also a result of problem #4 -- I see that there's no line tbc in your capture gear. The wiggly edges and the edge twitter and moire effects on fine-textured objects (checkered clothing bottom left and top right, center girl's t-shirt design, bright forks at bottom center, thin black iron legs at top left)etc.) are the result of oversharpening and scanline sync errors. I know you have an external TBC-1000, but that's a frame-level tbc, not a line tbc. This is also where the twitter and saw-tooth edges come from. Filters can mitigate the noise somewhat, but there's no real cure.

I began by fixing luma levels and blue contrast, then proceeded to denoising in Avisynth (which in this case required deinterlacing with QTGMC and some its noise reduction parameters customized), then edge cleaning, more smoothing with RemoveDirtMC, then reinterlacing, and finally color correction in VirtualDub.

I'll be able to get into more detail with the Avisynth script and VDub filters later (starting to get very busy at my house today). I made two versions from the sample, one encoded for DVD and one square-pixel for mp4 and smart TV or whatnot. The square-pixel version could be deinterlaced for web posting. The script for each version used the same filter sequence, but resizing was a little different for the mp4. Here is the main script I used:

Code:
Import("drive:\path\to\plugins\RemoveDirtMC.avs")
Import("drive:\path\to\plugins\Santiag_V1.6.avs")

AviSource("Drive:\path\to\Lou test.avi")
Crop(20,2,-12,-6).AddBorders(16,4,16,4)

### --- levels fix ---
ColorYUV(gain_y=-15,cont_u=-20)
Levels(20,1.15,255,16,245,dither=true,coring=false)

### --- first stage denoise an smoothing ---
AssumetFF()
ConvertToYV12(interlaced=true)
QTGMC(preset="medium",ChromaMotion=true,border=true,ChromaNoise=true,\
   DenoiseMC=true,NoiseDeint="Generate",StabilizeNoise=true,GrainRestore=0.3)
vInverse2()

### --- Work with edges, aliasing, line twitter ---
DeHalo_Alpha(rx=2.0)
Santiag(strh=3,strv=3,type="Sangnom")

### --- 2nd stage motion/noise smoothing ----
RemoveDirtMC(30,false)
MergeChroma(aWarpSharp2(depth=30))

### --- more edge work ---
ConvertToYUY2(interlaced=false)
FixVHSOversharp(20,16,12)
FixVHSOversharp(20,8,4)

### --- Reinterlace, prepare for RGB color work ----
SeparateFields().SelectEvery(4,0,3).Weave()
ConvertToRGB32(interlaced=true,matrix="Rec601")
return last
VirtualDub filters used: gradation curves and ColorMill.

I'll be able to fill in more detail and notes in a later post. Gotta run with the family now. The biggest improvement you could make to reliee motion nnosie and some of the excess interlace effects would be to find a way to incorporate a line-level tbc into your filter chain. Easiest and least expensive would be a tbc pass-thru device with line-tbc pass-thru circuitry, like a Panasonic ES10 or ES15. More expensive would be a VCR with a built-in line tbc.
Thank you for the detailed response and script. It took a little bit of time, but i found all of the plug-ins you use in the script so that I was able to load it on the full capture. The re-encoding is going right now (will take 12 hours) but i want to take a look at it on my TV so I just decided to apply all those changes and see what happens. One intimidating factor to this is when captures have different scenes in them that require different parameters. I assume you would end up saving every scene as its own video and restore each separately?

On my equipment, I actually have a JVC-SR-VS30 which has line TBC, and I'm 99% sure I had it activated during the capture (I've never turned it off.) And my frame TBC is actually Datavideo TBC3000. Did it seem like the VCR TBC was not doing its job?

Do you have a post with all your avisynth plug-ins attached?

On your script, is every single plug-in customized to what you saw on the video example or are there any that you would use on every single video regardless?

Quote:
Originally Posted by themaster1 View Post
try this script with avisynth:
Thanks for the response... Do you have a post in the thread with all your avisynth plug-ins attached? I couldn't load the script because I don't have all listed here.

Quote:
Originally Posted by lordsmurf View Post
And in this case, I have a line in my Avisynth MultiScript that would probably fix this, or at least be easily tweakable to fix it.

SoundForge or Audacity would easily wipe out that hiss, if you can find clean print (noise only area) to work with.

I prefer to leave ringing alone, as it was created by the camera as false sharpening. It has to be really bad, usually due to nth generation copying, for me to even bother.

I'd not deinterlace it at all. Our own home movies look like this, most people's do, and archiving as interlaced MPEG-2 15mbps is ideal.

Order matters:
- chroma offset fix first
- dering if you must, other NR if you must
- color cast fix next
- overscan mask last
- audio separate task, post-video, so also last
I'm going to take a crack at your multiscript next!

Is there a prior thread or guide on fixing audio with Audacity? I use audacity at work for voiceovers so I'm more familiar with that software out of the box than I am with Soundforge.

I plan on archiving as 15mbps mpeg.. have your guide on Avidemux handy.

Quote:
Originally Posted by lordsmurf View Post
I do all color work in Adobe Premiere Pro, sometimes VirtualDub Colormill, rarely Avisynth. \
t
In this case, I'm curious of your workflow.

What do you do in Virtualdub/Avisynth before sending to Premiere for your color work?

Then do you encode for storage straight from Premiere or do you send it back lossless then re-encode somewhere else?
Reply With Quote
  #6  
09-10-2017, 02:29 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
Quote:
Originally Posted by ragu0012 View Post
Thank you for the detailed response and script. It took a little bit of time, but i found all of the plug-ins you use in the script so that I was able to load it on the full capture.
Good work.

Quote:
Originally Posted by ragu0012 View Post
The re-encoding is going right now (will take 12 hours) but i want to take a look at it on my TV so I just decided to apply all those changes and see what happens. One intimidating factor to this is when captures have different scenes in them that require different parameters. I assume you would end up saving every scene as its own video and restore each separately?
You guessed it. That's the way almost everyone does it. Of course you're allowed some leeway, as some sequences can look pretty nearly like each other.

Quote:
Originally Posted by ragu0012 View Post
On my equipment, I actually have a JVC-SR-VS30 which has line TBC, and I'm 99% sure I had it activated during the capture (I've never turned it off.) And my frame TBC is actually Datavideo TBC3000. Did it seem like the VCR TBC was not doing its job?
I'll address that issue in the comments below.

Quote:
Originally Posted by ragu0012 View Post
Do you have a post with all your avisynth plug-ins attached?
All of 'em? I have over 500 plugins stored on my PC and in backups. About 230 are in my active Avisynth plugins foldre. Most of the time I use only about a dozen of them. In the post that will follow this one I'll give you some links to the versions I use and to some VirtualDub filters, with usage notes.

Quote:
Originally Posted by ragu0012 View Post
On your script, is every single plug-in customized to what you saw on the video example or are there any that you would use on every single video regardless?
I've used the same filters and the same or very similar settings again and again. Yes, they are often customized for specific problems. Many of my "regular" arsenal of plugins weren't necessary in this sample. For example, I didn't see any dropouts or spots/comets or frame hops in this sample.

These are some of the methods I used to make the samples and to determine the script and VirtualDub notes I posted.

I usually begin with a quick look at capture and its levels, color balance, general noise level, and obvious problems. When I first open your sample I use the quickie script below:

Code:
AviSource("Lou test.avi")
ConvertToYV12(interlaced=true)
Histogram("levels")
That script gives me the image and histogram below for frame 102 of the original sample (I've done some resizing to save space on these web pages). I inserted arrows and a big 1 & 2 & 3 superimposed on the original histogram and frame:



The histogram in the image measures luma and chroma levels in the image. Here, the image includes your original borders and the head-switching noise across the botom border. These affect the histogram and will be removed for a better reading later. The hgistogram mesures dark values on iuts left side, bright on its right side. The area across the middle of the histogram inside the darker borders indicate the safe zone of y=16 to y=235 luma values. Anything inside the dzrk borders t each side is consiered unsafe for NTSC or PAL transmission and encoding. Values outisde the safe zone will be clipped off nd/or distorted in RGB.

#1 points to a sharp slender "spike" at the left side of the histogram, exactly at y=16. This indicates that your capture device is clipping all superblack values, which muddies dark shadow detail and makes it impossible to retrieve any clipped dark details. In a dark scene this would not be near disastrous.

#2 points to bright values that extend beyond y=235 -- which ultimately means that they will exceed RGB 255 during play, which forces invalid luma levels into the display, and will be clipped or distorted. The camera itself is clipping off bright details in the white objects at the lower right, but further clipping in YUV makes it look worse ("hot spot"). Overly bright values are also in the woman's white sunlit shoulder at upper left.

#3: the black spikes should be smooth metal, but they're shimmering and wobbling in the moving image because of a weak line TBC. The image below is a 3X blowup of the area pointed to by arrow #3. The frame was deinterlaced to create this image so that interlace combing wouldn't affect the objects.



You can see that the black spikes are visibly notched -- the distortions vary with each frame to cause a noisy twitter. There is a tbc at work, but it's not powerful enough to handle line sync arrors from the current tape. The same mini-notch shimmer occurs on the edges of both side borders of the frames, which buzz during play. The weak tbc also makes horizontal noise and aliasing look worse than it should. You can also see the bright edge halos from sharpening. Angular aliasing in the image's deck chair is rather common with consumer cameras.

The image below is the same frame 102 after removing borders and head-switching noise that affect the histogram. This gives a more accurate histogram of the image content and was produced by the temporary cropping script below:

Code:
AviSource("Lou test.avi")
Crop(22,0,-14,-8)
ConvertToYV12(interlaced=true)
Histogram("levels")


The basic difference in the histogram below is that clipped superblacks (black borders) that affected the histogram are no longer present. Bright level clipping at y > 235 is still at the right edge of the histogram. There is still slight clipping of superblacks at the little "spike" to the left.

The script below corrected levels to the range of y=16-235, and the image below it shows that some very slight detail has been eked from the clipped area (not much), but mainly the hot spots in the lower right and upper left are tamed and more workable.

Code:
AviSource("Lou test.avi")
Crop(22,0,-14,-8)
ConvertToYV12(interlaced=true)
ColorYUV(gain_y=-15,cont_u=-20)
Levels(20,1.15,255,16,245,dither=true,coring=false)
Histogram("levels")


After running the other repair and denoising filters in the script posted earlier, VirtualDub filters were applied to the script's output while it was running. By observing the color balance and measuring pixel areas with a pixel value reader, it was determined that the overall color cast was cyan (greenish blue). You can see this in all the off-color whites and grays in the clothing of the figures. There are no clean whites or clean grays. Gradation curves and ColorMill were used to manipulate color ranges so that colors were balanced, and flesh and hair tones tones looked more natural. The darkest shadows were darkened a bit to add some contrast and depth to the scene. Midtones were amplified to make the kids brighter and not so dim and recessed. The results are i the same frame 102 below, from the 640x480 mp4:




A little later, in a subsequent post, I'll post some filter and usage links.


Attached Images
File Type: jpg frame 102 YUV and borders.jpg (95.1 KB, 564 downloads)
File Type: png frame 102 top left detail 3X.png (245.6 KB, 567 downloads)
File Type: jpg frame 102 YUV no borders.jpg (87.9 KB, 560 downloads)
File Type: jpg frame 102 YUV no borders - levels fix.jpg (85.9 KB, 556 downloads)
File Type: jpg frame 102 denoise and gamma and color.jpg (134.3 KB, 561 downloads)
Reply With Quote
  #7  
09-10-2017, 03:10 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,508
Thanked 2,449 Times in 2,081 Posts
Regarding scene-by-scene work, I often remind everybody that video requires patience.

However, I think sanlyn has more patience that even myself.

I'm sometimes not sure if his advice is academic, or if he actually does all that. Either way, it's hard to argue his results, the videos are improved. As I said in a previous reply, I'd never do scene-by-scene restoration, even for pay, or for myself, unless it was something very special. Or unless we're only talking like 3-4 scenes in the entire tape. However, most VHS scenes are mere minutes, and it quickly becomes tedious.

Remember, "Hollywood" films do this sort of scene-by-scene correction. They shot on professional cameras, and everything was exposed correctly. The corrections are usually artistic, and done in something like DaVinci.

And speaking of DaVinci, there's now a free version. I have it, but haven't used it yet. For me, Premiere is easier, since I've used it for 15+ years, and because it's somewhat similar to Photoshop. FYI, Photoshop also has limited video editing abilities there days.

When I have workflows that involve color correction, all restoration is done first. The color work is last. Everything is intermediary codecs (Huffyuv, Lagarith, ProRes422) until the final formatting stages. MPEG for disc, H.264 for streaming.

- 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
  #8  
09-10-2017, 03:18 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
I see that you apparently managed to acquire the Avisynth plugins I used in the posted script, which many find impossible without some help. I'm including in this post a package of the QTGMC main avsi, updated support files, and documentation. I'm also including the version of RemoveDirtMC that most people use these days, which is considerably less complex than the version posted in the Avisynth wiki.

RemoveDitryMC.avs is posted as an avs instead of auto-loading avsi because it calls another version of plain ol' RemoveDirt internally. I usually import this version of RemoveDirtMC rather than let it autoload 2 versions of RemoveDirt. It's a good idea two download their packages, which contain valuable documentation.

The others used in the script can be downloaded fom the 'net along with any other support files they might need:
vInverse v0.9:http://avisynth.nl/index.php/Vinverse
DeHalo_Alpha: http://avisynth.nl/index.php/DeHalo_alpha
Santiag_v1.6: http://avisynth.nl/index.php/Santiag
aWarpSharp2: http://avisynth.nl/index.php/AWarpSharp2
FixVHSoversharp: http://web.archive.org/web/200910261...oversharp.html

One of the desktop utilities I used to take pixel value readings in csamp.exe. No install required, the file just sit son your desktop and can be executed at any time. Csamp.exe was previously posted in a digitalfaq post here: Csamp.zip. There's an old post that illustrates its usage, along with pics of how to use some other VirtualDub tools: http://www.digitalfaq.com/forum/vide...html#post38384.

One of the tools mentioned above is a histogram multi-function that you can't do without for color correction info. ColorTools can be downloaded from here: ColorTools plugin zip.
(If you're using Windows 7 or 10, you;ll need the updated version of ColorTools. I didn't use it here because I processed your sample in XP. Color Tools 2015 update .)

There's another old digitalfaq upload that contains ccd, HueSatInt, ColorMill, Exorcist, and Gradation Curves for VirtualDub: Virtual Dub Plugins zip.
Some posts that illustrates how some or all of these are used: http://www.digitalfaq.com/forum/vide...html#post42315. And here: http://www.digitalfaq.com/forum/vide...html#post42294.

Finally, I'm attaching a VirtualDub .vcf file that contains the VDub filters and settings I used for color correction of your sample. A .vcf is a simple text file (you can edit it in Notepad if you want, but you'd better know what you're doing and save a backup copy). You load a .vcf in VirtualDub by clicking on "File" -> "load processing settings", locate the vcf, and select OK. It will load the filters and the settings I used. Note that loading a .vcf will overwrite any filters you might already have loaded. The two filters used are ColorMill and gradation curves, which must be in your VirtualDub plugins folder. You can load those filters and see what kind of settings I used.

Any more questions, let us know.


Attached Files
File Type: zip QTGMC_PluginsPackageJuly2017.zip (36.83 MB, 44 downloads)
File Type: avs RemoveDirtMC.avs (2.5 KB, 41 downloads)
File Type: vcf Lou_VDub_filters.vcf (3.6 KB, 32 downloads)
Reply With Quote
  #9  
09-10-2017, 03:28 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,508
Thanked 2,449 Times in 2,081 Posts
Yes, let's definitely attach filters and files anytime we discuss Avisynth.

There's been a lot of turmoil in the Avisynth space over the years. The most prolific were the meltdown of neuron2 (Donald Graft) at Doom9, and the DarkShikari (Jason/Fiona Glaser) sex-change fiasco at Doom10. We lost a lot of Avisynth information due to two people being petty and selfish. Both of those events happened in 2014, and years of data vanished.

Many Avisynth filters have disappeared over the years, due to being released on bad channels (mediafire, etc), rather than attaching to forums, or having an official release channel like SoureForge/Github/etc.

This is why we rescued KVCD.net from the same fate, and is the archives forum. It had some unusual and interesting Avisynth scripting and filters. We saved all of those from destruction.

- 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: gaborHU (05-16-2019)
  #10  
09-10-2017, 08:20 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
Quote:
Originally Posted by lordsmurf View Post
Regarding scene-by-scene work, I often remind everybody that video requires patience.

However, I think sanlyn has more patience that even myself.

I'm sometimes not sure if his advice is academic, or if he actually does all that. Either way, it's hard to argue his results, the videos are improved. As I said in a previous reply, I'd never do scene-by-scene restoration, even for pay, or for myself, unless it was something very special. Or unless we're only talking like 3-4 scenes in the entire tape. However, most VHS scenes are mere minutes, and it quickly becomes tedious.
Patient, I guess, but not quite insanely OCD yet, LOL!

A backyard birthday tape shot under the conditions shown here is likely to look the same way in every shot for several minutes, if not longer. Once you have the basic correction and denosing for those conditions and glitches, it should work for the entire sequence as well as for the next time you encounter a similar situation, with some very minor adjustments. Some tapes are so godawful, they're hopeless to begin with -- throw something heavy-duty at it like a strong dose of TemporalDegrain at full throttle (which would take out so many bad pixels you'd think you're getting an entirely different video) and a couple of passes of Tweak(), and be done with it.

On a less frequent basis you have your pet projects and your nagging challenges. That's where the learning comes in, and they're the hassles that make the rest of it seem so easy.
Reply With Quote
  #11  
09-10-2017, 09:15 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,508
Thanked 2,449 Times in 2,081 Posts
You just reminded me of something: My sister's wedding tape. I hate that thing. No matter what I try, it seems to get worse. It was shot long ago on a full VHS camcorder, and the camera values were all over the place. The dark venue and bright day make it miserable to try and correct. Tape flaws are often easier to correct compared to in-image color flaws. Every few years, I take another pass at it. It's probably due for another attempt in 2018.

- 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
  #12  
09-16-2017, 10:13 PM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
Many thanks to both Sanlyn and Lordsmurf for all the help getting me going on this project. I have been playing around with so many different filters over the last week, and oh boy has it eaten up a lot of time!

I wanted to share the clip attached here because it is a perfect example of something I would want to do minimal restoration to. (save more time for videos I care more about)

In that case would you just apply the #crop and #addborders commands?

Or what would you say is the "bare-bones" restoration you would do before converting to 15mb/s Mpeg?

Also, Lordsmurf, Playing around with your multiscript I ran into one Jam. How do i resolve this error?
"avisynth open failure: Addborders: YUV image can only add by Mod 2 (left side)."


Attached Files
File Type: avi loutest2.avi (80.33 MB, 39 downloads)
Reply With Quote
  #13  
09-17-2017, 02:17 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
Quote:
Originally Posted by ragu0012 View Post
Lordsmurf, Playing around with your multiscript I ran into one Jam. How do i resolve this error?
"avisynth open failure: Addborders: YUV image can only add by Mod 2 (left side)."
That message doesn't come from the multiscript, it comes from an AddBorders dtatement. You can't work with odd numbers of pixels in YUV. "Mod2" means a number that can be divided evenly by 2.

Quote:
Originally Posted by ragu0012 View Post
I wanted to share the clip attached here because it is a perfect example of something I would want to do minimal restoration to. (save more time for videos I care more about)

In that case would you just apply the #crop and #addborders commands?

Or what would you say is the "bare-bones" restoration you would do before converting to 15mb/s Mpeg?
That video is i8n very bad shape and has no detail to work with. It looks smeared. IS that a 6-hour slow-speed tape in a JVC player?"

There's no universal script that's suitable for all videos, especially concerning VHS.

Meanwhile you have some serious player problems. Besides the usual noise, you have some bad flicker and distortion in the blue channel. The attached demo Red Green Blue Compare 10fps.mp4 runs at 10fps and has 4 panels that show the source, plus the red-only channel, the green-obly channel, and the blue-only channel. When channels are separated and view in this way, they appear as grayscale. The image below is what the video looks like (blue is in the lower right panel).



The attached video plays at a slow 10fps.

It would take a lot more than barebones work to make videos like this look better. There were similar problems on the previous sample. You need a better vcr, and you definitely need a line-level tbc.


Attached Images
File Type: jpg Red Green Blue compare R.jpg (139.5 KB, 535 downloads)
Attached Files
File Type: mp4 Red Green Blue Compare 10fps.mp4 (17.65 MB, 14 downloads)
Reply With Quote
The following users thank sanlyn for this useful post: ragu0012 (09-18-2017)
  #14  
09-18-2017, 08:58 AM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
After further investigation, I think it is possible that tape is actually a 2-gen dub which could explain some quality issue. Sorry for the poor example.

Before determining the VCR is bad, would you peek at these attached clips? These are Huffyuv captures from four different tapes. I know for a fact they were all shot with the same JVC VCR and each one is a different type of scene (indoor/outdoor, etc). These collectively would be a good representation of my captures going forward as-is.





Quote:
Originally Posted by sanlyn View Post
That video is i8n very bad shape and has no detail to work with. It looks smeared. IS that a 6-hour slow-speed tape in a JVC player?"

Meanwhile you have some serious player problems. Besides the usual noise, you have some bad flicker and distortion in the blue channel.

It would take a lot more than barebones work to make videos like this look better. There were similar problems on the previous sample. You need a better vcr, and you definitely need a line-level tbc.


Attached Files
File Type: avi test basketball.avi (56.69 MB, 24 downloads)
File Type: avi test capitol.avi (60.12 MB, 14 downloads)
File Type: avi test indoor wrestling.avi (60.11 MB, 12 downloads)
File Type: avi test outdoor race.avi (64.67 MB, 11 downloads)
Reply With Quote
  #15  
09-18-2017, 03:46 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,508
Thanked 2,449 Times in 2,081 Posts
The VCR is fine. As expected, you're getting exceptional quality playback from it.

The issues is just a "bad" (not really) tape on the 'loutest2.avi' sample clip. The primary issue is chroma offset (slight left shifted color bleed), and some overall chroma noise. Avisynth shift for the former, VirtualDub CCD for the latter. Then all you're left with the some white-balance issues, from when it was shot (not a tape issue). Depending on several factors, I may or may not leave those alone.

The 'loutest2.avi' sample also so some chroma smearing, which would make sense if a 2nd-gen dub.

Too many folks forget that VHS had sub-4:2:2 color-under (though not as bad as 4:1:1). So it does appear worse, at a glance, than SD broadcast/digital video for that fact alone. It does appear somewhat smeary, even with a pumped-up edge contrast/sharpen (ie external detailers, Panasonic AG01980 sharpen sliders).

I think you're project is going fine. The hardware is performing well for you.

If you really want to correct scene-by-scene, you have some great advice by sanlyn here.

You can also apply what's he's shown you, using my more conservative approach, to do whole-tape corrections when needed, and not scene-by-scene.

Nothing in this thread is bothering me. I see no major flaws.

- 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: ragu0012 (09-18-2017)
  #16  
09-22-2017, 11:02 AM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
As I experiment with all sorts of avisynth filters, I am getting a little confused about which ones require deinterlacing to be done (then re-interlacing at the end)
Reply With Quote
  #17  
09-22-2017, 11:39 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
Motion smoothing, dropouts, spots, frame hops, chroma bleeding, edge cleaning, anti-aliasing, bad frame correction, and resizing require deinterlacing. Levels and color correction do not. With many denoisers you can use SepareateFilds and re-weave fields back together, but this feature varies. The plugin's documentation often tells you what to do. For a specific filter, ask about bst performance.
Reply With Quote
  #18  
09-22-2017, 12:40 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,508
Thanked 2,449 Times in 2,081 Posts
Chroma shifting (aka bleeding) does not require deinterlace/separate.
Some NR, even temporal, does not require deinterlace/separate.

Even when following "the rules" or best practices, odd things can happen. The key is often in re-ordering the filters. Some combinations don't play nice with others. I have several Avisynth scripts I want to publish, in addition to the MultiScript, but have not finished the samples and write-ups. Those all take time.

- 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
  #19  
09-22-2017, 02:28 PM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
Here is my first good crack at it. In this case I used the Lordsmurf multiscript, using the lines I felt were appropriate for this video. Also used Colormill, Curves and CCD in Virtualdub.

-Color corrected best i could in colormill while looking at histograms in color tools.
-Used threshold 50 in CCD
-I still see color noise in red wall mats, not sure best attack of that, or if it should be expected because of low light in initial video
-I'm still unclear how to reinterlace before outputting my final file. I don't need to output twice do i?

testbasketball is the original capture, and testbasketball redo1 includes my corrections.


Code:
AVISource("F:\Lou VHS Project\testing\test basketball.avi") 

### / Load ---------------------------------------------------------------------------------------- 
ConvertToYUY2 # script below this line requires YUY2 # ConvertToYUY2(interlaced=true) # alternative that specifies interlacing

### Remove chroma errors

Cnr2("xoo",4,2,64) # remove chroma banding noise, wide UV setting 
ChromaShift(C=2, L=-8) # align chroma over luma

ConvertToYV12 # script below this line requires YV12 

### YV12 color corrections 
MergeChroma(aWarpSharp(depth=10), aWarpSharp(depth=20)) # better white balance than ColorYUV(autowhite), use with overlay line below 
Overlay(last, ColorYUV(off_y=-8, off_u=9, off_v=-2), 0, 0, GreyScale(last).ColorYUV(cont_y=30)) # use with mergechroma line above 

### Deinterlacers 
AssumeTFF() # optional, BFF for DV source 
QTGMC(Preset="Slow") # best deinterlacer - balances speed + quality 
SelectEven() # 

### Antialiasing + compensation for deinterlace 
santiag(strh=2,strv=2) # antialiasing 
AwarpSharp(depth=10) 

### Common NR 
# Deblock() # remove macroblocks 
# Deen() # remove edge noise

### Sharpeners 
Sharpen(0.5) 

### YV12 Color correction 
ColorYUV(levels="PC->TV") # undo overly contrasted values 
ColorYUV(off_y=6, gain_y=-12) # lighten gamma 
ColorYUV(cont_u=-60, cont_v=-160) # increase saturation 
Levels(0,1.000,250,2,255,true) 

### Final resizers for destination format 
spline36resize(640,480) # resize to 4:3 video 

### Typical VHS overscan crop 
Crop(20,2,-16,-6) # use both lines 
AddBorders(18, 4, 18, 4) # use both lines 

ConvertToYUY2 # assumes VirtualDub or MPEG encoder is next in video workflow chain 
# SetMTMode(1) # multithreaded Avisynth only - end of script p1 
# GetMTMode(false) > 0 ? distributor() : last # multithreaded Avisynth only - end of script p2 

### /end MultiScript


Attached Files
File Type: avi test basketball.avi (56.69 MB, 38 downloads)
File Type: avi test basketball redo1.avi (35.31 MB, 36 downloads)
Reply With Quote
  #20  
09-23-2017, 02:17 AM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,508
Thanked 2,449 Times in 2,081 Posts
I rarely use CNR2, preferring CCD in VirtualDub. CCD is more effective at actual removal, while CNR2 is more about temporally smoothing it.

The MergeChroma/ChromaOverlay is often correct as is, having been created with VHS in mind, and knowing how VHS colors tend to skew. But the values can be tweaked tape to tape.

AwarpSharp has side effects. Only use when needed.

Deblock and Deen sometimes have no effect. It really depends on source.

I almost never sharpen. It has to be really blurry video. The side effect of sharpening is bringing out more noise. Sharpening is actually a task better handled in hardware.

Again, it all depends on source and end goals. Restoring back to interlaced disc formats will differ quite a bit from streaming.

The redo1 video is far too bight.
And you can easily see the sharpen brought out noise.
I think the color actually got worse, going even more green/red, and not restoring any of the blues.

- 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: ragu0012 (09-23-2017)
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Blocky, bleeding VHS video needs restoring Nightshiver Restore, Filter, Improve Quality 61 11-15-2012 09:50 PM
Manuals for JVC video gear, used for restoring video [DOWNLOADS] robjv1 Video Hardware Repair 1 02-11-2011 04:19 PM
Manuals for Sign Video/Studio 1 video gear, used for restoring video [DOWNLOADS] robjv1 Video Hardware Repair 1 08-20-2010 01:19 PM
Mac video editing, capturing, restoring, VHS to DVD - help? Whuntmore Project Planning, Workflows 14 03-16-2010 07:01 PM
What hardware for restoring/cleaning video ? couldbe Restore, Filter, Improve Quality 3 03-16-2004 03:42 PM

Thread Tools



 
All times are GMT -5. The time now is 03:35 AM