SJM
23rd September 2010, 22:55
I am using AVISynth with Direct Show to play deinterlaced AVI and to step backward and forward by fields. I have a sample grabber that overlays a bitmap on each video field. The problem is that IMediaSeeking.GetCurrentPosition returns the wrong video position when I overlay the bitmap. When I step forward or backward, the video jumps ahead. I am using the following code to step forward:
mediaSeek.GetCurrentPosition(out currentPos);
long nextFrame = new DsLong(currentPos + FIELDRATE);
mediaSeek.SetPositions(nextFrame,AMSeekingSeekingFlags.AbsolutePositioning,null,
IMSeekingSeekingFlags.NoPositioning);
This is only a problem when I use AVIsynth to deinterlace the video and overlay the bitmap. The problem does not occur if don't deinterlace (separateFields in the AVI script) or if I don't overlay the bitmap. If I stop the video with the separateFields flag and overlaying a bitmap in the sample grabber, the current position returned by GetCurrentPosition is greater than the actual video position displayed on the screen.
I appreciate any help you can give me. I posted a similar problem a couple of months ago and no one replied.
I'm not sure if I should post this here or under development.
mediaSeek.GetCurrentPosition(out currentPos);
long nextFrame = new DsLong(currentPos + FIELDRATE);
mediaSeek.SetPositions(nextFrame,AMSeekingSeekingFlags.AbsolutePositioning,null,
IMSeekingSeekingFlags.NoPositioning);
This is only a problem when I use AVIsynth to deinterlace the video and overlay the bitmap. The problem does not occur if don't deinterlace (separateFields in the AVI script) or if I don't overlay the bitmap. If I stop the video with the separateFields flag and overlaying a bitmap in the sample grabber, the current position returned by GetCurrentPosition is greater than the actual video position displayed on the screen.
I appreciate any help you can give me. I posted a similar problem a couple of months ago and no one replied.
I'm not sure if I should post this here or under development.