FFmpegDotNet 8.0.0.5
dotnet add package FFmpegDotNet --version 8.0.0.5
NuGet\Install-Package FFmpegDotNet -Version 8.0.0.5
<PackageReference Include="FFmpegDotNet" Version="8.0.0.5" />
<PackageVersion Include="FFmpegDotNet" Version="8.0.0.5" />
<PackageReference Include="FFmpegDotNet" />
paket add FFmpegDotNet --version 8.0.0.5
#r "nuget: FFmpegDotNet, 8.0.0.5"
#:package FFmpegDotNet@8.0.0.5
#addin nuget:?package=FFmpegDotNet&version=8.0.0.5
#tool nuget:?package=FFmpegDotNet&version=8.0.0.5
FFmpeg (.NET Wrapper)
A .NET wrapper library for FFmpeg built using FFmpeg.AutoGen.
This library provides a managed, object-oriented interface to FFmpeg’s C API — making it easier, safer, and more intuitive to use FFmpeg in .NET applications.
📖 Overview
FFmpeg is a powerful open-source multimedia framework for handling video, audio, and streams.
While FFmpeg.AutoGen exposes FFmpeg’s native C API to .NET, it requires working directly with pointers and unsafe memory operations.
The FFmpeg (.NET Wrapper) library provides a high-level, managed abstraction over FFmpeg.AutoGen — letting you access FFmpeg’s encoding, decoding, transcoding, and streaming capabilities safely from C#.
🚀 Getting Started
1. Prerequisites
- .NET Standard 2.1 compatible runtime (e.g., .NET Core 3.1+, .NET 5+, .NET 6+, Mono, etc.)
- FFmpeg binaries available in your system path
Supported FFmpeg Versions
FFmpeg 8.0.0 "Huffman"
| Library | Version |
|---|---|
| avcodec | 62 |
| avdevice | 62 |
| avfilter | 11 |
| avformat | 62 |
| avutil | 60 |
| swresample | 6 |
| swscale | 9 |
2. Loading FFmpeg Libraries
The FFmpeg namespace includes a static helper class named FFmpegLoader, which is responsible for locating and initializing the native FFmpeg libraries before use.
If Initialize() is not called manually, the library will automatically attempt to locate the FFmpeg binaries using a predefined search order.
Use the nuget package FFmpegDotNet.bin.winx64 to include the lgpl ffmpeg libraries automatically.
Default Search Order
When FFmpegLoader.Initialize() is called with no parameters, the following directories are searched in order:
- Current directory (
./) ./ffmpeg/- Platform-specific subdirectories (e.g.
./ffmpeg/win-x64,./ffmpeg/linux-arm64, etc.) - System
%PATH%environment variable
If a suitable library is not found, initialization will fail and FFmpeg functions will be unavailable.
🧩 Important Classes
The FFmpeg namespace provides a set of managed wrapper classes around FFmpeg’s core C structs and APIs.
These classes simplify the process of interacting with FFmpeg by handling resource management, initialization, and data conversion automatically.
🎞️ Core Low-Level Wrappers
These classes map directly to FFmpeg’s internal structures.
They are typically used when building advanced or custom media pipelines.
| Class | Description |
|---|---|
FFmpeg.Formats.FormatContext |
Wraps AVFormatContext. Handles input/output container formats, stream information, and demuxing/muxing. |
FFmpeg.Codecs.CodecContext |
Wraps AVCodecContext. Manages codecs for encoding and decoding audio/video streams. |
FFmpeg.Utils.AVPacket |
Wraps AVPacket. Represents encoded data (compressed frames or packets). |
FFmpeg.Utils.AVFrame |
Wraps AVFrame. Represents decoded, uncompressed media frames in memory. |
FFmpeg.Filters.FilterGraph |
Wraps AVFilterGraph. Provides access to FFmpeg’s powerful filter system (for resizing, color correction, etc.). |
FFmpeg.Images.SwsContext |
Wraps SwsContext. Used for image scaling and pixel format conversion via libswscale. |
FFmpeg.Audio.SwrContext |
Wraps SwrContext. Handles audio resampling, format conversion, and channel layout adjustments via libswresample. |
🧠 Note:
These classes closely follow FFmpeg’s internal lifecycle patterns and should be disposed (IDisposable) when no longer needed.
⚡ High-Level Abstractions
If your goal is to read, decode, encode, or transcode media streams,
you can use the high-level abstractions instead of managing FormatContext and CodecContext directly.
| Class | Description |
|---|---|
MediaSource |
Simplifies reading and decoding frames from a file or stream. Handles demuxing and decoding internally. |
MediaSink |
Simplifies encoding and writing frames to a file or stream. Handles muxing and encoding internally. |
Transcoder |
Provides a convenient way to read from one source and write to another, performing full media transcoding. |
These abstractions are ideal for typical scenarios such as:
- Extracting frames from a video
- Re-encoding media to a different format
- Streaming or piping decoded frames to other components
| Product | Versions 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- FFmpegDotNet._AutoGen (>= 8.0.0 && < 9.0.0)
- System.IO.Pipelines (>= 9.0.10)
- System.Security.Permissions (>= 9.0.10)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on FFmpegDotNet:
| Package | Downloads |
|---|---|
|
FFmpegDotNet.Skia
Provides SkiaSharp integration for the FFmpeg .NET wrapper. Enables converting FFmpeg AVFrames to SKImage or SKBitmap, and includes high-level classes (FFCodec2Skia, SKVideo) for decoding and rendering videos or images with Skia. |
|
|
FFmpegDotNet.bin.winx64
This package contains the lgpl FFmpeg 8.0 "Huffman" binaries. Use this package with FFmpegDotNet, if you do not want to provide the ffmpeg libraries yourself. |
GitHub repositories
This package is not used by any popular GitHub repositories.
1.) Added AudioFifo
2.) [Obsolete] AVFrame.GetBuffer -> renamed to CreateBuffer
3.) AVFrame.Allocate has now overloads that allocate the buffer aswell
4.) Input/OutputFormat's static constructor now call ffmpeg.av_device_register_all, making device formats visible. (e.g. GDIScreenGrabber)
5.) MediaSource no longer thread-safe. It doesn't make much sense to access this from different threads, the caller should take care of thread-safety.