locked
How to use MediaCapture.SetEncoderProperty API

    Question

  • Hi All:

    I am following the SimpleCommunication provided here to develop a VOIP app (http://code.msdn.microsoft.com/windowsapps/Simple-Communication-Sample-eac73290)

    I need to use API  MediaCapture.GetEncoderProperty(MediaStreamType mediaStreamType, Guid propertyId) and SetEncoderProperty( MediaStreamType mediaStreamType, Guid propertyId, Object^ propertyValue) to access the encoder property like bit rate, but I found that I got exception every time I tried to call it.

    If I call GetEncoderProperty with mediaStreamType set to Audio or VideoRecord the Win RT exception would say "not implemented" and if I tried VideoPreview it would be "the requested attribute was not found", and on calling SetEncoderProperty I would get "not implemented" or memory access violation

    The GUID I tried was from the codec object doc of Windows from here

    http://msdn.microsoft.com/en-us/library/windows/desktop/ff819077(v=vs.85).aspx

    None of them works so I guess the issue must be the way I was using the API, I simply called it in the main thread of my app (actually it is in a button I added to SimpleCommunication app) and nothing special.

    Could any one kindly share some info?


    Shanling

    Thursday, February 28, 2013 4:09 PM

All replies

  • Hello,

    You can take a look at the following forum link that should help you: http://social.msdn.microsoft.com/Forums/en-ZW/winappswithnativecode/thread/2b1f897f-c682-4358-9351-58d6f1848a21

    Thanks,
    Prashant.

    Saturday, March 2, 2013 12:00 AM
    Moderator
  • Hi, Prashant

    I did follow that link and used the GUID in the codec object doc of Windows mentioned in that thread, but the problem is that every time I tried to call setEncoderProperty or getEncoderProperty I got com exception and crash, the code I was using was like:

    //before this video recording was already started

    //...

    auto captureMedia = _captureMedia.Get();

    captureMedia->SetEncoderProperty(Windows::Media::Capture::MediaStreamType::VideoRecord, MF_MT_AVG_BITRATE, 256000); // got exception here



    Shanling

    Monday, March 4, 2013 2:39 PM