DirectShow Record Problem - fps

北城余情 提交于 2019-11-28 11:45:56

Ralf's comment is probably right. The AVI file format doesn't have per-frame timestamps, just an average frame rate. So when a frame arrives, the mux has to decide whether to place this frame in the next "slot", or insert a "dropped frame" marker and put the frame in the slot after. If the source filter's timestamps don't match the media type's frame rate, then you will get this effect.

You can save your video elementary stream to a file, but use the Dump filter example, not the file writer. The file writer has a special protocol to allow multiplexors random access to the file (using the timestamps as file offsets). You want to just save the data as a stream, and the Dump example does that.

In my case I indeed had a Source filter that didn't set AvgTimePerFrame correctly. After I fixed that (it was my own source filter) the AVI also went along with whatever it received from upstream.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!