View Full Version : Question about AssumeFPS
Chainmax
19th October 2006, 21:05
I am trying to create a script for DVDs out of the movie clips taken from a Canon PowerShot S3 IS. The video filtering part is mostly figured out, but I have a doubt about audio processing. Since the video is 30fps, I have to change it to 29.97 and adjust the audio acordingly. I found an old thread I made in which stickboy and IanB recommende me to use TimeStretch in this way:
AVISource("X:\wherever\aclip.avi",audio=true)
TimeStretch(tempo=(100.0*25.0)/24)
AssumeFPS(25, 1)
Thing is, VDub throws an error saying that I gave wrong parameters to AssumeFPS (parameters had been changed according to this source, of course). Deleting the "1" in that line seemed to work. I assume that was the "denominator" parameter, will there be an issue if it's not specified?
stickboy
19th October 2006, 21:12
Your question is really about AssumeFPS, isn't it?
Post your exact script. I bet you did something like:
AssumeFPS(someFloatingPointValue, 1)which doesn't make sense. Arguments must be either:
AssumeFPS(float fps)or
AssumeFPS(int numerator, int denominator)It doesn't really make sense to mix them.
Chainmax
22nd October 2006, 19:45
You're right, it is an AssumeFPS question :o. I'll change the title accordingly. You were right about me using floating point values, I was converting a 30p source to NTSC and was using this :
TimeStretch(tempo=(100.0*29.97)/30)
AssumeFPS(29.97,1)
SSRC(48000)
I should read the docs more carefully :o++. Thanks for the help :).
IanB
24th October 2006, 10:48
Seeing you are reclocking the audio already, better results will be obtained withAssumeFPS(30000, 1001, True) # Exact NTSC rate
SSRC(48000)TimeStretch by the nature of the algorithm used will cause slight audible artifacts. And if the input and output audio format are both 16bit, you might like to use ResampleAudio() in place of SSRC() which needs a conversion to float format. (It also only works when the conversion rate is rational, which in this case 1000/1001 is)
Chainmax
24th October 2006, 15:18
So the script should be
TimeStretch(tempo=(100.0*29.97)/30)
AssumeFPS(30000, 1001, True)
ResampleAudio(48000)
then? Also, you say "Seeing you are reclocking the audio already", does that mean that in your opinion there are ways to do this that yield in higher quality results? Maybe something that yields less artifacting than TimeStretch (which artifacts are those by the way)?
IanB
26th October 2006, 04:23
No the script should be as I specified itAssumeFPS(30000, 1001, True) # Exact NTSC rate
SSRC(48000)The "True" on the AssumeFPS call causes it to adjust the AudioRate by the same amount the Video FrameRate is adjusted, so you don't need to stretch it a twice.
The TimeStretch algorithm works by cutting the stream into short chunks and blending the edges of the chunks together where there is maximum correlation not necessarily where there is 100% correlation (though it might be so, if you are lucky). Anywhere the correlation is not 100% you get a small defect. Sine waves easily correlate to 100%, real live sound very rarly does, although > 95% is common.
Adjusting audio speed by very small amounts is preferable to stretching. Film to PAL quite happily increases the speed by 4% for some material this is to much so a time stretch may be better. But for a change of 1000/1001 adjusting the speed wins hands down.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.