gpt4 book ai didi

c++ - 使用 DirectShow 按请求读取帧

转载 作者:太空宇宙 更新时间:2023-11-04 11:51:05 26 4
gpt4 key购买 nike

我正在尝试使用 DirectShow 从网络摄像头捕捉视频。我假设使用 SampleGabber 类。现在我看到 DirectShow 只能以某些所需的 fps 连续读取帧。 DirectShow 可以按请求读取帧吗?

最佳答案

DirectShow 管道设置流式视频。如果您进行了设置,帧将连续流过 Sample Grabber 及其回调。如果您不强制更改格式(特别是强制视频为 RGB),则回调本身会增加最小的处理开销。这取决于是否处理或跳过那里的帧。

根据请求,抓取将采用流式传输的最后一个已知视频帧,或下一个通过 Sample Grabber 进行的抓取。这是典型的操作模式。

一些设备提供额外的功能,可以根据要求拍摄静止图像。这是一种罕见的情况,MSDN 上对其进行了描述:Capturing an Image From a Still Image Pin :

Some cameras can produce a still image separate from the capture stream, and often the still image is of higher quality than the images produced by the capture stream. The camera may have a button that acts as a hardware trigger, or it may support software triggering. A camera that supports still images will expose a still image pin, which is pin category PIN_CATEGORY_STILL.

The recommended way to get still images from the device is to use the Windows Image Acquisition (WIA) APIs. [...]

To trigger the still pin, use [...]

关于c++ - 使用 DirectShow 按请求读取帧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18207232/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com