2

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

Roman R.
  • 68,205
  • 6
  • 94
  • 158
xiaox2y2
  • 65
  • 6

1 Answers1

1

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.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Can I insert some filter into filter graph manager to detect incoming video stream? – xiaox2y2 Sep 12 '16 at 00:38
  • Yes, I updated text above. However, there is still some polling involved: when you have an event from switch filter, snapshot is not yet available but it's typically to be available very soon after that. – Roman R. Sep 12 '16 at 05:22
  • @xiaox2y2 I am also looking for the same while I am facing [this](https://stackoverflow.com/questions/45963541/imediacontrol-run-is-successful-still-camera-preview-is-black) issue. Did you solve this,how do you achieved this I will like to know. – Amogh Aug 30 '17 at 15:15
  • @RomanR. I would like if you could help in [this](https://stackoverflow.com/questions/45963541/imediacontrol-run-is-successful-still-camera-preview-is-black) – Amogh Aug 30 '17 at 15:15