Xabe.FFmpeg 6.1.1

dotnet add package Xabe.FFmpeg --version 6.1.1
                    
NuGet\Install-Package Xabe.FFmpeg -Version 6.1.1
                    
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="Xabe.FFmpeg" Version="6.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xabe.FFmpeg" Version="6.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Xabe.FFmpeg" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Xabe.FFmpeg --version 6.1.1
                    
#r "nuget: Xabe.FFmpeg, 6.1.1"
                    
#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.
#:package Xabe.FFmpeg@6.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Xabe.FFmpeg&version=6.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Xabe.FFmpeg&version=6.1.1
                    
Install as a Cake Tool

Xabe.FFmpeg

Build NuGet version Total NuGet downloads

A cross-platform .NET wrapper that runs FFmpeg and FFprobe for you from C#: convert, probe, resize, subtitle, and stream media without memorizing the command line.

How it works. Xabe.FFmpeg does not bind to the native libav* libraries. It builds an FFmpeg argument string and starts the ffmpeg / ffprobe executables that exist on your machine (or that you tell it about). Everything the FFmpeg CLI can do stays available — you are never limited to what the wrapper models.

Xabe.FFmpeg basic workflow

Contents:

Install

Xabe.FFmpeg is distributed on NuGet:

dotnet add package Xabe.FFmpeg

or in the NuGet Package Manager console:

PM> Install-Package Xabe.FFmpeg

Prerequisite: both the ffmpeg and ffprobe executables must be available. If you do not have them, either install them from your platform's package manager, or use the separate Xabe.FFmpeg.Downloader package, which fetches a build for you.

When you create a conversion, the library locates the executables in this order:

  1. The directory you pointed it at with FFmpeg.SetExecutablesPath(...).
  2. The directory containing your application's entry assembly.
  3. The directories listed in the PATH environment variable.

Lookup is by executable name (ffmpeg, ffprobe, plus .exe on Windows) and is case-insensitive. If neither executable is found, an FFmpegNotFoundException is thrown with a message pointing at the locations it searched (the configured directory, if any, and PATH).

Quick start

One complete local-file conversion. This compiles and runs in any console project that references the package, as long as ffmpeg/ffprobe are discoverable:

using System;
using Xabe.FFmpeg;

string input = "movie.mkv";
string output = "movie.mp4";

IConversion conversion = await FFmpeg.Conversions.FromSnippet.ToMp4(input, output);
IConversionResult result = await conversion.Start();

Console.WriteLine(result.Arguments);

The snippet probes the input, selects the first video and audio streams, and retargets them to H.264/AAC in an MP4 container. Against a two-stream MKV input the emitted command has the shape:

-i "movie.mkv" -c:v h264 -c:a aac -map 0:0 -map 0:1 -n "movie.mp4"

Note the -n: the snippet does not overwrite an existing output file, so running the snippet twice fails with a ConversionException until you delete or rename movie.mp4.

Packages and capabilities

Package Purpose
Xabe.FFmpeg Builds FFmpeg/FFprobe command lines, runs the executables, and surfaces results and progress.
Xabe.FFmpeg.Downloader Separate, optional package that downloads an ffmpeg/ffprobe build for the current OS into a directory you choose.

What the core package offers today:

  • Common conversion snippets (to MP4/TS/WebM/OGV/GIF, extract/add audio, snapshots, split, concatenate, watermarks, M3U8 capture, send files to an RTSP server).
  • Stream-level control: select, copy, or reconfigure individual video, audio, and subtitle streams (codec, bitrate, size, rotation, filters).
  • Probing with FFmpeg.GetMediaInfo(...) (ffprobe-backed) and raw Probe access for custom ffprobe arguments.
  • Progress and raw-output events: OnProgress, OnDataReceived, and OnVideoDataReceived (with PipeOutput).
  • RTSP/web streams: send files or the desktop to an RTSP server, capture HLS playlists.
  • Hardware acceleration pass-through: cuvid/NVENC, QuickSync, VideoToolbox, VAAPI and friends, via UseHardwareAcceleration(...).
  • Arbitrary custom FFmpeg parameters with explicit placement (ParameterPosition).

