Log in

View Full Version : When going from video to film should I trim first?


leonid_makarovsky
16th November 2004, 06:37
Hello,

I have about 40 minutes of video AVI file (interlaced NTSC 29.976 - source is film).

I was trying to feed TMPGenc with different segments of that video. For that reason the code looked like:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb521.dll")
AVISource("IronMaiden-a.avi")
Telecide(order=1)
Decimate(cycle=5, mode=0)
Trim(490, 60362)
LanczosResize(352, 480)

Now I was thinking that I'm trimming the 23.976 fps AVI 'cause I put the trim statement after Telecide and Decimate. Wouldn't it be better to first trim the interlaced source and then feed it to TMPGenc? So that it would've been:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb521.dll")
AVISource("IronMaiden-a.avi")
Trim(different frame #, different frame #)
Telecide(order=1)
Decimate(cycle=5, mode=0)
Trim(490, 60362)
LanczosResize(352, 480)

Eventually all the segments will be joined when they are mpeg2 files.

--Leonid

Ark
16th November 2004, 08:38
You can put Trim() wdhere you want, just do proper frame calculations.

If trim is before Telecide-Decimate you have to calculate trimmed frames on a 29.976 fps basis. If it's after you have to calculate with 23.976 fps basis.

I suggest to trim before deinterlace, so you can see in VDub the exact in-out points for trimming, then do all procesing.

Mug Funky
18th November 2004, 13:57
i second that. otherwise when you're testing out your script (filters, bugs, whatever) and comment out framerate changing functions (like decimate), then you end up comparing the wrong frames.

this doesn't affect your final encode, of course, but it's just easier to keep track if you do your cutting before the processing.

leonid_makarovsky
22nd November 2004, 06:58
Thanks for the help everyone. I basically just created rather large script that looked like:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb521.dll")
clip = AVISource("M:\IronMaiden\IronMaiden-a.avi")
main = Trim(clip, 620, 75354)
ending = Trim(clip, 0, 99)
blankout = BlankClip(ending, length = Framecount(ending), pixel_type = "YUY2", color=$000000)
clip = main ++ blankout
clip = Telecide(clip, order=1)
clip = Decimate(clip, cycle=5, mode=0)
clip = LanczosResize(clip, 352, 480)
return clip


It worked. Thanks.

--Leonid