FFmpegArgs.Filters
1.1.0
.NET 5.0
This package targets .NET 5.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.6.2
This package targets .NET Framework 4.6.2. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package FFmpegArgs.Filters --version 1.1.0
NuGet\Install-Package FFmpegArgs.Filters -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FFmpegArgs.Filters" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FFmpegArgs.Filters --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FFmpegArgs.Filters, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FFmpegArgs.Filters as a Cake Addin #addin nuget:?package=FFmpegArgs.Filters&version=1.1.0 // Install FFmpegArgs.Filters as a Cake Tool #tool nuget:?package=FFmpegArgs.Filters&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FFmpegArgs
Easy to use
FFmpegArg ffmpegArg = new FFmpegArg().OverWriteOutput();
var green_video = ffmpegArg.AddVideoInput(new VideoFileInput(@"chromakey.mp4")
.SsPosition(TimeSpan.FromSeconds(0.5)));
var background_video = ffmpegArg.AddVideoInput(new VideoFileInput(@"background.mp4")
.SsPosition(TimeSpan.FromSeconds(1))
.ToPosition(TimeSpan.FromSeconds(10)));
var color_keys = green_video.ImageMaps.First()
.ColorKeyFilter(Color.FromArgb(101, 220, 8)).Similarity(0.25f)//ColorKey
.Enable("between(t,0,10)").MapOut//ITimelineSupport
.ScaleFilter("iw/3", "ih/3").MapOut
.SplitFilter(2).MapsOut;//Scale
var overlay = color_keys.First()
//overlay color_key on-center background_video
.OverlayFilterOn(background_video.ImageMaps.First(), "(W-w)/2", "(H-h)/2").MapOut;
ffmpegArg.AddOutput(new VideoFileOutput(@"out.mp4", overlay, background_video.AudioMaps.First()).Fps(24));
ffmpegArg.AddOutput(new VideoFileOutput(@"out2.mp4", color_keys.Last(), background_video.AudioMaps.First()).Fps(30));
var renderResult = ffmpegArg
.Render(c => c
.WithFFmpegBinaryPath("path to ffmpeg.exe")
.WithWorkingDirectory(Directory.GetCurrentDirectory()))
.Execute();
For more example, see FFmpegArgs.Test
Easy extend
//filter
public class PadFilter : ImageToImageFilter
{
static readonly IEnumerable<string> _variables = new List<string>()
{
"in_w", "in_h", "iw", "ih",
"out_w", "out_h", "ow", "oh",
"x","y","a","sar","dar",
"hsub", "vsub"
};
readonly FFmpegExpression expression = new FFmpegExpression(_variables);
internal PadFilter(Action<FFmpegExpression> w, Action<FFmpegExpression> h, ImageMap imageMap) : base("pad", imageMap)
{
AddMapOut();
this.SetOption("w", w.Run(expression));
this.SetOption("h", h.Run(expression));
}
public PadFilter Position(Action<FFmpegExpression> x, Action<FFmpegExpression> y)
=> this.SetOption("x", x.Run(expression)).SetOption("y", y.Run(expression));
public PadFilter Position(string x, string y)
=> Position(x.Expression(), y.Expression());
public PadFilter Color(Color color)
=> this.SetOption("color", color.ToHexStringRGBA());
public PadFilter Eval(ScaleEval eval)
=> this.SetOption("eval", eval.ToString().ToLower());
}
public static class PadFilterExtension
{
public static PadFilter PadFilter(this ImageMap imageMap, Action<FFmpegExpression> w, Action<FFmpegExpression> h)
{
return new PadFilter(w, h, imageMap ?? throw new ArgumentNullException(nameof(imageMap)));
}
}
//input
public static T FrameRate<T>(this T input, int r) where T : BaseInput
=> input.SetOption("-r", r);
//output
public static T VSync<T>(this T output,int vsync) where T : ImageOutput
=> output.SetOption("-vsync", vsync);
public static T ASync<T>(this T output, int async) where T : AudioOutput
=> output.SetOption("-async", async);
//global
public static FFmpegArg OverWriteOutput(this FFmpegArg ffmpegArg)
=> ffmpegArg.SetFlag("-y");
ffmpeg expression check
//auto check with expression
img.ScaleFilter("iw/3", "ih/3")
//or
img.ScaleFilter(w => w.Check("iw/3"), h => h.Check("ih/3"))
//if expression bropblem
img.ScaleFilter(w => w.NonCheck("iw/3"), h => h.NonCheck("ih/3"));
LICENCE
Under ffmpeg licence
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- FFmpegArgs (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.1-build241114 | 71 | 11/14/2024 |
2.0.0 | 229 | 7/16/2024 |
1.6.1 | 524 | 1/16/2024 |
1.5.2 | 442 | 5/5/2023 |
1.5.0 | 686 | 6/6/2022 |
1.4.3 | 1,580 | 4/11/2022 |
1.4.2 | 482 | 3/28/2022 |
1.4.1 | 453 | 3/26/2022 |
1.4.0 | 504 | 2/28/2022 |
1.3.0 | 515 | 2/11/2022 |
1.2.0 | 499 | 1/13/2022 |
1.1.2-build220107 | 251 | 1/7/2022 |
1.1.1 | 357 | 1/5/2022 |
1.1.0 | 339 | 12/27/2021 |