Public entry points worth knowing: FFmpeg (the static facade), FFmpeg.Conversions (new conversions), FFmpeg.Conversions.FromSnippet (ready-made operations), FFmpeg.GetMediaInfo (probing), IConversion (fluent conversion builder), IConversionResult (outcome incl. the emitted Arguments), and the stream interfaces IVideoStream, IAudioStream, ISubtitleStream.

Choosing the right API level

All three levels return or build the same IConversion; pick the lowest level that expresses your operation.

1. Start with a snippet for the common operations:

IConversion conversion = await FFmpeg.Conversions.FromSnippet.ExtractAudio(input, output);
await conversion.Start();

2. Use the stream builder when you need to select or change streams and codecs:

using System.Linq;
using Xabe.FFmpeg;

IMediaInfo mediaInfo = await FFmpeg.GetMediaInfo(input);
IVideoStream videoStream = mediaInfo.VideoStreams
    .First()
    .SetCodec(VideoCodec.h264)
    .SetSize(VideoSize.Hd480);

IConversion conversion = FFmpeg.Conversions.New()
    .AddStream(videoStream)
    .SetOutput(output)
    .SetOverwriteOutput(true);

await conversion.Start();

3. Use raw parameters for options the API does not model. FFmpeg options are position-sensitive, so AddParameter takes a ParameterPosition: PreInput places the option before the input definition (-i), PostInput (the default) places it after.

using Xabe.FFmpeg;

IMediaInfo mediaInfo = await FFmpeg.GetMediaInfo(input);

IConversion conversion = FFmpeg.Conversions.New()
    .AddStream(mediaInfo.Streams)
    .AddParameter("-re", ParameterPosition.PreInput)
    .AddParameter("-ss 00:00:01 -t 00:00:05")
    .SetOutput(output)
    .SetOverwriteOutput(true);

string arguments = conversion.Build(); // inspect before running
await conversion.Start();

Full detail on all three approaches lives in the online guide (see its Snippets, Streams, and Own arguments chapters).

Finding FFmpeg and FFprobe

Point the library at a directory that contains both executables:

using Xabe.FFmpeg;

FFmpeg.SetExecutablesPath(@"C:\Tools\ffmpeg");

Or let the optional Xabe.FFmpeg.Downloader package fetch a build into a directory, then point the library at it:

using Xabe.FFmpeg;
using Xabe.FFmpeg.Downloader;

string executableDirectory = "./ffmpeg";

await FFmpegDownloader.GetLatestVersion(FFmpegVersion.Official, executableDirectory);
FFmpeg.SetExecutablesPath(executableDirectory);

Downloader providers available today:

FFmpegVersion Source Platforms
Official ffbinaries builds, queried through their API (recommended) Windows (32/64-bit), macOS, Linux (incl. 32-bit and ARM)
Full / Shared Static (Full) and shared (Shared) Zenaroe builds served from xabe.net; Full reached end of life and is no longer updated Windows, macOS
Android Android builds (Mobile-FFmpeg family) served from xabe.net Android (ARM/ARM64/x86/x86_64)

The downloader always fetches the provider's latest build; there is no API to pin an arbitrary FFmpeg version.

Heads-up: which encoders, decoders, filters, and hardware accelerations actually work depends on the FFmpeg build you install and on your host hardware (ffmpeg -encoders, ffmpeg -decoders, ffmpeg -hwaccels show what your build ships).

Compatibility and limitations

  • Targeting: both packages target .NET Standard 2.0, which is consumable by any modern .NET workload (current .NET, .NET Framework 4.6.1 and later, and other NS2.0-compatible runtimes such as Unity) — see Microsoft's targeting and platform-support documentation for the full matrix.
  • Operating systems: conversion works on Windows, macOS, and Linux wherever the executables can be discovered (configured directory, application directory, or PATH). The downloader covers the platforms listed above; the site notes that Tizen and Raspberry Pi are not supported by the downloader.
  • Tested FFmpeg build: CI runs the entire test suite against a SHA-256-pinned FFmpeg — BtbN build n7.1.1-57-g1b48158a23 (GPL, linux64, autobuild 2025-08-31). That is tested evidence, not a support promise for other versions; any reasonably recent, complete ffmpeg/ffprobe pair works in practice.
  • Licenses, separately. The wrapper is released under CC BY-NC-SA 3.0 for non-commercial use; commercial use requires a Xabe license — see the license page and pricing. The FFmpeg/FFprobe executables are licensed independently of this package — commonly GPL or LGPL depending on the build you obtain — and their terms apply to you as the installer.
  • Limitations: conversions operate on files and stream URIs, not in-memory buffers; there is no arbitrary FFmpeg version pinning; and because this is a CLI wrapper, exotic setups (e.g. unusual process management) are yours to configure.

