0

在我的一个应用程序中,我需要知道给定视频文件的帧位置(帧号)和实际帧采样时间之间的映射。我在回调模式下使用 Directshow SampleGrabber 过滤器。我正在覆盖 ISampleGraberCB 类的 BufferCB 方法,每当调用回调时,我都会将到达的采样时间映射到地图中的帧位置。每当新样本从零开始到达时,帧位置就会增加。虽然我能够生成所需的地图,但在处理大型视频文件时,上述方法非常慢。有人可以就如何快速生成此地图或任何其他更好的方法提供任何建议。

提前致谢。

普拉迪普

4

1 回答 1

1

There are basically no such thing as "frame number" in DirectShow, only time stamps. The only thing to do the needed is to go through the entire file and record timestamps, as you already do.

However, the process might be way faster if you set the sample grabber to receive raw/undecoded fames. This way there is no need for decoder and the whole iteration through frames happens pretty quick. Don't forget to remove clock from the graph to request ASAP processing (as opposed to default real time pace).

于 2013-02-15T21:25:26.413 回答