Eddilefey
November 4th, 2004, 12:17 PM
Hi there,
I'm currently coding an application that requires the retrieval of (non-sequencial) indivual frames from avi and mpeg encoded video. My code uses the 'Implement the Frame-Grabbing Function' example from the DShow documentation to grab a bitmap from the video stream using the iMediaDet interface.
As far as I know, the iMediaDet interface cannot grab on a frame basis, so I use the time of the frame instead (time=(desired frame+0.5/framerate)).
(The 0.5 is to avoid trying to grab a frame at the boundary between frame changeover)
To all casual appearances, this works fine.. however, I've found that it returns slightly different frames when grabbing frames from the exact same source (mpeg) files on different media.
This even occurs when I'm trying to grab exactly the same frame, at exactly the same timecode, on an exact copy of the video.. but one copy of the video is located on my hard drive and the other on CD.
The difference is only small (usually only 1 frame), but causes serious problems for my work, which requires consistent frame accuracy. It appears as though some form of approximation is occurring when the frame is being grabbed from the slower CD Rom version of the file.
Has anybody seen this problem before?
Is there a solution?
Any help would be greatly appreciated..
I'm currently coding an application that requires the retrieval of (non-sequencial) indivual frames from avi and mpeg encoded video. My code uses the 'Implement the Frame-Grabbing Function' example from the DShow documentation to grab a bitmap from the video stream using the iMediaDet interface.
As far as I know, the iMediaDet interface cannot grab on a frame basis, so I use the time of the frame instead (time=(desired frame+0.5/framerate)).
(The 0.5 is to avoid trying to grab a frame at the boundary between frame changeover)
To all casual appearances, this works fine.. however, I've found that it returns slightly different frames when grabbing frames from the exact same source (mpeg) files on different media.
This even occurs when I'm trying to grab exactly the same frame, at exactly the same timecode, on an exact copy of the video.. but one copy of the video is located on my hard drive and the other on CD.
The difference is only small (usually only 1 frame), but causes serious problems for my work, which requires consistent frame accuracy. It appears as though some form of approximation is occurring when the frame is being grabbed from the slower CD Rom version of the file.
Has anybody seen this problem before?
Is there a solution?
Any help would be greatly appreciated..