Skip to content

Instantly share code, notes, and snippets.

@Casey-Bateman
Created July 28, 2014 16:04
Show Gist options
  • Save Casey-Bateman/b4bca5a5a968da41b40a to your computer and use it in GitHub Desktop.
Save Casey-Bateman/b4bca5a5a968da41b40a to your computer and use it in GitHub Desktop.
Final Alltogeter
//we are planning to use filter concatenation on three input videos
var filterchain = Filterchain.FilterTo<VideoStream>(new Concat());
//we want our output to be encoded using the following settings:
// -c:v libx264
// -b:v 3000k
// -s 852x480
// -y
var settings = SettingsCollection.ForOutput(
new CodecVideo("libx264"),
new BitRateVideo(3000),
new Size(852, 480),
new OverwriteOutput());
//we need to create an instance of a command factory.
var factory = CommandFactory.Create();
//staging all input video streams for concatenation, filtering, and mapping to output
factory.CreateOutputCommand()
.WithInput<VideoStream>("c:/foo/bar1.mp4")
.WithInput<VideoStream>("c:/foo/bar2.mp4")
.WithInput<VideoStream>("c:/foo/bar3.mp4")
.Filter(filterchain)
.MapTo<Mp4>("c:/foo/bar4.mp4", settings);
//the render command will start feeding the commands to FFmpeg
factory.Render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment