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

From AVObjects Knowledge Base
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);

Personal tools