Apply a Filter to a Video File in C#

Posted on 2022-02-28 Halah Villalobos

Sometimes I'll take what I think is a really great video on my cell phone, only to find out my hand was shaking while I was recording. Thankfully, I know the LEADTOOLS SDK provides many filters that can be used to add color, annotations, and remove the shaking or vibration present in a video.

In this demonstration, I will be working with the LEAD Video Stabilizer Filter to remove shaking present in the Test_VideoStabilizer.avi video.

Apply a Filter to Video File in C#

The following simplified C# code will apply the filter to the displayed video.


OpenFileDialog dlg = new OpenFileDialog();
dlg.InitialDirectory = @"D:\LEADTOOLS22\Resources\Media";
if (dlg.ShowDialog(this) == DialogResult.OK)
{
string inputFile = dlg.FileName;
Processor stabilizer = null;

foreach (Processor p in _play.VideoProcessors)
{
if (p.FriendlyName == "LEAD Video Stabilizer Filter")
{
stabilizer = p;
break;
}
}
_play.SelectedVideoProcessors.Add(stabilizer);
_play.SourceFile = inputFile;
_play.Run();
}

For more information on the LEADTOOLS Multimedia SDK, check out our full tutorial on the LEAD Video Stabilizer Filter.

Free Evaluation and Free Support!

Did you know you can download the LEADTOOLS SDK for free?. It’s a fully-functional evaluation license with free support to help you along the way.

Looking for More?

We have a ton of helpful tutorials (and add more every day) so be sure to check out our extensive tutorial library!

Our support team is here to help! Contact our support team for free technical support via live chat or email.

For pricing or licensing questions, contact our our sales team via email or call us at 704-332-5532.

LEADTOOLS Blog

LEADTOOLS Powered by Apryse,the Market Leading PDF SDK,All Rights Reserved