Log in

View Full Version : VHS to DVD - preprocess in AviSynth.


salawalas
2nd April 2008, 21:04
Hi Folks!
First of all, I'd like to excuse everyone for my lame English, cause it's not my native language.
This is my first post here, so I humbly ask for Your understanding.
So, Ad Rem.
I captured some a VHS footage and I wish to encode this to MPEG-2 (with CCE) and than burn to DVD. Before encoding, I'd like to do some preprocess in Avisynth. I know, quality this stuff is a cr*p, but I want to do all my best, because the footage belongs to my elderly neighbour.

Some sample (Lagarith Lossless codec, YUY2 pure sample):
1. http://www.megaupload.com/?d=GBCZ8VOV (31,2 MB)
2. http://www.megaupload.com/?d=SOFVTBTW (31,9 MB)

What can I do with this?
Should I deinterlace this?
What is the right order in preprocess?
I read the Analog Capture Guide : http://www.doom9.org/index.html?/capture/start.html, but still I can't manage with this stuff and I need Your advice.

This is my sample script:

Import("C:\Program Files\AviSynth 2.5\plugins\MC_Spuds.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avs")
SetMTMode(2)
SetMemoryMax(768)
SetMTMode(5)
Avisource("F:\film_1.avi")
SetMTMode(2)
Cnr2("xxx", 4, 5, 255)
GuavaComb(Mode = "PAL", Recall=83, MaxVariation=25, Activation=40)
ConvertToYV12(interlaced=true)
AssumeBFF()
nnedi(field=2,threads=0,opt=2)
SetMTMode(2)
MC_spuds(frames=3,strength=4,colorbleed=true,aggressive=true,sharpp=2,ss_x=1.25, ss_y=1.25,lsfstr=80)
AssumeBFF().SeparateFields().SelectEvery(4,0,3).Weave()
SetMTMode(2)
ColorYUV(off_y=0, gain_y=+2)
Tweak(sat=1.2)
ConvertToYUY2(interlaced=true)

I need Your advice. :helpful:

sixide
2nd April 2008, 21:18
AssumeBFF().SeparateFields().SelectEvery(4,0,3).Weave()
Maybe I'm mistaken, but wouldn't you want SelectEvery(4,0,2) here? SelectEvery(4,0,3) would be a bit jerky I think.

Also, I'd probably use yadifmod+nnedi, you'll see a quality improvement without much slowdown.

salawalas
2nd April 2008, 21:38
Maybe I'm mistaken, but wouldn't you want SelectEvery(4,0,2) here? SelectEvery(4,0,3) would be a bit jerky I think.

I'll try this one.:thanks:

Also, I'd probably use yadifmod+nnedi, you'll see a quality improvement without much slowdown.

Ok. I found this:
interp = nnedi(field=2,threads=0,opt=2)
yadifmod(order=-1, field=-1, mode=1, edeint=interp)

I'll try. It's slow enough already.

halsboss
3rd April 2008, 10:35
Which SelectEvery ? The definitive answers in this thread :-
http://forum.doom9.org/showthread.php?p=1110741#post1110741
See the top 2 examples in that post.

2Bdecided
3rd April 2008, 11:50
Double rate progressive to standard rate interlaced is always
assume?ff().SeparateFields().SelectEvery(4,0,3).Weave()
when you use the correct assume?ff for the intended output.

