Log in

View Full Version : Why is audio out of synch only with Avisynth?


mel2000
11th March 2009, 17:22
I have an AVI file that plays back fine in VirtualDub when I directly open it as an AVI. However, when I open it as an AVS using AVISource or DirectShowSource, the audio plays out of synch by 180 ms (I found the exact delay by using Batchdemux to isolate the audio file, the delay was shown as part of the output file naming convention). When I set a 180 ms delay in my Avisynth script, the audio and video play in perfect synch. I'd like someone to explain the audio playback discrepancy between Avisynth vs direct playback. Thanks.

IanB
11th March 2009, 23:14
AviSource() assumes that both audio and video stream timing start from zero and are contiguous. This is the safest course of action when dealing with potentially flawed material. When there is a delay the user is expected to script explicitly to resolve the issue.

DirectShowSource() should do whatever your default DirectShow graph dictates, except that the Audio code assumes that the audio stream is contiguous i.e. any timing holes are ignored. The ConvertFPS=True option honours timing holes for the Video stream only.

canTsTop
19th August 2009, 09:57
Why then i use Avisyth DirectShowSource, on Trim or if video is with errors (TS recording with errors) audio/video synchronization is lost? But if i usu VirtualDub and Directshow Input Driver (http://forums.virtualdub.org/index.php?act=ST&f=7&t=15093&st=0) its frame accurate and synchronization is not lost even on damaged video.