What is the propertyId and propertyValue for Width,Height,FrameRate and BitRate RRS feed

  • Question

  • Hi,

    I am using MediaCapture class to capture video from webcam. I am trying to set encoder properties such as Width,Height,FrameRate and BitRate which are properties of VideoEncodingProperties class.

    I am trying to use below function.

    void SetEncoderProperty(
      MediaStreamType mediaStreamType,
      Guid propertyId,
      Object^ propertyValue

    Could anybody let me know what shoud be given for propertyId & propertyValue to set Width,Height,FrameRate and BitRate ?

    Thanks in advance.


    Wednesday, December 5, 2012 1:39 PM


All replies

  • Wednesday, December 5, 2012 5:36 PM
  • The propertyID and value will depend on the codec you are using. You can find documentation on the standard codecs at Codec Objects .


    Thursday, December 6, 2012 2:15 AM
  • Thanks a lot for the answer.

    I tried below as below. When I call GetMediaStreamProperties,newly set value by SetEncoderProperty was not reflected!

    Please let me know about this...

     double framerate = 15.00;

         m_mediaCaptureMgr->SetEncoderProperty(Windows::Media::Capture::MediaStreamType::VideoRecord,MF_MT_FRAME_RATE,framerate );
     catch(Exception^ e)
         throw e;

      Windows::Media::MediaProperties::IMediaEncodingProperties ^props = m_mediaCaptureMgr->VideoDeviceController->GetMediaStreamProperties  (Windows::Media::Capture::MediaStreamType::VideoRecord);
                                 Windows::Media::MediaProperties::VideoEncodingProperties ^videoEncodingProperties  = static_cast<Windows::Media::MediaProperties::VideoEncodingProperties ^>(props);
     int num = videoEncodingProperties->FrameRate->Numerator; // num is still 30 (default value)
     int den = videoEncodingProperties->FrameRate->Denominator;



    Thursday, December 6, 2012 7:06 AM
  • MF_MT_FRAME_RATE is an attribute, not a property. It cannot be set with SetEncoderProperty, but would be set with MFSetAttributeRatio if you were using MF directly. You cannot set it that way through the MediaEncoder object.

    The way you would set the frame rate would be through the VideoEncodingProperties set on the MediaEncodingProfile.

    Also, the value you are setting isn't valid: the MF_MT_FRAME_RATE is a UINT expressed as a ratio with the upper 32 bits of the attribute value containing the numerator and the lower 32 bits containing the denominator.


    Thursday, December 6, 2012 8:34 PM
  • Thanks.

    I am still not able to find out property id and property value which I can use it to set framerate using SetEncoderProperty function from your reply..


    Saturday, December 8, 2012 1:36 PM
  • The specific properties available depend on the specific codec. You will need to identify the codec you are using and then check the documentation for that codec to see what is available.

    I don't believe any of the built in codecs can have their frame rates set through the MediaElement. You can query the frame rate or set the bitrate from the VideoEncodingProperties.


    Monday, December 10, 2012 10:27 PM