使用 WMASFWriter 生成在每个关键帧间隔暂停的视频
我正在尝试基于 DirectShow SDK 中的推送源示例创建 DirectShow 源过滤器。我的源过滤器本质上是向视频输出一组位图,每个位图通常持续约 600 毫秒。我已经设置了一个过滤器图,它使用 Async_reader 和 Wave Parser 来处理音频,并使用新的过滤器来推送视频(过滤器是 CSourceStream,我在 FillBuffer 函数中填充帧)。它们都连接到 WMASFWriter 以输出 WMV。
我发现,有时对应于关键帧间隔,视频会暂停一两秒。这在高清分辨率下似乎更糟,我认为这可能是一个转移注意力的事情。哪些因素可能导致这种情况?这与我允许调用 FillBuffer 的频率有关吗(我的帧速率是 30fps,所以我最终会在几个帧中重复相同的位图)?
I am attempting to create a DirectShow source filter based on the pushsource example from the DirectShow SDK. My source filter essentially outputs a set of bitmaps, each of which typically lasts around 600 milliseconds, to a video. I have set up a filter graph which uses Async_reader with a Wave Parser for audio and my new filter to push the video (the filter is a CSourceStream and I populate my frames in the FillBuffer function). These are both connected to a WMASFWriter to output a WMV.
What I am finding is that at times corresponding the keyframe interval the video pauses for a second or two. This seems to be worse at HD resolutions, thought that could be a red herring. What kinds of things might be causing this? Is it related to how often I allow FillBuffer to be called (my frame rate is 30fps, so I end up with the same bitmap being repeated for several frames)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
常识(与所讨论的效果的具体经验相反)表明关键帧的编码消耗了太多带宽,而剩余的带宽不足以对紧随关键帧的片段的运动进行编码。我认为这是 CBR 模式,也许 VBR 模式可以提供更好的编码。
A common sense (as opposed to specific experience with effect in question) suggests that encoding of a key frame consumes too much of bandwidth, and the remainder is insufficient to encode movement of the segment which immediately follows the key frame. I assume this is CBR mode, and perhaps VBR mode could give a better encoding.