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

From AVObjects Knowledge Base
(Difference between revisions)
Jump to: navigation, search
(New page: 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 sou...)
 
 
Line 2: Line 2:
  
 
string strVidDevice;
 
string strVidDevice;
 +
 
string strAudDevice;
 
string strAudDevice;
 +
 
Object pObjectUnk;
 
Object pObjectUnk;
 +
  
 
//Let's capture the frame of the 0 stream
 
//Let's capture the frame of the 0 stream
 +
 
//Get the source device of 0 stream
 
//Get the source device of 0 stream
 +
 
IMGMixerConfig mixerConfig = m_objVideoMixer;
 
IMGMixerConfig mixerConfig = m_objVideoMixer;
 +
 
mixerConfig.GetInputDevice(0, out strVidDevice, out strAudDevice, out pObjectUnk);
 
mixerConfig.GetInputDevice(0, out strVidDevice, out strAudDevice, out pObjectUnk);
 +
 
MGVIDEOMIXERLib.IMGObject pObject = (MGVIDEOMIXERLib.IMGObject)pObjectUnk;
 
MGVIDEOMIXERLib.IMGObject pObject = (MGVIDEOMIXERLib.IMGObject)pObjectUnk;
 +
  
 
//Capture the frame
 
//Capture the frame
 +
 
int hBitmap;
 
int hBitmap;
 +
 
pObject.CaptureVideoFrame(out hBitmap, MGVIDEOMIXERLib.eMGCaptureFields.eMGCF_Both);
 
pObject.CaptureVideoFrame(out hBitmap, MGVIDEOMIXERLib.eMGCaptureFields.eMGCF_Both);
 +
 
Bitmap bmpCapture = Bitmap.FromHbitmap((IntPtr)hBitmap);
 
Bitmap bmpCapture = Bitmap.FromHbitmap((IntPtr)hBitmap);
 +
  
 
[[Category: Vision Mixer SDK FAQ]]
 
[[Category: Vision Mixer SDK FAQ]]

Latest revision as of 16:24, 26 January 2010

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);