.NET Standard wrapper for FFmpeg. It's allow to process media without know how FFmpeg works, and can be used to pass customized arguments to FFmpeg from dotnet core application.
You have to have installed FFmpeg and added it to your PATH variable OR specify directory where FFmpeg and ffprob are before run conversion in variable FFbase.FFmpegDir OR have FFmpeg and FFprobe in directory with you executable.
Default the library is trying to find FFmpeg executables names contains "ffprobe", "ffmpeg". This function is case insensitive. Those names can be changed in FFbase.FFmpegExecutableName and FFbase.FFprobeExecutableName.
Install the Xabe.FFmpeg NuGet package via nuget:
PM> Install-Package Xabe.FFmpeg
Creating media info:
IMediaInfo mediaInfo = new MediaInfo("videofile.mkv");
Media info contains information about video like: duration, audio format, video format, radio, frame rate, height, width, size in Properties property.
It is possible to have more elastic way to convert media. Conversion class is builder for FFmpeg command. You can specify all implemented FFmpeg options and run process:
string output = Path.ChangeExtension(Path.GetTempFileName(), ".mp4");
bool result = await ConversionHelper.ToMp4("videofile.mkv", output)
.Start();
or
string outputPath = Path.ChangeExtension(Path.GetTempFileName(), Extensions.Mp4);
bool conversionResult = await new Conversion()
.SetInput("videofile.mkv")
.Rotate(rotateDegrees)
.SetOutput(outputPath)
.Start();
it is possible to give your own arguments
bool conversionResult = await new Conversion().Start("-i \"C:\Xabe.FFmpeg.Test\bin\Debug\netcoreapp2.0\Resources\SampleVideo_360x240_1mb.mkv\" \"C:\Users\tzmuda\AppData\Local\Temp\tmp9B8A.mp4\"");
Xabe.FFmpeg is licensed under MIT - see License for details.
Feel free to ask any questions on Gitter or write e-mail to [email protected]