View Full Version : Cleaning up this sample **need opinions on new clean sample**

Inventive Software
2nd January 2007, 14:41
Firstly, I'm unsure as to where this goes, so if it's more appropriate somewhere else, so be it. But it covers many areas, so here goes.

I captured a VHS recording not long ago (2006 Hungarian Grand Prix Highlights). The recording on the VHS was about 5 months old but I thought relatively clear; it seemed that way on the TV. Anyway, after attaching my capture device and sending it to HuffYUV for analysis, I ended up with about 15 GB of a fair amount of noise and interlaced artefacts. Not ideal, considering my target is a DVD Video. The sample I uploaded is a 2 second unprocessed HuffYUV YV12 fragment of the main capture (I recommend ffdshow to decode, as that's what was used) (download: http://www.megaupload.com/?d=A2XJGG9K, mirrors welcome. Second sample: http://www.megaupload.com/?d=Q5O7KSR4).

My first instinct was to clean up the interlacing artefacts. At first, I tried VirtualDub's Deinterlace filter, but was looking for something a bit more. Enter AviSynth and neuron2's Decomb filter. This cleaned up the combing lines nicely. However, there's still a hellish amount of noise, and I'm wondering if I could have captured it better.

I used VirtualDub to capture. The device was a cheap 'n' cheerful USB job, aka Tevion USB 2800D. (:search: and you'll find I've not had the best of luck with this thing.)

Capture Pin settings were as follows:

Video Standard: PAL_B
Framerate: 25
Color Space / Compression: YUY2
Output Size: 640x480
Quality: 1.000

Capture Filter settings went like this:

Video Decoder Tab
Video Standard: PAL_B
VCR Input was checked, but I don't know whether this makes any difference.

Video Proc Amp
Brightness: 128
Contrast: 32
Hue: 64
Saturation: 32
Sharpness: 0

Everything else was left as default.

If anybody can recommend I change different settings, please do!

The device supports YUY2 and I420 capture, the only catch being my target's DVD Video, so what do I go for? YUY2 supports more resolutions, but doesn't support 720x576 correctly, and is why I captured at 640x480. If my target's DVD, am I better off with I420, which only goes up to 640x480?

Help would be greatly appreciated. :) I will upload a different sample that's not got so much motion.

3rd January 2007, 13:34
A few bits and bobs stick out.

Your location says Nottingham so I am guessing Nottingham UK.

If so, your local TV standard is PAL-I, not PAL-B. I am not sure as to the impact this would have on the quality of your capture but worth trying recapturing a sample with the correct setting.

As for deinterlacing, since the desired output format is DVD, I would leave it interlaced. However, this creates difficulties with vertical resizing and denoising. Is there any way you could capture with a vertical dimension of 576?

If a cap in PAL-I mode was less grainy and the vertical dimension was correct, an interlaced MPEG2 encode would produce good results. You could apply any colour/contrast/gamma correction etc with interlaced footage but denoising is more complex.

Finally, as you haven't had much help, I've moved it to the Video Capture forum.

3rd January 2007, 15:00
If you have a DV camcorder with an analogue composite video/audio input, you might have more success capturing to DV tape first... Which usually copes very well with a interlaced video sources.

I'm quite surprised your HuffYUV capture only has a resolution of 640x480 pixels, as this is an NTSC resolution, not PAL.


Inventive Software
3rd January 2007, 17:41
@Nick: Indeed, tis UK. I will do a recapture later on, with PAL_I to see whether this improves it.

@SMD: I'm well aware of the NTSC / PAL resolutions, and I really wanna capture at 720x576, but the device doesn't support it, and it's maximum therefore is 640x480, which is still the Aspect Ratio I desire (4:3). I don't have a DV camcorder, therefore I'm limited to direct capture with the cheap device I acquired.

3rd January 2007, 17:50
SMD: I'm well aware of the NTSC / PAL resolutions, and I really wanna capture at 720x576, but the device doesn't support it, and it's maximum therefore is 640x480, which is still the Aspect Ratio I desire (4:3).Bummer!

My DV camcorder recently died.... And quite honestly I can't see much point in replacing it ;)

Inventive Software
3rd January 2007, 17:59
The capture modes supported are YUY2, which is YUV 4:2:2 interleaved, and I420, which is YUV 4:2:0. The maximum framerate it'll handle is 25 FPS, any higher and it defaults back to 25, so I can't go 50 and deinterlace better. Bearing in mind my target's DVD, and the device'll handle no higher than 640x480 (which is what my I420's max resolution is), am I better off with that or sticking with YUY2?

Inventive Software
4th January 2007, 12:15
OK, thanks to my stupidity, I found out that I can actually capture at 720x576, just Overlay preview being shirty with my display. Having switched to "software" preview in VirtualDub, it now displays my desired image. :D So my resolution's sorted, as well as the colourspace (YUY2), since that's the only combination the device supports for that resolution. My only issue is cleaning up the noise. The recorded signal on the VHS was never going to be perfect, having been recorded from an internal antenna, but there must be a way to treat that lot properly. What dya think of this solution....

Use AviSynth to make the source interlaced, and then encode as interlaced from there on in MPEG-2 or MPEG-4...

Inventive Software
19th January 2007, 16:51
Okie smokie. I've been playing about with different settings, and I settled on the following AviSynth script:

This seems to clean up the noise nicely, keeping a little sharpness there for the fine details. The comparison sample is here (clicky) (http://www.megaupload.com/?d=KI78UE1F), Xvid encoded @ Q4, with QPel and GMC, 1280x480 resolution, original and cleaned version side by side, clean version is on the right. 1.1 MB (less than the lossless samples ;)).

However I'd like your opinion on:

a) whether you think it looks good or can be done better, and
b) the interlacing part of this... :D

Since my target's DVD, I figure interlacing should be there anyway. I capture interleaved at YUY2, 720x576, 25 FPS and the interlacing's there to see. However, if I do a quick and dirty interlacing, i.e:
Does that then make the resultant video interlaced and ready for encoding in, say, QuEnc or Xvid (VFW) or DivX (VFW)?