PDA

View Full Version : Aligned Splice Problem


datascab
27th January 2004, 22:13
Hi,

I'm a bit of a newbie with Avisynth but it seems like an excellent tool :)

I have found a problem with the aligned splice function though.

If I have a clip where the audio part is longer than the video clip, when this is brought into vdubmod, it makes the duration of the clip the same as the over length audio.

For example..

Video = 1:10.367
Audio = 1:10.400

Using this script...

LoadPlugin("C:\PROGRA~1\Autorv9\SOFTS\AVSFILE\MPEGDecoder.dll")

v01=MPEGSource("F:\dvd\12_([0xE0]_Video_NTSC_720x480)_1.m2v", -2, "raw")

a01=wavsource("F:\dvd\12_([0x80]_Audio_Not_Specified_AC3(2Ch)_48kHz___)_Delay_0ms.wav")

audiodub(v01,a01)

This means the clip when opened has video and audio length = 1:10.400

Doing it manually by opening the *.m2v in vdubmod and adding the audio stream, I get the proper clip length 1:10.367 and when I save the audio out, it gets shortened to the video clip length.

How can I get avisynth to ignore the extra bit of the audio part and not incorrectly extend the video part?

Its a bit of an issue since I have 12 clips to append and 5 of them have audio parts which are slightly longer than their respective video part.

Thanks

Data

Leak
27th January 2004, 23:02
Originally posted by datascab
How can I get avisynth to ignore the extra bit of the audio part and not incorrectly extend the video part?


I guess

AudioDub(v01,a01).Trim(0,v01.Framecount)

should do the trick.

np: Bill Laswell - Finite State Dub Machine (Babylon's Burning comp.)

datascab
27th January 2004, 23:11
Hello,

Thanks for that... i've just looked up the trim command and i sort of understand it but not quite how you used it.

Does your script trim the audio if it exceeds the length of the master video track?

Will it leave the audio alone if its less than the video?

Thanks

Data

sh0dan
27th January 2004, 23:11
This should be why UnAlignedSplice is there. This will not realign audio, but start when the video starts.

datascab
27th January 2004, 23:19
Hello,

Yeah I know about unaligned splice but I cant use that because some of the audio parts are less than there respective video parts.

So i have both scenarios.

Bugger.. LOL

Thanks

Data

Leak
27th January 2004, 23:27
Originally posted by datascab
Thanks for that... i've just looked up the trim command and i sort of understand it but not quite how you used it.

Does your script trim the audio if it exceeds the length of the master video track?

Well, both a01 and v01 are AviSynth clips, just one having video only and one having audio only.

What AudioDub does is take the first clip's video and the second clip's audio and create a new clip that's as long as the longer one of the two clips was, with audio and video combined (and, I guess, padding the video with blackness and the audio with silence).

My command trims that new clip to the length of the video clip, thus killing extra audio at the end. (If you're wondering where the Framecount came from - have a look in the AviSynth documentation under "Clip Properties"...)

By the way, I wouldn't use MPEGDecoder (assuming it's Nic's MPEGDecoder), as IIRC it doesn't take the frame repeat flags of DVDs into account.

np: HIM - Disco Lips (Babylon's Burning comp.)