Log in

View Full Version : audio sync re fps change


Ac3Dc3
18th July 2005, 09:47
Hi-

Im trying to convert a xvid .avi to mpeg-2 for dvd.
Gspot gives me this for the .avi:

Vid Codec: Xvid
Runtime: 00:43:33 (78,315 fr)
Resolution: 640x480 (1.33:1) [=4:3]
Bitrate: 1048 kb/s
FPS: 29.970
Audio: Mono, 64kbps, MP3, 49KHz
Stream Type: OpenDML AVI
I/L: 1 vid frame (33 ms) NG=120 Split: Yes

I save the mp3 to wav via VDubMod. And process the video with script:

LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\decomb.dll")
avisource("C:\myAvi.avi", false)
Telecide(order=1,guide=1).Decimate()
LanczosResize(720,576)
AssumeFPS(25, 1, false)
And when this is played in any player, the runtime is 41:46.
I encode the audio wave file to .mp2 using besweet with this command:
"C:\besweet\BeSweet.exe" -core( -input "C:\Documents and Settings\Administrator\Desktop\audioO.wav" -output "C:\Documents and Settings\Administrator\Desktop\audioO - New.mp2" -logfilea "C:\besweet\BeSweet.log" ) -ota( -r 23976 25000 ) -toolame( -m s -b 192 -e )
and the resulting .mp2 file is 41:45 long. Obviously when i mux the streams (after putting the avs file through cce) the audio is out of sync. Does anyone know why?

thanks,

ac3dc3.

Matthew
20th July 2005, 00:54
"FPS: 29.970"

"-ota( -r 23976 25000 )"

Your avi is 29.97 but your audio conversion is for 23.976.

29.97->25 is too much of a slow-down so you need to reduce the number of video frames, e.g. 29.97->23.976 using IVTC. But I know nothing of such operations.

edit
----
Just read the post properly, and seems you are performing a decimate to 23.976.

I've done plenty of 23.976->25 fps changes using besweet and never had sync issues. Make sure there is no initial audio delay. You can determine this using avimux gui or by counting the number of junk bytes (usually 0s) at the start of the mp3 and computing ROUNDUP(junkbytes/1152)*(1152/48).

"Audio: Mono, 64kbps, MP3, 49KHz". 49 khz is a non-standard samplerate, that could also be a problem. ssrc can be used to resample to 48 khz.

Ac3Dc3
20th July 2005, 09:55
thanks for the reply Matthew
i was pretty sure it was because of some kind of audio delay, but i thought that gspot gave you that information when its available - i guess it doesnt. AVI-Mux is a neat tool, i should have seen it before but i dont really do anything with the .avi container anymore! anyway it turns out the audio had a massive 0.7s delay and that was why the runtime was so much shorter. the 49khz was a typo sorry :rolleyes:

cheers

Matthew
21st July 2005, 00:32
Unfortunately GSpot never gives the audio delay...and as a general rule conversion programs, etc seem to assume that no audio delay exists.

To get the corrected delay, remember to multiply the original delay by 23.976/25. It doesn't usually matter but I learnt my lesson on an avi with a ~42 sec delay :-)