DirectShow capture video and playback synchronisation problems
I am new to DirectShow and am developing an application to capture video using a video capture device. I am using DirectShow to control the device to capture avi files. I can successfully capture avi, but when i play back the avi file i find that the play back time is longer than the time i captured for. For example, if i capture video from a monitor which is playing a clock and i record for 20 seconds, the avi file is of duration 24 seconds. During playback, the clock correctly ticks 20 times but the playback takes 24 seconds. In effect, time has slowed down!!!
I have tried this both in GraphEdit and programattically with the same results.
I am using an Epiphan DVI2USB Solo device for the capture and an ffdshow vide encoder.
The graphEdit graph is:
DVI2USB Solo ---> ffdshow video encoder ---> AVI MUX ---> *.avi
On the AVI MUX I have to clear the Compatibility Index, otherwise only one image is captured the device and displayed during playback.
From a code point of view I am enumerating the capture devices and the codec and selecting the one i want. I construct an ICaptureGraphBuilder2 to construct the graph and attach it to a FilterGraph. After calling SetOuputFilename and RenderStream on the ICaptureGraphBuilder object i use IMediaControl from the FilterGraph to run and stop the graph.
Has anybody encountered this problem before? Are there any settings i need to configure? Any help/suggestions would be much appreciated. I have searched Google, MDSN and other forums without finding anyhthing that would help.