PDA

View Full Version : Avisynth not fully working in VirtualDubMod?


mel2000
12th June 2007, 17:54
I downloaded and merged the latest Avisynth (version 2.5.7) to use with a script for VirtualDub-MPEG2 1.6.14. I wanted the script to load and trim 2 of 3 small AVI videos, dissolve each clip into the beginning of the following one, concatenate all 3 of them, crop the merged video all around, resize it, and fade it at the beginning and end.

However, all VirtualDub does is concatenate the files and fade out the final result. I'd like someone to look at the script to see why all my script commands are not executed. I've tried a lot of syntax combinations according to various online manuals, but no luck.

All the videos are located in the same directory as the avs file
No audio involved
Full processing mode used
Each file is 475x475 pixels width and height
Each file contains 499 frames
**********************************************
vid1 = DirectShowSource("vid1.avi")
Trim(vid1,1,472)

vid2 = DirectShowSource("vid2.avi")
Trim(vid2,1,472)

vid3 = DirectShowSource("vid3.avi")
Trim(vid3,1,472)

Dissolve(vid1,vid2,vid3,15)

vid_final = UnalignedSplice(vid1, vid2, vid3)
Crop(vid_final,55,55,-55,-55)
BicubicResize(vid_final,300,400)
FadeIn2(vid_final,15)
FadeOut2(vid_final,15)
**********************************************
Any help appreciated. Thanks.

neuron2
12th June 2007, 18:03
vid1 = DirectShowSource("vid1.avi")
Trim(vid1,1,472)

vid2 = DirectShowSource("vid2.avi")
Trim(vid2,1,472)

vid3 = DirectShowSource("vid3.avi")
Trim(vid3,1,472)

Dissolve(vid1,vid2,vid3,15)

Crop(55,55,-55,-55)
BicubicResize(300,400)
FadeIn2(15)
FadeOut2(15)

ChiDragon
13th June 2007, 00:44
vid1 = DirectShowSource("vid1.avi")
Trim(vid1,1,472)

vid2 = DirectShowSource("vid2.avi")
Trim(vid2,1,472)

vid3 = DirectShowSource("vid3.avi")
Trim(vid3,1,472)

Dissolve(vid1,vid2,vid3,15)

Crop(55,55,-55,-55)
BicubicResize(300,400)
FadeIn2(15)
FadeOut2(15)

Aren't the Trimmed clips never used with this script? Shouldn't it be:

vid1 = DirectShowSource("vid1.avi").Trim(1,472)
#(etc.)

or

vid1 = DirectShowSource("vid1.avi")
vid1 = Trim(vid1,1,472)
#(etc.)

neuron2
13th June 2007, 00:48
Oops, yes. I meant this:

vid1 = DirectShowSource("vid1.avi").Trim(1,472)

vid2 = DirectShowSource("vid2.avi").Trim(1,472)

vid3 = DirectShowSource("vid3.avi").Trim(1,472)

Dissolve(vid1,vid2,vid3,15)

Crop(55,55,-55,-55)
BicubicResize(300,400)
FadeIn2(15)
FadeOut2(15)[/QUOTE]

mel2000
13th June 2007, 16:41
Thanks ChiDragon and neuron2. I just tried your corrections with the AvsP Avisynth Script Editor and it all worked as planned (I'll try VirtualDub later). While I understand your corrections, I'm not sure why mine didn't work. I based my syntax on the Avisynth tutorials and references I read (they didn't always agree on syntax). In any case, I'm very grateful for your assistance with problems that had me scratching my head.

neuron2
13th June 2007, 16:48
Yours didn't work because you were throwing away results of your work. For example, consider the first few lines of what you had:

vid1 = DirectShowSource("vid1.avi")
Trim(vid1,1,472)

vid2 = DirectShowSource("vid2.avi")
Trim(vid2,1,472)

The result of the first Trim gets assigned to the implicit variable 'last'. But then the second Trim assigns its result to 'last' also, causing you to lose the first work. All your errors are variations of this theme.