Skip to content

Instantly share code, notes, and snippets.

@Microncode
Created February 25, 2020 05:17
Show Gist options
  • Save Microncode/8b48bf2f8a4dbd340c9974b0c5e72067 to your computer and use it in GitHub Desktop.
Save Microncode/8b48bf2f8a4dbd340c9974b0c5e72067 to your computer and use it in GitHub Desktop.
Here is a snap example of using the CSFFmpeg using C#:
//Create a new instance of the library with the direction of the ffmpeg libraries
_CSFFmpeg = new CSFFmpeg.CSFFmpeg(@"../../../libs/ffmpeg/x86/bin", "UserName", "RegKey");
//Set the arguments
_CSFFmpeg.ArgsDirect = txtArguments.Text;
//Events
//On ffmpeg output event
_CSFFmpeg.OperationOutput += (o, s) =>
{
//Display in the results in the text box
};
//On start event
_CSFFmpeg.OperationStart += (o) =>
{
lblStatus.Text = "Start";
};
//On progress event
_CSFFmpeg.OperationProgress += (o, s) =>
{
progressBar1.Value = s;
};
//Done
_CSFFmpeg.OperationDone += (o) =>
{
this.Invoke(new Action(() =>
{
lblStatus.Text = "Done";
}));
};
//Run the ffmpeg from the program
_CSFFmpeg.Run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment