Log in

View Full Version : Scrip Help Please?


dennisthemenace
12th April 2006, 22:46
I have the following AVISynth script that works:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
video_d2v = MPEG2Source("C:\Videos.d2v")
audio_d2v = DirectShowSource("C:\audio.ac3",23.976,video=false).CacheAudio()
audio_amp = Amplify(audio_d2v,5)
AudioDub(video_d2v,audio_amp)
DelayAudio(-0.17)
Crop(0,56,0,-56)
Lanczos4Resize(640,392)

I was playing around with this and moved the crop and resize lines after the video.d2v DirectShowSource line. When I tried to run this I got an error saying there was an invalid arguement to the Crop function. Why would moving the bottom 2 lines of the original script to the 4th and 5th line cause this error? Is there a programming or syntax rule that governs the order of the statements?

Lil' Jer
13th April 2006, 00:54
Because of the fact that it doesn't recognize any clip to work on until you do the audio dub line. If you want the Crop command after you load the video into the variable you have to change your crop line to video_d2v=Crop(video_d2v,0,56,0,-56).

foxyshadis
13th April 2006, 01:04
Because at that point there's no implicit video clip getting passed around, only nomed video clips. The implicit "last" is only created by audiodub (since it isn't assigned to any named clip). Before that you can tack it onto the end of mpeg2source with dots, or use

video_d2v = MPEG2Source("C:\Videos.d2v")
video_d2v = video_d2v.Crop(0,56,0,-56)
video_d2v = video_d2v.Lanczos4Resize(640,392)

Or get rid of video_d2v alltogether, and just pass audio_amp to audiodub (which would then use mpeg2source's implicit last as its video-in). ;)