This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseGameHighlightRating | |
{ | |
//pre-existing fields ... | |
public BaseMomentRenderedFile RenderedFile { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseGameHighlightRating | |
{ | |
//pre-existing fields ... | |
public List<BaseMomentRenderedFiles> RenderedFiles { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseMomentRenderedFile : BaseRenderedFile | |
{ | |
public string Id { get; set; } | |
public List<string> MomentIds { get; set; } | |
//.. any additional future fields such as exciting moment time would go here. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this command will map the filtered streams to the path, with the settings we defined | |
filtered.MapTo<Mp4>("c:/foo/bar4.mp4", settings); | |
//the render command will start feeding the commands to FFmpeg | |
factory.Render(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this applies the filterchain to the selected inputs, and gives the resulting stream(s) | |
var filtered = command.Filter(filterchain); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 | |
var command = factory.CreateOutputCommand() | |
.WithInput<VideoStream>("c:/foo/bar1.mp4") | |
.WithInput<VideoStream>("c:/foo/bar2.mp4") | |
.WithInput<VideoStream>("c:/foo/bar3.mp4"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Hudl.FFmpeg.Command; | |
using Hudl.FFmpeg.Common; | |
using Hudl.FFmpeg.Filters.BaseTypes; | |
using Hudl.FFmpeg.Metadata; | |
using Hudl.FFmpeg.Resources.BaseTypes; | |
using Hudl.FFmpeg.Sugar; | |
... | |
//below are a few constants and assumptions that can be made |