I have been capturing some old VHS stuff for few months and trying now to get something nice out of it.
I used VirtualDub with following filter sequence :
- Denoise with Neatvideo (in interlaced mode : denoising is done on the each of the half fields)
- Desinterlace with DesinterlaceMAP
- Cropping to get rid of the garbage at the top and bottom and Nulltransform to go back to 4:3 aspect ratio.
I have been relatively happy with this sequence, but a few days ago, I played a little bit with Avisynth and the QTGMC script ( http://avisynth.org/mediawiki/QTGMC ). I was very impressed by the quality of the desinterlaced video.
I personally would use the denoising before everyting else, so basically Neatvideo in interlaced mode then QTGMC. But as far as I read, the desinterlacing process can bring some noise so maybe it’s better to denoise after desinterlace (so using Neatvideo in progressive mode).
What is some smartest way to go in your opinion ?
Thanks a lot for any advice.
+ Reply to Thread
Results 1 to 19 of 19
The proper term is "deinterlace", not desinterlace. But I do understand your spelling from the French version, "désentrelacement".
First, let me clarify something. By using NeatVideo first and QTGMC afterward, you have to convert from YUV to RGB, then convert again from RGB to YUV. There are proper and improper ways of making those conversions. I would not be able to say how you made the conversions. If one intends to perform processing with a YUV source in YUV and in RGB, it is best to perform all YUV processing first, rather than convert back and forth. Sometimes, however, and for various reasons, the two conversions might be necessary. It depends on the specific video.
I don't know why you are deinterlacing. It isn't always necessary. But if a video must be deinterlaced, I would recommend using QTGMC first. In many cases, QTGMC can clean noise and other defects to the point where further work with more noise filters is not necessary. But this, too, depends on the source. The character of denoising with QTGMC and with NeatVideo is not exactly the same; each of the filters addresses noise in a different manner, and each addresses different kinds of noise. Again, the filtering depends on the source. Very badly damaged video often requires multiple stages of filtering, and different filter types. Many users tend to use more filtering power than is needed.
I have used deinterlaceMAP some time ago. I did not like the results. QTGMC would be superior.
Last edited by sanlyn; 27th Aug 2013 at 08:13.Our inventions are wont to be pretty toys, which distract our attention from serious things. They are but improved means to an unimproved end. -- Henry David Thoreau
QTGMC also has an explicit optional noise reduction option. For example:
First of all, many thanks for your answers.
Sanlyn, you are right: I accidentally included the latin ‘s’ between two vowels in my English translation. Indeed, the right term is deinterlace.
I did not consider the double conversion that the usage of a VirtualDub plugin would require (as far as I recall, the VB plugins are working in RGB mode). I had to convert to RGB32 before using Neatvideo and this is done, according to the NV documentation by calling ConvertToRGB32().
I think that I will take some time to consider the (various) options of QTGMC.
No problem with the spelling. You should see what some European readers tell me about the difficulties in translating from typically bad English grammar!
I find that QTGMC default settings work well most of the time. But there are always those special video "problems" that are challenging for even the best filters. At least the QTGMC html file and the NeatVideo manual give users plenty to think about. Most users never look at them.
You are converting properly. If your source is YUV you will likely find visibly cleaner results by working in the original colorspace first before converting, if conversion is necessary.
You might be interested in a recent thread that compares several Avisynth noise filters with QTGMC, with some sample videos:
http://forum.videohelp.com/threads/358043-A-comparison-of-AVIsynth-denoise-filters?p=2...=1#post2259819Our inventions are wont to be pretty toys, which distract our attention from serious things. They are but improved means to an unimproved end. -- Henry David Thoreau
Assuming the video really is interlaced and the signal is not completely swamped by noise, deinterlacing well then denoising well is better than denoising then deinterlacing. Denoising (spatial and/or temporal) works best on full progressive frames; doing it on separated fields is just a hack (albeit a very widely used one).
I've never felt the need to use NeatVideo with VHS sources (except certain home movies). It works best with noise which has some kind of pattern or fingerprint, and VHS noise doesn't. NeatVideo's temporal noise reduction is rubbish. Used gently, it's spatial noise reduction is useful, but you can do well enough with spatial+temporal NR in AVIsynth. Whatever you use, leave a little high frequency noise in to avoid the result looking like plastic.
I did some tests during this afternoon : here are some illustations.
The first one is the original captured frame. I took an exemple where the muppet move a lot inducing some interlacing artefacts. I tested many deinterlacer, QTGMC was the one with which I was the most happy.
The second picture is the output of QTGMC. You can see some noisy color (pink, yellow alternating) artefacts on the background in the upper left corner (over ernie's head). I tried the EZNoise directive, but it didn't brought anything.
On the third picture, Neatvideo managed get ride of that noise, I juste reduced the strengh of the noise reduction not to let the video look like plastic (was a bit strong with autoset).
Could you upload a short sample of the source video? Without reencoding it. It seems likely to me that an American TV show converted to PAL could use some other filtering.
Last edited by jagabo; 30th Aug 2013 at 17:33.
The first aired shows were the US versions dubbed in german but since the 80ies they were studio recorded in Germany.
Here attached is a 5 seconds sample of the captured video. It is compressed with Lagarith (loseless codec).
Ah, so it's native PAL video, not converted from NTSC.
You can eliminate those dot crawl artifacts with a sequence like:
BilinearResize(width/2, height) Sharpen(0.3,0.0) # adjust to your liking Spline64Resize(width*2,height)
Last edited by jagabo; 31st Aug 2013 at 10:22.
So I changed my capture card for an ATI X800GT AIW.
Attached to this message, there's a raw extract of 3 seconds of the footage (PAL broadcast recording) that I captured with VirtualVCR in the native resolution of my card 704x576. The video are HuffYUV encoded (extract_raw.avi)
As you can see, the video is relatively noisy and there are those pink/yellow artefacts (visible on still pictures).
I tried a few filters :
- TemporalSmoother gives some interesting results but notable ghosting to get ride of the noise
- RemoveGrain (tried modes 13 to 17) but without interesting results
- Neatvideo : in my opinion gives a nice result, I attached a filtered extract (extract_nv.avi)
Which other filter would come to your mind which could possibly do as good or better than NV ?
Thanks a lot,
NeatVideo is not very effective against rainbows. The source clip you posted has oversaturated red and some over sharpening effects.
VirtualDub's DeFlicker.vdf and ColorMill. In Avisynth I used QTGMC at "medium", then TemporalSoften + SmoothUV + FluxSmoothT across the top half to smooth the luma flashing and horizontal rainbows; plus MVDegrain2, aWarpSharp, FixChromaBleeding2, ChromaShift, Cnr2, an nnedi2+SangNom routine to smooth some crosshatching, aliasing, and broken edges; and GradFun2DBMod and AddGrainC to relieve some of the banding and block noise in the background walls. I could not repair all of the chroma bleed, which is rather severe and is responsible for some of the "soft" appearance of the video.
Last edited by sanlyn; 21st Nov 2013 at 19:20.Our inventions are wont to be pretty toys, which distract our attention from serious things. They are but improved means to an unimproved end. -- Henry David Thoreau
Sanlyn did a good job with the other noise so I thought I'd just address the dot crawl herringbone noise as discussed earlier:
AviSource("extract_raw.avi") AssumeTFF() ConvertToYV12(interlaced=true) BilinearResize(width/2, height) # greatly reduced herringbone QTGMC() # bob deinterlace Sharpen(0.3,0.0) # sharpen vertical edges nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=width*2, fheight=height) # restore width Sharpen(0.3,0.0) # sharpen vertical edges again
Yep, I knew I'd seen jagabo's or a similar anti-hash routine somewhere. Spent an hour looking for it. Thanks for posting. This time, I'll keep a copy of it in a safe place.
It's easy to remember. Them main functional item is the BilinearResize() to half width. That works with VHS sources because they barely have half the resolution across the width anyway. That is, you don't loose much detail by reducing the frame to half width. The rest is just scaling back up to full width with a little sharpening. If you don't want to use QTMGC() just use one of the simple resizers instead of nnedi3:
(interlaced source) BilinearResize(width/2, height) # greatly reduces herringbone Sharpen(0.3,0.0) # sharpen vertical edges, use as much or as little as you think appropriate Spline36Resize(width*2,height) # back to full width Sharpen(0.3,0.0) # a little more sharpening
I'm really really impressed sanlyn, the output looks really great... it's incredible ! I have a lot to learn.
I downloaded and sorted and all the filters you mentioned and tried them out to see how they act on the video stream.
- TemporalSoften (noise reduction)
- SmoothUV (Rainbow removal)
- FluxSmoothT (Temporal Smoother)
- MVDegrain2 (grain remover)
- aWarpSharp (sharpener)
- FixChromaBleeding2 (chroma bleed reducer)
- ChromaShift (Chroma shift reducer)
- Cnr2 (Chroma Noise Reducer)
- GradFun2DBMod (debanding)
- AddGrainC (grain noise addition)
I have some difficult to recognize those defects (I'm not an expert) so I'll have to look at some examples, I'm searching right know)
Few questions :
- How do you select the top part of the frame in the script ?
- Why add some noise with AddGrainC ?
I tested MVDegrain2, works great reducing noise on the picture.
jagabo, I remember your script for reducing herringbone noise. I used it with great success my ezCap USB key which was prone to heavy herringbone noise.
Last edited by Lumbermatt; 22nd Nov 2013 at 08:32.
The two images below are from approximately the same two frames (I never could get them to match exactly!). Both are 2X magnification. The original raw.avi (top image), mkv version 5 below it. The top image shows the horizontal stripes, lines, and noise that came first in my script, before any other work. It was quite stubborn. I ran processing in 3 separate steps, tweaking the results of each; the third step (VirtualDub) finally cleaned most of it. The top image shows chroma rainbows and other discoloration, plus crosshatch, herring bone, dot crawl, chroma bleeding and smearing. I didn't apply specific anti-alias plugins (there comes a point where enough is enough with filtering). Aliasing appeared in odd areas and was inconsistent.
Avisynth, applying filters, then cropping off the part of the filtered image you want to keep. In this case I first applied cleaners and then then cropped all but the top 32 pixels of the resulting clip, and overlayed the filtered part onto the original image (there are other ways that this can be done). Usually you don't crop first, for the simple reason that temporal filters need data and space to work with:
a=last # --- save a copy of the original, and call it "a" a # --- set the focus of the processing on the "a" copy. TemporalSoften(4,4,8,15,2) FluxSmoothT() crop(0,0,0,-544,true) # --- Crop away all except the top 32 pixels of the filtered clip. b=last # --- Give a name to the filtered version -- call it "b" overlay(a,b) # --- Overlay original "a" with the filtered "b"
Grain is often added to replace some of the original grain and to simulate what many viewers interpret as "detail". With motion picture film and VHS tape, most of the fine detail is in the media grain itself. A fine-grain effect also helps to mask banding and hard-edged noise blocks, or to prevent the results from looking denuded. AddGrainC is used as part of the cleanup in many advanced plugins, including QTGMC.
I'm still playing with your avi sample. Will return later today after I repair a client's PC and clean up my very untidy script to post here, so others can get some ideas (and throw rocks at me). The attached mkv Version 5 used jagabo's routine, which replaced the original anti-aliasing routine in my first script. One round of resizing for herring bone and another resizing for anti-alias was a little too much. It's a matter of choosing between attempting "perfection" and retaining more detail. In this case, more filtering/sharpening will develop posterization effects.
Last edited by sanlyn; 22nd Nov 2013 at 22:07.
It really just depends on the noise threshold.
That determines what' done first.
More often that not, you denoise, deinterlace, and denoise again (with different filters).
The attached text file contains the text of the steps and scripts I used. You're welcome to steal these ideas (how do you think I got them?). The text file has notes on the VirtualDub filters and copies of a few Avisynth functions that are sometimes difficult to locate, with a few notes on their use or original source.
In this script I modified jagabo's resize routine by replacing BicubicResize with Spline16Resize. BicubicResize usually works for me, but in this case it softened details to the point where they began to smear with later filtering. I actually experimented with many downsamplers (I even tried one that is a plugin for After Effects Pro). Spline16Resize seemed to offer the most workable compromise, but feel free to try any of a dozen Avisynth resizers. Resizers that sharpen or over sharpen (such as Lanczos or Spline64Resize) retain too many artifacts, will generate new ones, and would defeat the purpose of the current routine.
The .zip file contains the noise profiles for NeatVideo, copies of ColorMill, ColorTools, and DeFlicker, and the VirtualDub .vcf file of VDub filter and compression settings for processing the two mkv's I posted. You can load the filters into VirtualDub with their settings configured by using "File..." -> "Load processing settings...", then navigate to the location of the .vcf file.
NOTE #1: Loading a .vcf will overwrite and remove all filters you have previously loaded. NOTE #2: A .vcf file is a simple text file. You can open a .vcf in Notepad and read its contents. NOTE #3: The included .vcf does not load the NeatVideo plugin. The reason for this is that the NV filter will look for its .dnp and .nfp profiles in the same location where they were previously stored on my hard drives. Obviously your system will be different, so the .vcf would display an error message. I keep .dnp and .nfp profiles in the folder that contains the source video. You may copy the profiles into any desired location, then load the NeatVideo plugin and use its dialog windows to find and load the .dnp and .nfp profiles. If you subsequently save a .vcf, your filter settings and the NeatVideo profile locations will be saved with your .vcf file. In additon to the very moderate NeatVideo filter settings, I also set its temporal filter to a value of 1, at 20% priority. The VirtualDub filters were loaded in this order:
ColorTools (disabled, but correctly configured)
Usually, however, I use NeatVideo by itself in a separate run.
The deen v2 Avisynth plugin is also attached. Required by HQdering.avs
Last edited by sanlyn; 23rd Nov 2013 at 08:34.