How to capture the frame of the input stream of Vision Mixer?

From AVObjects Knowledge Base
Revision as of 16:24, 26 January 2010 by Bmezhebitskiy (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

You can do this with CaptureVideoFrame method. Here is a sample code:

string strVidDevice; string strAudDevice; Object pObjectUnk;

//Let's capture the frame of the 0 stream //Get the source device of 0 stream IMGMixerConfig mixerConfig = m_objVideoMixer; mixerConfig.GetInputDevice(0, out strVidDevice, out strAudDevice, out pObjectUnk); MGVIDEOMIXERLib.IMGObject pObject = (MGVIDEOMIXERLib.IMGObject)pObjectUnk;

//Capture the frame int hBitmap; pObject.CaptureVideoFrame(out hBitmap, MGVIDEOMIXERLib.eMGCaptureFields.eMGCF_Both); Bitmap bmpCapture = Bitmap.FromHbitmap((IntPtr)hBitmap);