This tutorial shows how to apply a video filter to a media file and perform playback with the
PlayCtrl in a WinForms C# application using the LEADTOOLS Multimedia SDK.
The LEADTOOLS Multimedia Play Control contains many advanced features that simplify decoding, processing and playing back media from different sources such as files, memory buffers and network streams. The toolkit is shipped with various demos that make use of these features, such as the main Multimedia Player demo that has different editions in multiple programming languages.
|Summary||This tutorial covers how to apply a video filter in a WinForms C# application.|
|Completion Time||15 minutes|
|Visual Studio Project||Download tutorial project (10 KB)|
|Platform||Windows WinForms C# Application|
|IDE||Visual Studio 2017, 2019|
|Development License||Download LEADTOOLS|
Get familiar with the basic steps of creating a project and working with the
PlayCtrl class by reviewing the Add References and Set a License and Playback a Video File tutorials before working on the Apply a Filter to a Video File - WinForms C# tutorial.
Start with a copy of the project created in the Playback a Video File tutorial. If you do not have that project, follow the steps in that tutorial to create it.
This tutorial requires adding a reference to the COM DLL, which is located at
Different SDK features require different references. For a complete list, refer to Multimedia Files You Must Include With Your Application. In addition to this, the COM DLLs need to be registered on the deployment machine before they can be used.
The License unlocks the features needed for the project. It must be set before any toolkit function is called. For details, including tutorials for different platforms, refer to Setting a Runtime License.
There are two types of runtime licenses:
With the project created, the references added, and the license set, coding can begin. For the purposes of this tutorial, the
Video Stabilizer filter will be used alongside the
Test_VideoStabilizer.avi video. This video can be found here:
In Solution Explorer, double-click on
Form1.cs to open the designer. Select
File and double-click
Open to display the code-behind the form. Add the below code to the
OpenFileDialog dlg = new OpenFileDialog();
dlg.InitialDirectory = @"C:\LEADTOOLS22\Resources\Media";
if (dlg.ShowDialog(this) == DialogResult.OK)
string inputFile = dlg.FileName;
var stabilizer = _play.VideoProcessors.FirstOrDefault(p => p.FriendlyName == "LEAD Video Stabilizer Filter");
if (stabilizer != null)
_play.SourceFile = inputFile;
Run the project by pressing F5, or by selecting Debug -> Start Debugging.
If the steps were followed correctly, the application runs and applies the Video Stabilizer filter on playback of a media file using the
Open dialog box.
This tutorial showed how to apply a filter to a video file using the