Sets an encoding property.
Syntax
mediaCapture.setEncoderProperty(mediaStreamType, propertyId, propertyValue);
Parameters
- mediaStreamType
-
Type: MediaStreamType
Sets an encoding property. The method sets the property on the encoder that is used for that stream.
- propertyId
-
Type: String [JavaScript] | System.Guid [.NET] | Platform::Guid [C++]
The encoding property to set.
- propertyValue
-
Type: Object [JavaScript] | System.Object [.NET] | Platform::Object [C++]
The new value of the encoding property.
Remarks
You can only call SetEncoderProperty with mediaStreamType equal to MediaStreamType.Audio, if the encoder property is applied to only the audio encoder in the record sink. The preview sink does not allow you to set an encoding profile with compressed audio.
For non-H.264 cameras, when you call SetEncoderProperty before recording or previewing has started, the property is stored locally. When you start recording, the property is applied to the encoder at the time of encoder initialization. To configure static encoding properties, you must call SetEncoderProperty before recording or previewing starts. Before recording or previewing starts, GetEncoderProperty will return the value of the property stored locally.
If the camera is a H.264 camera and the stream that SetEncoderProperty is called on is of type MediaStreamType.VideoRecord, then the property is applied directly to the camera. This is true both before and after recording has started.
For non-H.264 cameras, when you call SetEncoderProperty after you get the record or preview started completion callback, the property is set directly on the encoder and is therefore used to configure dynamic encoding properties.
If you call SetEncoderProperty after you issue a call to start recording or previewing and before you get the record or preview started completion callback, you will receive an MF_E_INVALIDREQUEST error since the property cannot be applied to static nor dynamic settings.
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
|
Capabilities |
|
See also
Build date: 12/4/2012