How to add video effect and set effect parameters?

Code sample for lightness effect in Media Player SDK.

Same API available for Video Edit and Video Capture SDK.

Define effect interface:

IVFVideoEffectLightness lightness;

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

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

If effect not exists we'll add it.

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

Or we need to apply new value to effect.

   lightness = effect as IVFVideoEffectLightness;
   if (lightness != null)
      lightness.Value = 100;

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

VisioForge © 2006-2020

  • GitHub-Mark-64px
  • Twitter Социальные Иконка
  • VisioForge Facebook page
  • YouTube channel