Log in

View Full Version : How to get WavSource or DirectShowsource framecount


honzakov
10th January 2005, 09:51
Hello, i want convert some wav and mp3 files to mpeg2 video program stream with QuEnc, so i created simple avs script to frameserve a/v stream to QuEnc:

au = MPASource("2-01-Prenasledovanie skirtov.mp3")
vi = BlankClip(width=352,height=288,fps=25,length=1000000)
av = AudioDub(vi, au)
av = Subtitle(av,"2-01-Prenasledovanie skirtov",40,144)
av = Trim(av, 0, au.FrameCount())
av
ResampleAudio(48000)
converttoyv12()

But if i want use DirectShowSource for ac3,mp3 or wav audio (or WavSource for wav), then au.framecount is 0 in all cases :-( So i can't trim av to audio length..

If i use something like this:

au = DirectShowSource("2-01-Prenasledovanie skirtov.mp3",25,true,true,false)
vi = BlankClip(width=352,height=288,fps=25)
av = AudioDub(vi, au)
av = Subtitle(av,"2-01-Prenasledovanie skirtov",40,144)
av
ResampleAudio(48000)
converttoyv12()

..then avs have good length in MediaPlayerClassic, but QuEnc encode only 9 second (720 frames?)..

Please, how i can slove this problem, i want add batch script for audio to mpg in to foobar2000 convert menu and there is only possible way use wav files as input..

Thanks for reply.

stickboy
10th January 2005, 10:33
Wow. Lots of esoteric questions repeatedly asked recently.

"Frame count" doesn't make sense on an audio clip. What is a frame? What is the frame-rate?

See this thread:
WavSource and framecount bug? (http://forum.doom9.org/showthread.php?s=&threadid=87675)

honzakov
10th January 2005, 11:10
Originally posted by stickboy
Wow. Lots of esoteric questions repeatedly asked recently.

"Frame count" doesn't make sense on an audio clip. What is a frame? What is the frame-rate?

Thanks for reply.

Ok, sorry for mistake...

My problem is how to set proper A/V clip length if audio is taken from DirecShowSource and video from blank clip.. Thanks for link, i try use AudioLength..

honzakov
10th January 2005, 11:30
Many thanks stickboy for link above, there is solution for my problem:

au = DirectShowSource("F:\avs\Oxygene 7.mp3",25,true,true,false)
vi = BlankClip(width=352,height=288,fps=25,length=1000000)
av = AudioDub(vi, au)
t = 25*(au.AudioLengthF/au.AudioRate)
av = Trim(av, 0, int(t))
av
ResampleAudio(48000)
converttoyv12()

it's works great with directshowsource..

thanks for help