简体   繁体   English

如何知道相机预览成功或准备好使用 Directshow 进行快照

[英]How to know camera preview successful or ready to snapshot using Directshow

I develop an application using .Net Directshow.我使用 .Net Directshow 开发了一个应用程序。 Is there any way to get notify message when camera preview successful or ready to snapshot当相机预览成功或准备好快照时,有什么方法可以收到通知消息

For a live video source there might be no immediately available preview frame (by design).对于实时视频源,可能没有立即可用的预览帧(按设计)。 At some times you might be able to detect that a frame is being streamed through the pipeline and will eventually reach the renderer and you also don't specify the snapshot method.有时您可能能够检测到帧正在通过管道流式传输并最终到达渲染器,并且您也没有指定快照方法。 There is no specific event and in general you are supposed to poll if you are waiting for preview frame to arrive.没有特定事件,一般来说,如果您正在等待预览帧到达,您应该进行轮询。

If you happen to have a filter in the pipeline, which streams video frames through (which can be basically any custom filter, such as, for example, processing filter as simple as transform-in-place or even sample grabber with a callback) then you might be able to use it as a replacement for event in question: when video frame passes such filter, video renderer is expected to be able to deliver a snapshot soon afterwards.如果您碰巧在管道中有一个过滤器,它可以通过流式传输视频帧(基本上可以是任何自定义过滤器,例如,处理过滤器,就像就地变换一样简单,甚至是带有回调的样本采集器),那么您也许可以将其用作相关事件的替代品:当视频帧通过此类过滤器时,预计视频渲染器很快就能提供快照。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM