Go Back    Forum > Digital Video > Video Project Help > Restore, Filter, Improve Quality

Reply
 
LinkBack Thread Tools
  #1  
02-21-2017, 08:48 PM
Laserer Laserer is offline
Premium Member
 
Join Date: Jan 2017
Posts: 18
Thanked 0 Times in 0 Posts
I am capturing and restoring VHS for archiving, transfer to DVD and streaming purposes. I'm using Virtualdub for my work so far. I think I understand how to mask (crop) my captured Huffyuv compressed AVI files based on directions and advice from http://www.digitalfaq.com/forum/vide...erly-crop.html . However, I am not sure what stage of the restoration workflow is best for doing the masking task. I suspect that, because of the way some of the filters must work, the masking should be done at the beginning. Is this true or does it depend on what the other restoration steps (filters) are? Is masking the VHS tape artifacts the natural 1st step after capture? Thanks!
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
02-23-2017, 12:45 PM
themaster1 themaster1 is offline
Free Member
 
Join Date: Feb 2011
Location: France
Posts: 497
Thanked 99 Times in 83 Posts
You crop at the end of the filters chain, always (especially if it's interlaced footage) and add black bars if it's for dvd
ex: NTSC Video resolution: 720x480 > filters > crop -16 (resolution 720x474) > addblackbars 720x480
Reply With Quote
The following users thank themaster1 for this useful post: Laserer (02-25-2017)
  #3  
02-24-2017, 10:49 AM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,501
Thanked 2,447 Times in 2,079 Posts
When you can crop depends on the filter chain. But to be safe, do it last.

Masking techniques vary
- Avisynth = crop + add black = mask
- VirtualDub = resize, letterbox/crop to size + crop = mask
- Premiere = clip = mask

Different steps and names to accomplish same end result: black covering of noise.

When interlaced, always do in 2-pixel increments.

- 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: Laserer (02-25-2017)
  #4  
02-25-2017, 05:48 PM
Laserer Laserer is offline
Premium Member
 
Join Date: Jan 2017
Posts: 18
Thanked 0 Times in 0 Posts
Thanks for the help.

I am just getting my feet wet and I have gained a great appreciation for the depth and breadth of the knowledge and experience of the people on this site.

I have pulled together a JVC SR-V10U, TBC-100 followed by a Toshiba DVR670 (pass thru) and ending up in an AIW9600 in an XP based AMD 3200+ computer. (I also have a Panasonic AG-DS555 editing deck with DNR and TBC. Only 300 hours on the drum but I am going to sell it since my JVC SR-V10U works well and can play SP and LP tapes.)

Capturing with Virtualdub is working nicely with few, if any, dropped or inserted frames even from a really bad VHS tape in LP mode. This is an amazing improvement over just using a bare VCR that would give me 10's of drops in just a few minutes not to mention the improvement in picture quality/stability. Just now I am working on adjusting the capture levels using the Virtualdub histogram.

Next I am working up to using Avisynth with Virtualdub for more picture enhancements. Sounds like fun.

Besides a quantity VHS tapes I have quite a few MiniDV's and some 8mm film to convert.

As a retired engineer I am enjoying the steep learning curve for all of this. Great stuff.

Thanks again and I'm sure I will be back.
Reply With Quote
  #5  
02-25-2017, 06:05 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
Why are you using a pass-thru if you already have a line-tbc in your JVC player and a frame-tbc in your TBC-100? The pass-thru sees no line or frame errors and adds nothing to your capture chain except an extra connection.

Also, the TBC-100 is a frame tbc that precedes your pass=-thru unit, usually used as a line tbc and whose first function is line correction followed by frame sync correction. A line-tbc should always precede a frame-tbc, not the other way around. If a frame tbc precedes a line tbc, the line tbc sees no line error and thus corrects nothing.

You will get better results from LP tapes with the Panasonic than with the JVC. JVC never catered to extra performance processing for LP.
Reply With Quote
The following users thank sanlyn for this useful post: Laserer (02-25-2017)
  #6  
02-25-2017, 07:35 PM
Laserer Laserer is offline
Premium Member
 
Join Date: Jan 2017
Posts: 18
Thanked 0 Times in 0 Posts
Thank you for your reply.

You are right about the Toshiba DVR670 as a pass-thru especially since it doesn't have TBC etc. As you probably know the DVR670 is a combi VCR/DVD unit. My original plan was to use this as a DVD burner benefiting from the upstream JVC/DNR/TBC and the TBC100. I have used it to burn a disk while I am doing captures via my AIW9600 just to compare results but you are right and I may take it out if there is no other benefit.

I am pretty sure the Panasonic AG-DS555 only plays SP recordings. Nice deck though. It is very tempting to keep it since it has low hours (c=900hrs, d=300hrs, which is low isn't it?). I even bought the XLR connectors for the audio. Unfortunately my wife is not so inclined.

I was just goofing around adjusting the capture levels of the AIW9600 via Virtualdub. The histogram showed a lot of red on the tails. I am just adjusting the Brightness and Contrast to fix that. Is that correct?

Thanks again.
Reply With Quote
  #7  
02-25-2017, 08: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
Perhaps you should ask your wife (as I did mine, a while ago) what she would suggest doing with your remaining tapes if your JVC should develop problems.

You should adjust the histogram after temporarily cropping off any black borders as well as head-switching noise using the "Crop" window, to prevent affecting the histogram with non-content elements. Don't forget to turn off cropping (set all crop values back to zero) before starting the capture. And yes, the idea is to keep most content out of the red zone.
Reply With Quote
  #8  
03-03-2017, 01:36 PM
Laserer Laserer is offline
Premium Member
 
Join Date: Jan 2017
Posts: 18
Thanked 0 Times in 0 Posts
So far the VHS tapes I am capturing are in great condition. I can clearly see the benefit of the DNR/TBC from the JVC deck and the TBC-100 but beyond that I am not sure what else I can or should do to improve the quality.

Are there some filters or other restoration steps I should take as a matter of course for VHS tapes to improve the quality?
Reply With Quote
  #9  
03-03-2017, 01:51 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
VHS captures always need extra work, even for minor problems, since VHS is inherently imperfect and has many common defects even in good condition. But without specific problems or questions, it's impossible to give details.

It's best to get advice if an unprocessed sample is posted. The sample should include motion of some kind (someone walking, moving, gesturing, etc.) and the sample should not be re-encoded. Short samples in YUV of 8 or 10 seconds are well within the file size limit for posting samples directly to the forum. To avoid any processing, color conversion, or recompression, edit your cut in VirtualDub and save it using "direct stream copy" mode (found under the "Video" dropdown menu). Please do not post to YouTube or other download sites.
Reply With Quote
  #10  
03-03-2017, 03:41 PM
Laserer Laserer is offline
Premium Member
 
Join Date: Jan 2017
Posts: 18
Thanked 0 Times in 0 Posts
Thanks in advance for taking a look at this sample. I hope I sent this sample correctly per your instructions.

This sample2 may be more representative of how I set the brightness and contrast using the histogram in VirtualDub.


Attached Files
File Type: avi Sample1.avi (66.79 MB, 43 downloads)
File Type: avi Sample2.avi (69.00 MB, 30 downloads)
Reply With Quote
  #11  
03-03-2017, 06:28 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
Nice sample. Thanks for posting. Looks as if Ernie's getting the worst of it.

A few minor issues and tape noise, but nothing difficult. Let me have a look overnight and report later.
Reply With Quote
The following users thank sanlyn for this useful post: Laserer (03-03-2017)
  #12  
03-03-2017, 08:13 PM
Laserer Laserer is offline
Premium Member
 
Join Date: Jan 2017
Posts: 18
Thanked 0 Times in 0 Posts
Great! Thanks!!
Reply With Quote
  #13  
03-04-2017, 06:07 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
Thanks for your patience. Time now to see how picky you are, and suggestions in various categories. The sample looks a little soft -- no surprise, considering interior light and wide-open lens apertures, but nothing to worry about. Some subtle midtone changes can improve perceived "sharpness" if it's important. In any case, avoid trying to oversharpen these types of soft-focus images -- oversharpening can only make it look worse and really ugly.

Your sample is a very clean capture and well handled, even if the brightest specular highlights are about 5 or 10 RGB points off spec -- something that's tricky to control during capture, especially with typical home lighting. But it's so easy to fix I mention it mainly because its fixed all the time for occasional mild overshoot. It's easiest and simple to fix in Avisynth and YUV, a little more complicated in VirtualDub. Vdub's gradation curve filter is good at this sort of thing because it can target very precise luma areas. In Avisynth I did it with Avisynth's "Levels" function to gently roll off values above y=235.

Other problems were mild, but of course they do add up. It depends on how "digitally clean" you want for results. There is minor but visible tape noise, more obvious in the red chair in the lower right and in the dark upper right and left shadows (it looks like subtle "horizontal rain" and a little chroma flicker). it can be fixed in either Avisynth or Virtualdub with temporal smoothers. Resharpening would be needed, but most sharpeners maked edge artifacts and will amplify grain. I chose to resharpen with Avisynth's carefully designed plugin, LimitedSharpenFaster, which avoids many unwanted effects. More annoying is excessive combing artifacts during motion, which required Avisynth for repair and is a common problem with home video cameras. There's some chroma shift and mild bleed, seen in the red chair -- easiest to fix in Avisynth but not likely to be 100% perfect, considering the way VHS usually mishandles red. At this point I'm bypassing Avisynth code details unless you want to get into it. Some fixes are best done with Avisynth, others in VirtualDub. Each app has its limits and advantages.

There is a DeShaker filter in VirtualDub that stabilizes most forms of camera tilt and jiggle. I didn't use it here. DeShaker works well and is highly adjustable but can cost some image real estate after new borders are rearranged and cleaned up. There are 4 pixels of head switching noise along the bottom border. You can mask 4 pixels in VirtualDub; I elected to use Avisynth to crop off the bottom 4 scanlines, then added two black lines each to top and bottom borders to center the frame vertically without affecting the original image.

Easiest to deal with is a slightly dim appearance because of the lighting. This was fixed in VirtuaLDub by raising targeted midtones with VDub's colorMill and gradation curve filters. Note that "brightness" won't work here because it would wash out the darks. "Contrast" won't work, either, because brights are already at peak levels. So raising midtones and saturation a bit did the trick.

The attached mpg tweak sample was encoded for DVD with MPEG2, which IMO handles interlacing and subtle textures more accurately than h.264. Also attached is an annotated Avisynth .avs script I used for cleanup and running in VirtualDub. An .avs file is a simple text file you can read in Windows Notepad or any word processor.


Attached Files
File Type: mpg Sample2_Tweak.mpg (9.07 MB, 37 downloads)
File Type: avs Sample2_02C.avs (1.1 KB, 30 downloads)

Last edited by sanlyn; 03-04-2017 at 06:48 AM.
Reply With Quote
  #14  
03-04-2017, 07:00 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 453
Thanked 3 Times in 2 Posts
I wish I got to work with source files this good...

When you talk about combing, and fixing it with Vinverse, are you saying the QTGMC deinterlace isn't fully working?
Reply With Quote
  #15  
03-04-2017, 08:34 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 koberulz View Post
I wish I got to work with source files this good...
So do I.

Quote:
Originally Posted by koberulz View Post
When you talk about combing, and fixing it with Vinverse, are you saying the QTGMC deinterlace isn't fully working?
QTGMC isn't used to fix residual combing artifacts, but it can be helpful for some aliasing and mice teeth edge problems.

Since vInverse deals with smoothing out luminance fluctuations in some manner, and because these are part of sloppy interlacing and the cause of residual combing problems, I used the Inverse2() function of the plugin which is sourced from some code by didee at doom9. If you want to know exactly what didee was doing his original script is here: https://forum.doom9.org/showthread.php?p=841641. The source code that comes with the vInverse plugin would tell you how it's implemented in the vInverse .dll. I don't design filters, I just use them according to the ways designers tell us to. For example, I wouldn't use vInverse to repair aliasing or mosquito noise. You have to experiment with its settings at times, even though the defaults usually work, because stronger settings can cause more obvious blurring.
Reply With Quote
  #16  
03-04-2017, 09:29 AM
Laserer Laserer is offline
Premium Member
 
Join Date: Jan 2017
Posts: 18
Thanked 0 Times in 0 Posts
Wow! I am very impressed! Your insight into the shortcomings of this sample is amazing and a lot for me to absorb. Thank you.

I may be more curious than picky but the result is the same. I am going try to duplicate your work as an example to help me move up the learning curve for the mechanics of using Avisynth with Virtualdub.

My other tapes may not be so good. This one was probably the first recording with my new VHS camera 25+ years ago. I'll bet things degraded over the next 10 years or so.

What tool did you use to measure the "5 or 10 RGB points off spec"?

Thanks again.
Reply With Quote
  #17  
03-04-2017, 10:00 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 453
Thanked 3 Times in 2 Posts
Quote:
Originally Posted by sanlyn View Post
QTGMC isn't used to fix residual combing artifacts, but it can be helpful for some aliasing and mice teeth edge problems.
My understanding is that 'combing' is what happens when you view an interlaced video on a progressive display. Deinterlacing should eliminate this. Am I misunderstanding?
Reply With Quote
  #18  
03-04-2017, 10:08 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 Laserer View Post
What tool did you use to measure the "5 or 10 RGB points off spec"?
I eyeballed the frames using a Levels histogram in Avisynth and an RGB histogram in Virtualdub. It was just a mild overshoot, common and easily corrected. If you wanted an exact measure in YUV you would use an Avisynth function called Analyze, which overlays a table of numbers onto the frame. The coded line in a script would be would be:
Code:
ColorYUV(Analyze=true)
If there are borders or switching noise in the frame, they should be cropped to avoid throwing off the numbers. But in this case the levels were well controlled so this wasn't necessary. Most of the overshoot was the lamp in the background.

Avisynth looks intimidating at first, but you tend to use the same filters and techniques most of the time. If the tape is in bad shape, as most of my 1990's tapes were (nightmares, really) you'd use heavier filters.

Let us know if you have problems with Avisynth or VirtualDub plugins. Fortunately many are built-in or easy to find. Now and then you get the maverick that doesn't seem to exist anywhere. I hate those.
Reply With Quote
  #19  
03-05-2017, 03:47 PM
Laserer Laserer is offline
Premium Member
 
Join Date: Jan 2017
Posts: 18
Thanked 0 Times in 0 Posts
What do you use to play and view files when you are making critical assessments about restoration steps etc. Do you just open up VirtualDub in full screen on a computer monitor or something like that?

I am working on the installation of the plugins for QTGMC. I think I am running into version issues since my AMD 3200+ does not support SSE2. I am getting Kernel32 issues when trying to open an .avs script in Virtualdub. I noticed that several of the plugins are ____SSE2.dll
Reply With Quote
  #20  
03-06-2017, 03:07 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 Laserer View Post
What do you use to play and view files when you are making critical assessments about restoration steps etc. Do you just open up VirtualDub in full screen on a computer monitor or something like that?
I just use VirtualDub as-is. I seldom have to magnify the input or output pane (right-click on the pane you want to adjust to get a menu). Resizing the panels results in distortion beyond a certain point, for example aliasing. Also, remember that Virtualdub is an editor and frame server client, not a media player, so video won't be as smooth as it is in Media Player Classic. I run Virtualdub resized to almost fill the 16:9 screen, but the top and sides have a few pixels clearance in case I need something just behind the window. My desktop itself is a solid panel, not fancy wallpaper, in a neutral color to prevent affecting color balance (in this case my desktop's solid color is set at RGB 32, which isn't quite black). Lighter shades pf gray were too distracting. The dark color also helps 8 rows and 5 columns of left-hand desktop icons to stand out visually. To prevent overpopulating the desktop I have many icons categorized inside desktop folders.

When running a script I have two running program icons available in the bottom taskbar: VirtualDub and the current script. I can click on either to change the focus back and forth. You can observe changes in a script by stopping it in VDub, changing the script, and then clicking "Reopen video file" or pressing F2 -- either action will repaint the current frame. You probably notice that a script runs slowly with heavy-duty filters like QTGMC or many others; you can speed things by commenting-out the line(s) with the slow filters that you don't need at the moment. An example of some original script passages that have been commented-out:

Code:
AviSource(vidpath+"Sample2.avi")
# return last
AssumeTFF()

# -- temporary ---- #
# Crop(4,4,-20,-4) #.AddBorders(10,0,8,0)
# return last
Crop(0,0,0,-4).AddBorders(0,2,0,2)

#ColorYUV(off_y=-3)
#ColorYUV(cont_v=-20)
Levels(16, 1.0, 255, 16, 250,coring=false,dither=true)

#ConvertToYV12(interlaced=true)
#ColorYUV(analyze=true)
#Histogram("Levels")
 return last

QTGMC(preset="super fast",EZDenoise=8,denoiser="dfttest",border=true,GrainRestore=0.3)
vInverse2()
# return last

ChromaShift(C=2) #,L=-2)
MergeChroma(awarpsharp2(depth=30)) #.awarpsharp2(depth=20))
............
............
The code portion above is of course a complete mess, but you can see that "#" has been used to disable some lines at certain points. Also, note how many times "return last" appears at certain points. When not not disables by a comment mark, "Return last" stops a script at that point and returns the last step that was executed. In the case of the script above, the script will stop just above the line that would have executed QTGMC.

I could also have allowed the script to continue, but without QTGMC running, as shown:

Code:
AviSource(vidpath+"Sample2.avi")
# return last
AssumeTFF()

# -- temporary ---- #
# Crop(4,4,-20,-4) #.AddBorders(10,0,8,0)
# return last
Crop(0,0,0,-4).AddBorders(0,2,0,2)

#ColorYUV(off_y=-3)
#ColorYUV(cont_v=-20)
Levels(16, 1.0, 255, 16, 250,coring=false,dither=true)

#ConvertToYV12(interlaced=true)
#ColorYUV(analyze=true)
#Histogram("Levels")
# return last

#QTGMC(preset="super fast",EZDenoise=8,denoiser="dfttest",border=true,GrainRestore=0.3)
#vInverse2()
# return last

ChromaShift(C=2) #,L=-2)
MergeChroma(awarpsharp2(depth=30)) #.awarpsharp2(depth=20))
............
............
Normally, of course,m all these extra lines get cleaned up for the final script.

Quote:
Originally Posted by Laserer View Post
I am working on the installation of the plugins for QTGMC. I think I am running into version issues since my AMD 3200+ does not support SSE2. I am getting Kernel32 issues when trying to open an .avs script in Virtualdub. I noticed that several of the plugins are ____SSE2.dll
All AMD CPU's since Athlon64 support SSE2, which goes back quite a long way.

When you see Avisynth or Virtualdub errors running scripts, post the entire text of the error message or make a screen capture and crop the image down to the message panel. Often it's also necessary to post the script.

Another suggestion: if you have a filter package that includes two versions of a plugin (an SSE2 version and a non-SSE2 version of the same name), don't install both dll's. Don't install SSE3 versions at all. Note that some filters come in two versions, one for AMD and one for Intel (although that involves optimization only. It's unlikely that an AMD version would fail on an Intel machine). Often the complete error message gives further clues about which plugin is involved, in which case it might be necessary to check versions or creation dates. Many kernel errors are due to missing Microsoft VisualC++ runtime files or the ubiquitous fft3d system library errors -- if those are needed it's usually indicated in the documentation for the filter.
Reply With Quote
Reply




Tags
cropping, filters, restoration, vhs restore filter, virtualdub

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Properly Crop the Overscan in VirtualDub [GUIDE] kpmedia Edit Video, Audio 32 02-01-2021 10:35 PM
Useful filters in VirtualDub when capturing? icnkay Restore, Filter, Improve Quality 1 02-08-2018 08:52 PM
VHS restore filters using Avisynth and VirtualDub - advice? Zoink187 Restore, Filter, Improve Quality 13 07-24-2014 09:38 PM
Lens distance for FX vs DX/crop lenses on digital SLR? manthing Photo Cameras: Buying & Shooting 1 08-06-2012 12:55 PM
Restore VHS to DVD-What do I need? cc4npg Restore, Filter, Improve Quality 8 06-26-2011 02:23 AM

Thread Tools



 
All times are GMT -5. The time now is 07:19 AM