FFmpegDotNet 8.0.0.5

dotnet add package FFmpegDotNet --version 8.0.0.5
                    
NuGet\Install-Package FFmpegDotNet -Version 8.0.0.5
                    
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="FFmpegDotNet" Version="8.0.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FFmpegDotNet" Version="8.0.0.5" />
                    
Directory.Packages.props
<PackageReference Include="FFmpegDotNet" />
                    
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 FFmpegDotNet --version 8.0.0.5
                    
#r "nuget: FFmpegDotNet, 8.0.0.5"
                    
#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 FFmpegDotNet@8.0.0.5
                    
#: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=FFmpegDotNet&version=8.0.0.5
                    
Install as a Cake Addin
#tool nuget:?package=FFmpegDotNet&version=8.0.0.5
                    
Install as a Cake Tool

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

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:

  1. Current directory (./)
  2. ./ffmpeg/
  3. Platform-specific subdirectories (e.g. ./ffmpeg/win-x64, ./ffmpeg/linux-arm64, etc.)
  4. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
8.0.0.5 211 11/7/2025
8.0.0.2 230 10/28/2025
8.0.0.1 184 10/22/2025
8.0.0 197 10/21/2025
1.0.0 279 10/20/2025

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.