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:

IVFVideoEffectLightness 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 VFVideoEffectLightness(true, 100);
    MediaPlayer1.Video_Effects_Add(lightness); 
}

Or we need to apply new value to effect.

else
{
   lightness = effect as IVFVideoEffectLightness;
   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
logo
VisioForge © 2006 - 2021