How to use StartRecordToCustomSinkAsync to capture video frames RRS feed

  • Question

  • Hi..

    I am using MediaCapture class to capture video frames from Webcam in my native C++ code

    I need to use StartRecordToCustomSinkAsync API to achieve this..

     IAsyncAction^ StartRecordToCustomSinkAsync(
      MediaEncodingProfile^ encodingProfile,
      IMediaExtension^ customMediaSink

    IAsyncAction^ StartRecordToCustomSinkAsync(
      MediaEncodingProfile^ encodingProfile,
      String^ customSinkActivationId,
      IPropertySet^ customSinkSettings

    I dont know how to use custom media sink to receive video frames..

    Can anybody give me simple sample peice of code which help me to understand how to use above API

    Thanks in advance

    Tuesday, October 9, 2012 1:30 PM

All replies

  • If you are trying to capture individual frames at real time then you will need to write a Media Foundation Transform (MFT) to do so. See the Media extensions sample for examples.


    Wednesday, October 10, 2012 8:05 PM
  • Hi..

    Thanks a lot for the reply.

    I am new to Windows 8 So I have some more questions on how to use above API.

    I am trying to capture video frames from webcam using WinRT apis. I am using StartRecordToCustomSinkAsync API to start the recording.

    Should I create class which is derived from IMFMediaSink and give reference of that object as second parameter to the above API?

    How the custom sink gets the data once it is created ? How do I get IMFSample ?

    Which API I should call to get the frame/IMFSample/buffer?

    Thursday, October 11, 2012 9:48 AM