Search code examples
c#videodirectshowvideo-capturedirectshow.net

How to know camera preview successful or ready to snapshot using Directshow


I develop an application using .Net Directshow. Is there any way to get notify message when camera preview successful or ready to snapshot


Solution

  • 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.