However, if the source really is a film as the file name implies (I didn't download your sample), I'm not sure why you're touching interlacing.

Cheers,
David.

salawalas
3rd April 2008, 14:37
halsboss & 2Bdecided thanks for your concern!

I assume the footage is BFF, so should I use:
AssumeBFF().SeparateFields().SelectEvery(4, 0, 3).Weave() -> BFF
to preserves the original field dominance ?

However, if the source really is a film as the file name implies (I didn't download your sample), I'm not sure why you're touching interlacing

In Your opinion should I stay away from deinterlace this material and instead use something like this?

Import("C:\Program Files\AviSynth 2.5\plugins\MC_Spuds.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avs")
SetMTMode(2)
SetMemoryMax(768)
SetMTMode(5)
Avisource("F:\film_1.avi")
SetMTMode(2)
Cnr2("xxx", 4, 5, 255)
GuavaComb(Mode = "PAL", Recall=83, MaxVariation=25, Activation=40)
ConvertToYV12(interlaced=true)
SetMTMode(2)
MC_spuds(frames=3,strength=4,colorbleed=true,aggressive=true,sharpp=2,ss_x=1.25, ss_y=1.25,lsfstr=80)
SetMTMode(2)
ColorYUV(off_y=0, gain_y=+2)
Tweak(sat=1.2)
ConvertToYUY2(interlaced=true)

halsboss
3rd April 2008, 15:18
AssumeBFF().SeparateFields().SelectEvery(4, 0, 3).Weave() # -> BFF

2Bdecided
3rd April 2008, 16:09
Now I've downloaded your clips, I see they're standard interlaced home movies. You must deinterlace before mc_spuds, as you were doing originally.

If you have the original tapes, and care enough about the content, you should get an S-VHS deck with integrated TBC and re-capture the content via S-video connection (even though it's VHS). This will avoid the cross-colour artefacts and remove the tape-induce wobble (it won't fix the wobbly camera work, but DeShake can help if you want to fix that - I think it adds character and leave it in!).

If not, what you had originally was fine, except that your footage is TFF, so you need the correct assumetff() statement(s), and nnedi(field=-2...).

That said, for my taste, the result looks like a cartoon, rather than a video of live action. YMMV.

Cheers,
David.

salawalas
3rd April 2008, 16:33
Now I've downloaded your clips, I see they're standard interlaced home movies. You must deinterlace before mc_spuds, as you were doing originally.

If you have the original tapes, and care enough about the content, you should get an S-VHS deck with integrated TBC and re-capture the content via S-video connection (even though it's VHS). This will avoid the cross-colour artefacts and remove the tape-induce wobble (it won't fix the wobbly camera work, but DeShake can help if you want to fix that - I think it adds character and leave it in!).

If not, what you had originally was fine, except that your footage is TFF, so you need the correct assumetff() statement(s), and nnedi(field=-2...).

That said, for my taste, the result looks like a cartoon, rather than a video of live action. YMMV.

Cheers,
David.

Thank You very much, David.:thanks:

I don't have a S-VHS deck, I've got only my old VHS Sony SLV-SE50EG deck with EURO(Scart) output :-( .

I was wrong , I thouhgt all the time it's BFF. BTW how to check this?

The footage I captured with Virtualdub by Leadtek Expert XP card and Euro-Cinch cabel. Maybe is the reason?

Thanks a lot, again.
Greetings!
Marcin

foxyshadis
3rd April 2008, 17:44
You can only ever find out if something is BFF or TFF by visual inspection (though some tools can make good guesses). Separate the fields and step through them; if you assumebff and it's all jerky, it's probably tff.

salawalas
3rd April 2008, 21:57
You can only ever find out if something is BFF or TFF by visual inspection (though some tools can make good guesses). Separate the fields and step through them; if you assumebff and it's all jerky, it's probably tff.

Thanks, foxyshadis (Death's Angel :cool:).

So the way is to load to mplayer or virtualdub some avisynth script and watch the movement?

Script like this:
Avisource("C:\sample.avi")
AssumeBFF()
SeparateFields()

In this case if the footage is TFF the movement will be jerky? Right?

Edit.
OK. I've checked. It's TFF for sure.

:thanks: Everyone.

halsboss
4th April 2008, 02:19
Yes. The other way around
Avisource("C:\sample.avi")
AssumeTFF()
SeparateFields()

will appear jerky if it's BFF.

2Bdecided
4th April 2008, 12:07
I was wrong , I thouhgt all the time it's BFF. BTW how to check this?

The footage I captured with Virtualdub by Leadtek Expert XP card and Euro-Cinch cabel. Maybe is the reason?I don't know what you mean - why would you expect it to be BFF? Only DV and analogue NTSC are BFF. You're using neither.


btw, I don't use a media player to check the TFF/BFF scripts - I drop them into virtual dub, find a bit of movement, and step frame-by-frame. After 2-4 frames, you know for sure.

You usually know for sure watching full speed too, but with some monitors and content it might not be 100% clear.

Anyway, glad you got it sorted out.

FWIW, if it was my camcorder footage, I would hope for better than a 9 year old VCR with no TBC and no S-video - but of course time is running out to find any working VCRs, so sometimes you have to use what you have!

Cheers,
David.

salawalas
4th April 2008, 20:26
I don't know what you mean - why would you expect it to be BFF? Only DV and analogue NTSC are BFF. You're using neither.

I don't remeber now. Maybe I misunderstood some chapter in Analog Capture Guide. I'm totally newbie and English is not my native language in addition, so that's the reason, I suppose... On this portal, the language is typically technical, so what it is... Doesn't matter now.

btw, I don't use a media player to check the TFF/BFF scripts - I drop them into virtual dub, find a bit of movement, and step frame-by-frame. After 2-4 frames, you know for sure.
You usually know for sure watching full speed too, but with some monitors and content it might not be 100% clear.
Anyway, glad you got it sorted out.

Now I know. It's quite simple to observable (if you know what's going on :-) ). With opposite field order, the watched picure seems moving one frame forward, next frame seems going back. Strange...

FWIW, if it was my camcorder footage, I would hope for better than a 9 year old VCR with no TBC and no S-video - but of course time is running out to find any working VCRs, so sometimes you have to use what you have!

I won't buy a S-VHS deck for a few tape, even a second hand. FWIW. Here is not a America ;-) . I appreciate that I could do it much better. The source is crucial thing here.

:thanks:
Greetings!
Marcin