Troubleshooting and support

  • "Cannot find FFmpeg" (FFmpegNotFoundException): make sure both ffmpeg and ffprobe exist, are executable, and match your architecture; then check the discovery order above — configured directory first, then the application directory, then PATH.
  • A conversion fails: when you have a result, inspect IConversionResult.Arguments to see exactly what was run; attach the conversion's raw output (captured through the OnDataReceived event) or the exception details to any report. The API does not retain the full FFmpeg log after Start() completes.
  • Unexpected custom-option behaviour: re-check ParameterPosition and the string returned by Build() — the library does not validate option placement, so a misplaced option surfaces as a baffling FFmpeg error.
  • Codec or hardware-acceleration errors: your build may simply lack it — inspect the installed FFmpeg with ffmpeg -encoders, ffmpeg -decoders, and ffmpeg -hwaccels before suspecting the wrapper.

Where to go:

Documentation and project resources

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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 was computed.  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.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (25)

Showing the top 5 NuGet packages that depend on Xabe.FFmpeg:

Package Downloads
Xabe.FFmpeg.Downloader

FFmpeg assemly downloader. Download ffmpeg binary data on Windows, Mac or Linux.

Kayisoft.Abp.XabeFFmpeg

Kayisoft Xabe FFmpeg Module

FormCMS

AI powered CMS

CommonNetFuncs.Media.Ffmpeg

Helper methods for running tasks with ffmpeg using the Xabe.FFmpeg package.

RenderHaze.VideoRenderer

Timeline-based video compositor, part of RenderHaze

GitHub repositories (8)

Showing the top 8 popular GitHub repositories that depend on Xabe.FFmpeg:

Repository Stars
TypNull/Tubifarry
Tubifarry is a Lidarr plugin that enhances your music library by fetching music from YouTube, integrating with Slskd for Soulseek access, automating Spotify playlist imports, converting files, and retrieving soundtracks from Radarr and Sonarr.
Cirx08/WeddingShare
A place for guests to view and drop pictures of the big day
MayDay-wpf/AIBotPublic
AIBot PRO 是一个基于.NET 8 的 AI聚合客户端 to C 弱 to B 可以集成众多AI产品(ChatGPT,Gemini,Claude,文心一言,通义千问,讯飞星火),无感切换对话,支持知识库、插件开发、AI流程引擎(workflow)、以及开放平台对外输出定制化的特色AI API
formcms/formcms
AI Agent: Open-source headless CMS built with ASP.NET Core (C#) and React, featuring REST APIs, GraphQL, and a GrapesJS page designer.
cliveontoast/GoMoPho
Google motion photos video extractor
aehyok/.NET8.0
net8.0 efcore mysql redis rabbitmq 微服务
XyLe-GBP/waifu2x-ncnn-vulkan-GUI-Edition-Reloaded
GUI-based Super-Resolution Convolutional Neural Network(SRCNN)Utility.
Dixin/Blog
Code examples for blog https://weblogs.asp.net/dixin.
Version Downloads Last Updated
6.1.1 4,786 9/23/2026
6.1.0 204 9/23/2026
6.0.2 401,907 8/8/2025
6.0.1 208,888 2/13/2025
6.0.0 5,986 2/10/2025
5.2.6 709,696 3/14/2023
5.2.5 24,502 2/9/2023
5.2.4 18,373 1/25/2023
5.2.3 21,441 12/22/2022
5.2.2 2,779 12/20/2022
5.2.1 4,726 12/11/2022
5.2.0 166,582 5/5/2022
5.1.0 68,207 1/18/2022
5.0.2 146,238 5/28/2021
5.0.1 5,151 5/22/2021
5.0.0 13,358 5/15/2021
4.4.1 8,943 5/11/2021
4.4.0 53,447 12/9/2020
4.3.1 71,296 9/24/2020
4.3.0 3,082 9/18/2020
Loading failed