Log in

View Full Version : Filter set for interlaced output...


rob1
9th May 2003, 01:34
I've been lurking a while and experimenting quite a bit, and I figured it was time to ask for some feedback on my 'base' filter set.

This is for VHS conversion to DVD- interlaced source, and it appears the best option is to keep it interlaced as it's only going to be played on TV. I'm also fitting 4 hours of video per DVD, so capturing at 720x480 then resizing to 352x480 (and using ac3 audio and 2-pass vbr encoding).

Things get a little confusing for me, as many of the threads I read are for folks who deinterlace. So, can someone evaluate my approach to VHS>DVD while maintaining interlacing and going for a happy combination of speed and quality? (I start in YUV and have to end in YUV as it's going to CCE for encoding.)

Should I definitely seperate fields for filtering and then weave back together when keeping an interlaced source? Should I definitely avoid temporal smoothers when keeping an interlaced source? Is the below a reasonable 'core' filter set (avisynth 2.5)- knowing I will 'tweak' it for the needs of a particular video?


LoadPlugin("blah, blah, etc....")
AVISource("E:\Classic\06.avi")
clip1=Trim(192234,194249)
clip2=Trim(194290,196622).UnDot().Msharpen(threshold=70).TemporalCleaner(ythresh=6,cthresh=8).Tweak(sat=1.1)
clip3=Trim(196700,201441)
clip1++clip2++clip3
FixBrokenChromaUpsampling() ##for canopus decoder bug
SeparateFields()
e = SelectEven().UnDot().DNR2(7,3,5,2,5,2,"dnr1")
o = SelectOdd().UnDot().DNR2(7,3,5,2,5,2,"dnr1")
Interleave(e,o)
Weave()
BorderControl(YBB=8,YTB=8)
BicubicResize(352,480)
TemporalCleaner(ythresh=6,cthresh=8)
Tweak(sat=1.4)


Note the filtering of clip2- some of the scenes I have on tape- particularly ones outside or where it's dark, are fairly 'soft' on the VHS tape and I'm trying to sharpen them up without sharpening the entire video- which doesn't need it and increases encoding time a LOT!! I'd like to try asharp as an option, but when I use it, half the screen always ends up with massively odd coloring- as if it were masked! Don't know what's up with that, but any advice on sharping up particular scenes would be welcome- (and note- is it bad that I'm NOT seperating fields when I sharpen?). Also- the 'tweaking' is because the video is a bit washed out.

Sorry for all of the rambling questions- I am getting pretty good results with this approach. However, I'd like someone with more experience and knowledge to look it over and tell me if I'm doing (or not doing) something stupid!! Any advice is welcome- thanks very much in advance!

Si
9th May 2003, 07:43
AFAIK its generally considered a bad idea to have solid borders that are not multiples of 16 when encoding to MPEG-2.

And I'm sure there must be quicker filters for just adding a bit of black :) (Crop at beginning of script and then Addborders maybe ? )

Also, you go to a lot of effort to separate the fields in the middle of your script but you do a considerable amount of processing at the the begining with it not separated :confused:

regards
Simon

ADLANCAS
11th May 2003, 17:38
Hi people!

My source is 640x480, PALM, YUY2
Finally I tested my first script and I think the result is good, but I donīt have experience like you have here.

So, could you comment my script(Avisynth 2.51) for SVCD-NTSC:

--------------------------------------------------------
LoadPlugin("c:\Arquivos de programas\AviSynth2_temp\LoadPluginEx.dll")
LoadPlugin("c:\Arquivos de programas\AviSynth2\plugins\Convolution3DYV12.dll")
LoadPlugin("c:\Arquivos de programas\AviSynth2\plugins\Tweak.dll")

AviSource("D:\Teste\Fita 02\Fita 02.02.avi")
ConvertToYV12() # Convolution uses YV12
a = SeparateFields()
b = a.SelectOdd().Convolution3D(preset="vhsBQ").Levels (0,1.15,255,0,240)
c = a.SelectEven().Convolution3D(preset="vhsBQ").Levels(0,1.15,255,0,240)
Interleave(b,c)

BicubicResize(448,224,0,0.6,0,3,640,234).Weave()
AddBorders(16,16,16,16) # (TV-overscan borders)

ConvertToYUY2() # CCE needs YUY2
Tweak(sat=1.05)
---------------------------------------------------------

For VCD-NTSC:

BicubicResize(336,112,0,0.6,0,3,640,234).Weave()
AddBorders(8,8,8,8)

---------------------------------------------------------

In both cases, crop are right ? (I use FitCD for this resize, but I donīt know if I use correctly)
Could I have better quality/speed in encoding?

Any comments are welcome...

Thansks in advance,

Alexandre

soulfx
12th May 2003, 22:48
You could cut down on the number of color space conversions by using the Convolution3D filter compiled for 2.5 that still works in YUY2. Check out WarpEnterprises' AviSynth Filter Collection for the link to it.

ADLANCAS
13th May 2003, 13:39
@soulfx
Thanks a lot! I'll do it!

Do you know if I used resize/crop to the correctly resolution in SVCD and VCD?
As I said, I used FitCD, but I saw in DVD2SVCD FAQ that more pixels were cropped.
http://forum.doom9.org/showthread.php?s=&threadid=21859

---------------------------------------------------------
Q64: How can I avoid encoding the TV overscan area and therefore save some bitrate that would be wasted because my TV is not able to show this area?
A: Nearly all TV sets are not capable of showing all the encoded information of a DVD/SVCD. In fact they usually can't show a 16 pixels edge around the whole movie so it is not necessary to encode this information so the bitrate is better be used on other parts.
...

and then, it's suggested that:

4) For 4:3 (letterboxed) NTSC DVD source change your AviSynth script to look like this:
...
Crop(24,16,672,448) <= insert this line
SimpleResize(448,448) <= this line depends on the resize method used
AddBorders(16,16,16,16) <= add this line if not present
---------------------------------------------------------

This explanation from FAQ was used for a resolution 720x480 (I hope so).

For my source (640x480), which instruction should I use in my script?

BicubicResize(448,224,20,8,600,224) #??according DVD2SVCD FAQ???
or
BicubicResize(448,224,0,3,640,234) # according FitCD

Thanks in advance,

Alexandre

PS. Please, and about VCD-NTSC ? Is this right?
BicubicResize(336,112,0,3,640,234)

Sigma9
13th May 2003, 15:30
Am I misunderstanding something here (or in other threads...) :confused:

I am dealing with a very similar problem which is getting my PAL-DV-videocam recordings onto PAL-SVCDs. It IS similar in the sense that the source is interlaced as is the destination, so keep everything interlaced during processing is certainly a good idea.

However, resizing is needed for my case as well. And - AFAIK - resizing interlaced material yields bad results... or at least worse than what comes out by first deinterlacing (using a state-of-the-art filter) and resizing after that (this is what I caught from various threads and also experience).

Am I wrong in this? I would love to improve my results...

Any comments?

/Sigma9

Guest
13th May 2003, 22:56
@Sigma9

You can SeparateFields(), then resize, then Weave(). That is the usual way to resize interlaced material without ruining it. It won't work right for some YV12 cases, so best to do it in a fully-vertically-sampled format.

ADLANCAS
14th May 2003, 13:12
I think I've made a mistake when I asked about VCD resize, because I should deinterlace before resize.

Then I remake my questions:

For my source (640x480), which instruction should I use in my script ? (please, look my script above)

SVCD-NTSC
BicubicResize(448,224,20,8,600,224).Weave() # according DVD2SVCD FAQ ?
or
BicubicResize(448,224,0,3,640,234).Weave() # according FitCD
and AddBorders(16,16,16,16)

and for...
VCD-NTSC (I will not use SeparateFields and Weave functions, because I deinterlace the movie)
BicubicResize(344,232,0,3,640,474) # Is it right ?
AddBorders(8,8,8,8)

I'm very confused about it. Sorry if I make this redundant questions, but I've searched and read a hundread threads, FAQ, Avisynth documents, ...and...and...and...and...and...and...

I'd like only to avoid encoding the TV overscan area, preserving the aspect ratio and therefore save some bitrate (not too much!)

Thanks

Alexandre

Wilbert
14th May 2003, 14:23
I don't understand how you used FitCD (pal unchecked, ITU checked):


VCD-NTSC (I will not use SeparateFields and Weave functions, because I deinterlace the movie)
BicubicResize(344,232,0,3,640,474) # Is it right ?
AddBorders(8,8,8,8)
Must be:
BilinearResize(352, 240) # or use Bicubic


BicubicResize(448,224,0,3,640,234).Weave() # according FitCD
AddBorders(16,16,16,16)

Correct!


BicubicResize(448,224,20,8,600,224).Weave() # according DVD2SVCD FAQ ?
AddBorders(16,16,16,16)

This seems false to me, since:
AR after cropping: 600/448 = 1.3393
AR after resizing: 10/11*720/480 = 1.3636

ADLANCAS
16th May 2003, 00:12
@soulfx

I tested convolution3D that you recommended in the same script I posted, but now the speed encoding is so slower!
CCE 2.66 + convolution3DYV12.dll -> speed = 0.56 (with convertions ->YV12 -> YUY2)
CCE 2.66 + convolution3D.dll -> speed = 0.33 (no convertions were need )

Did I make something wrong or this version is really slower when using YUY2?

Another strange thing is that now Convolution filter donīt accept more (preset="vhsBQ"), then I used correspondent values.
Maybe I used not right version, did I?
(I downloaded convolution3d_25_dll_20030422.zip)



@Wilbert

I did another mistake in VCD resize(sorry). Below are parameters that I should use to have VCD (according FitCD):
(Itīs "basically" the same parameters that I used to SVCD, except Blocks TV-overscan = 2)

Source: 640x480 / 1:1 Monitor / PAL, Anamorphic and ITU-R BT.601-4 unchecked
Film pixel: 640x480 / top and left border=0
Crop: 640x468 / accurate
round to 2 and 4
Resize: 336x224
round to: 16 and 16
Destination: 352x240 / VCD / PAL and Anamorphic unchecked / Blocks TV-overscan = 1

AviSynth Script (with option "block aligned"):
...
BicubicResize(336,224,0,6,640,468)
AddBorders(8,8,8,8)
...

Did you thought about avoiding TV-overscan when you suggested "BilinearResize (352x240) ? Have I misunderstood ?

Could you comment, please, if now, resize is correct ?

Thanks,

Alexandre

sync
16th May 2003, 01:18
Since your source is VHS, I'm wondering if your source is truly interlaced. Are you sure it isn't telecined?

Wilbert
16th May 2003, 09:55
Try this version here: http://hellninjacommando.com/con3d/.

Did you thought about avoiding TV-overscan when you suggested "BilinearResize (352x240) ? Have I misunderstood ?
Yes, though it is not necessary.

I guess you left "ITU-R BT.601-4" cheched (which I would do). In that case, it is correct. Note that the specs of VCD requires that you deinterlace.

ADLANCAS
17th May 2003, 04:52
@sync

I have tested according Capture guide Doom9 and itīs trully interlaced.
Iīm not sure, but from my movie camera I canīt produce movie telecined, can I ?

ADLANCAS
17th May 2003, 05:19
@Wilbert

Thanks a lot. I tested this version and itīs the fastest!


Alexandre

sync
17th May 2003, 15:52
Originally posted by ADLANCAS
@sync

I have tested according Capture guide Doom9 and itīs trully interlaced.
Iīm not sure, but from my movie camera I canīt produce movie telecined, can I ?

I was responding to the original poster who said he was dubbing from VHS. If you are shooting the footage then it will be interlaced. But if you dub from VHS or TV then it could be telecined.