How to add video effect and set effect parameters?

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 not exists, we'll add it.

if (effect == null) 
    lightness = new VideoEffectLightness(true, 100);

Or we need to apply new value to effect.

   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.

Please contact support to get help with this tutorial. Visit our GitHub page to get more code samples.
abstract 2abstract 1abstract 3
VisioForge © 2006 - 2022