0

I was using a callback mechanism to grab the webcam frames in my media application. It worked, but was slow due to certain additional buffer functions that were performed within the callback itself.

Now I am trying the other way to get frames. That is, call a method and grab the frame (instead of callback). I used a sample in CodeProject which makes use of IVMRWindowlessControl9::GetCurrentImage.

I encountered the following issues.

  1. In a Microsoft webcam, the Preview didn't render (only black screen) on Windows 7. But the same camera rendered Preview on XP.

Here my doubt is, will the VMR specific functionalities be dependent on camera drivers on different platforms? Otherwise, how could this difference happen?

  1. Wherever the sample application worked, I observed that the biBitCount member of the resulting BITMAPINFOHEADER structure is 32.

Is this a value set by application or a driver setting for VMR operations? How is this configured? Finally, which is the best method to grab the webcam frames? A callback approach? Or a Direct approach?

Thanks in advance,

4

1 に答える 1

2

IVMRWindowlessControl9::GetCurrentImage通常の画像取得ではなく、不定期のスナップショットを対象としています。

MSDNからの引用:

このメソッドは、実行中、停止中、一時停止中など、フィルターの状態に関係なく、いつでも呼び出すことができます。ただし、このメソッドを頻繁に呼び出すと、ビデオの再生パフォーマンスが低下します。

このメソッドは、そもそも遅いビデオメモリから読み戻します。この形式は非ストリーミングアプリに最適であり、互換性の問題が少ないため、この方法はRGB色空間への変換(つまり、再び低速)を行います。

全体として、定期的な画像の取得に使用できますが、これは本来の目的ではありません。ストリーミングレートでキャプチャするには、パイプラインでフィルターを使用するか、コールバック付きのサンプルグラバーを使用する必要があります。

于 2012-05-17T07:14:46.513 に答える