| Printable Version of Topic
Click here to view this topic in its original format |
| Unofficial VirtualDub Support Forums > Advanced Video Processing > Directshow - Avisynth Vs Vdub Import |
| Posted by: Landrew Oct 29 2010, 04:39 PM |
| I noticed something interesting the other day. When I load an h264 clip into vdub using avisynth with DirectShowSource, the video lags the audio, and what's more it is different each time I process the same clip. Sometimes 1 frame, sometimes 3 frames, etc. Testing yields variations between 1 and 4 frames lag. In contrast, with vdub's directshow import filter, I consistent results every time, with the audio within one frame of sync. As a programmer, just got me wondering what is going on under the hood. Something peculiar about how DirectShow works, that Avery did a nice job of overcoming perhaps? Cheers, Andrew |
| Posted by: phaeron Oct 30 2010, 09:54 PM |
| Probably just a difference in buffering algorithm. The DirectShow input plugin only does local buffering, whereas DirectShowSource does more. I believe it actually has two levels of buffering, a little bit locally and then the Avisynth frame cache. If the DirectShow filter doesn't do precise seeking and thus returns different frames for the same requested position, and extra action isn't taken to flush the frame cache when that happens, then you could get some really nasty effects. On the other hand, DSS can work when a filter is broken and produces frames out of order, which my plugin definitely doesn't help. |