How to apply effects to captured video (HTML)
Use the MediaCapture.AddEffectAsync method to apply effects to captured video.
Effects can be a built-in effect, such as the VideoStabilization effect which is supported on Windows or the SlowMotionEffectDefinition which is supported on Windows Phone, or custom effects which are Media Foundation Transforms (MFTs). For information about how to create and use MFTs, see Media Foundation Transforms and the Media Extension Sample.
Objective: This tutorial describes how to apply effects to captured video.
To add an effect to captured video, call the AddEffectAsync method. This method takes the following parameters:
- MediaStreamType - One of the values of the MediaStreamType enumeration that specifies whether the stream is for video recording, video preview, audio, or photo.
- effectActivationID - The class identifier of the activatable runtime class that implements the effect. This parameter is added to the chain of effects that get added to the source stream coming out of the device source. The runtime class must implement the IMediaExtension interface.
- effectSettings - An IPropertySet that contains additional configuration parameters for the effect. If no additional configuration is needed for the effect, then this parameter should be null.
The application can call this method multiple times to add several effects.
// captureMgr is a MediaCapture object defined elsewhere capturMgr.addEffectAsync( Windows.Media.Capture.MediaStreamType.videoRecord, "Windows.Media.VideoEffects.VideoStabilization", null);
Note This example uses the VideoStabilizationEffect, which is not supported for Windows Phone Store apps, but AddEffectAsync can be used to add other, supported effects.