Skip to main content

How to add video effects?

Products: Video Capture SDK .Net, Video Edit SDK .Net, Media Player SDK .Net

Sample code

C# sample code for lightness effect in Media Player SDK .Net.

The same API is available for Video Edit SDK .Net and Video Capture SDK .Net.

Define effect interface:

IVideoEffectLightness lightness;

Get interface instance from SDK control. If the effect is not added before, you'll receive a null value. Each effect must have a unique name.

var effect = MediaPlayer1.Video_Effects_Get("Lightness");

If the effect does not exist, we'll add it.

if (effect == null) 
{
lightness = new VideoEffectLightness(true, 100);
MediaPlayer1.Video_Effects_Add(lightness);
}

Or, we need to apply a new value to effect.

else
{
lightness = effect as IVideoEffectLightness;
if (lightness != null)
{
lightness.Value = 100;
}
}

You must set the Video_Effects_Enable property to true before the Play() or Start() method call to use video effects.

Required redists

  • SDK redist

Visit our GitHub page to get more code samples.