我有 4 个过滤器视频输入过滤器从 获得枚举名称 ,智能三通,采样采集器和空渲染器,当我开始使用更高分辨率时,我首先创建所有过滤器并运行媒体控件。IAMStreamConfig:: GetStreamCaps
- 查看所有可用模式ISampleGrabber::SetCallback
, 与 ISampleGrabberCB::SampleCB
选项,我可以调用getCurrentBuffer()
获取帧,
when I want to change the format, I do all the steps but on request for the frame using the callback method I don't get any frames()
What are the usual steps for changing the format dynamically, I did try the same by stopping the media control, changing the format using SetFormat()
再次运行,仍然没有运气
最佳答案
要更改格式,您需要的最少步骤是停止图表,断开所有引脚,更改视频捕获过滤器的格式(使用 IAMStreamConfig::SetFormat
或使用明确定义的媒体类型将其连接到下游),然后重新连接下游的所有其他引脚。
也就是说,步骤顺序与只是删除所有内容并从头开始重建整个管道并没有太大区别。
有一些动态格式更改支持可以在 DirectShow 中随时更改分辨率,但它不完整,特别是在您的情况下不可用。
关于c++ - 在 Directshow 中将格式从更高分辨率更改为更低分辨率的问题,动态格式更改不会发生,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64218518/