FFmpegArgs 1.5.0

.NET 5.0 .NET Standard 2.0 .NET Framework 4.6.2
Install-Package FFmpegArgs -Version 1.5.0
dotnet add package FFmpegArgs --version 1.5.0
<PackageReference Include="FFmpegArgs" Version="1.5.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FFmpegArgs --version 1.5.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FFmpegArgs, 1.5.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install FFmpegArgs as a Cake Addin
#addin nuget:?package=FFmpegArgs&version=1.5.0

// Install FFmpegArgs as a Cake Tool
#tool nuget:?package=FFmpegArgs&version=1.5.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

FFmpegArgs

FFmpegArgs is a cli-wrapper library support generate argument for ffmpeg executable.
The standout feature that many cli-wrapper libraries don't have is the FFmpeg FilterGraph system.

Get it on NuGet Package


  • Support file/url/pipe in/output.
  • Works on most systems - if ffmpeg can execution.
  • 130+ filters, add more in future
  • 380+ filters auto-generate

Example

FFmpegArg ffmpegArg = new FFmpegArg()
    .OverWriteOutput();//global extension

var green_video = ffmpegArg.AddVideoInput(
        new VideoFileInput(@"chromakey.mp4")
            .SsPosition(TimeSpan.FromSeconds(0.5))//input extension ( -ss )
            .AndSet(
                x => x.ImageInputAVStream//input video stream
                    .R(24)//input, video, per-stream extension ( -r )
            )
    );
var background_videoMap = ffmpegArg.AddVideoInput(new VideoFileInput(@"background.mp4")
    .SsPosition(TimeSpan.FromSeconds(1))
    .ToPosition(TimeSpan.FromSeconds(10)));

var image_maps = green_video.ImageMaps.First()
    .ColorKeyFilter()//ColorKey Filter
        .Color(Color.FromArgb(101, 220, 8))
        .Similarity(0.25f)
        .Enable("between(t,0,10)").MapOut//Filter had ITimelineSupport
    .ScaleFilter().W("iw/3").H("ih/3").MapOut//Scale Filter
    .SplitFilter(2).MapsOut;//Split Filter

var overlay_map = image_maps.First()
    //overlay color_key on-center background_video
    .OverlayFilterOn(background_videoMap.ImageMaps.First()).X("(W-w)/2").Y("(H-h)/2").MapOut;

ffmpegArg.AddOutput(
    new VideoFileOutput(@"out.mp4", overlay_map, background_videoMap.AudioMaps.First())
    .T(TimeSpan.FromSeconds(5))//output extension ( -t )
    .AndSet(
        x => x.ImageInputAVStream//output video stream
            .R(24)//output, video, per-stream extension ( -r )
        )
    );
ffmpegArg.AddOutput(
    new VideoFileOutput(@"out2.mp4", image_maps.Last(), background_videoMap.AudioMaps.First())
    .AndSet(x => x.ImageInputAVStream.R(30)));

var renderResult = ffmpegArg
    .Render(c => c
        .WithFFmpegBinaryPath("path to ffmpeg")//or default ffmpeg from PATH
        .WithWorkingDirectory("path to working folder")//or default Directory.GetCurrentDirectory()
    )
    .Execute();

For more example, see FFmpegArgs.Test


  • Option/Flag not found?

We can extend for FFmpegArg, Filter, Input, Output, AVStream by extension.

.SetOption("your option","option value")
.SetOptionRange("your option", val, min, max)
.SetFlag("your flag")

  • Filter not found?

We can write new Filter class, so much example in FFmpegArgs.Filters

Pull request or request missing feature are welcome.


Recommend namespace

using FFmpegArgs;
using FFmpegArgs.Cores;
using FFmpegArgs.Cores.Enums;
using FFmpegArgs.Cores.Exceptions;
using FFmpegArgs.Cores.Inputs;
using FFmpegArgs.Cores.Filters;
using FFmpegArgs.Cores.Interfaces;
using FFmpegArgs.Cores.Maps;
using FFmpegArgs.Cores.Streams;

using FFmpegArgs.Filters;
using FFmpegArgs.Filters.Exceptions;
using FFmpegArgs.Filters.Attributes;
using FFmpegArgs.Filters.Expressions;

using FFmpegArgs.Filters.AudioFilters;
using FFmpegArgs.Filters.VideoFilters;
using FFmpegArgs.Filters.MultimediaFilters;
using FFmpegArgs.Filters.VideoSources;
using FFmpegArgs.Filters.AudioSources;
//using FFmpegArgs.Filters.Autogens;

using FFmpegArgs.Executes;
using FFmpegArgs.Inputs;
using FFmpegArgs.Outputs;


LICENCE

MIT

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

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
1.5.0 91 6/6/2022
1.4.0 585 2/28/2022
1.3.0 99 2/11/2022
1.2.0 98 1/13/2022
1.1.1 106 1/5/2022
1.1.0 203 12/27/2021