Log in

View Full Version : basic muxing question


maxhondur
10th July 2006, 03:38
Hi,

Suppose I have a bitmap that I want to mux an uncompressed wav with (because in truth, I have hundreds of these). In avisynth, how can I make a script that creates a still-image video clip that is as long, lengthwise, as the actual wav file? The trick that I keep getting stuck on, is that virtualdub will cut out any audio past the end of my image video's specified length.. I don't know how to specify the 'length' of the wav in avisynth, if there is such a thing. Any response would help, and thanks!

foxyshadis
10th July 2006, 03:58
Try this:

z=WavSource("a.wav")
fps=23.976
Blankclip(length=int(z.AudiolengthF*fps/z.Audiorate),fps=fps).AudioDub(z)

Blankclip can be imagesource(end=...,fps=fps) or whatever.

maxhondur
11th July 2006, 03:23
foxyshadis,
I don't know how that worked, but it worked. I can't believe I wasted two nights digging through avisynth help/forums and didn't find this :) Thanks for the help.

foxyshadis
11th July 2006, 03:55
I found the relevant properties from the clip (http://www.avisynth.org/mediawiki/wiki/Clip_properties) and blankclip (http://www.avisynth.org/mediawiki/wiki/BlankClip) docs (the offline versions though), then performed some algebra:
seconds = (samples) / (samples/second)
frames = seconds * fps

I didn't even know if the audiolength properties existed though, I just hoped! ;D