Skip to content
at0717 edited this page Nov 26, 2014 · 2 revisions

Welcome to the FFmpeg wiki!

FFmpegSharp is a fluent api encapsulation of ffmpeg with C#

var currentDir =
new FileInfo(Uri.UnescapeDataString(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath));

var appPath = currentDir.DirectoryName;

if (string.IsNullOrWhiteSpace(appPath))
    throw new ApplicationException("app path not found.");

var inputPath = Path.Combine(appPath, "test.mov");
var outputPath = Path.Combine(appPath, Guid.NewGuid().ToString());

//fluent api

Encoder.Create()
.WidthInput(inputPath)
.WithFilter(new X264Filter { Preset = X264Preset.Faster, ConstantQuantizer = 18 })
.WithFilter(new ResizeFilter(980, 550))
.To<Mp4>(outputPath)
.Execute();
Clone this wiki locally