FFmpegDotNet 8.1.2.15
See the version list below for details.
dotnet add package FFmpegDotNet --version 8.1.2.15
NuGet\Install-Package FFmpegDotNet -Version 8.1.2.15
<PackageReference Include="FFmpegDotNet" Version="8.1.2.15" />
<PackageVersion Include="FFmpegDotNet" Version="8.1.2.15" />
<PackageReference Include="FFmpegDotNet" />
paket add FFmpegDotNet --version 8.1.2.15
#r "nuget: FFmpegDotNet, 8.1.2.15"
#:package FFmpegDotNet@8.1.2.15
#addin nuget:?package=FFmpegDotNet&version=8.1.2.15
#tool nuget:?package=FFmpegDotNet&version=8.1.2.15
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+ "Huffman/Hoare"
| 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 automatically include the LGPL FFmpeg binaries.
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
📚 Examples
Complete sample applications are available in the FFmpeg.Examples repository.
The examples range from low-level usage of the FFmpeg API to the higher-level abstractions provided by FFmpegDotNet, making them a good starting point for learning the library.
Examples include:
- Opening media files with
DemuxerContext - Decoding audio and video streams
- Reading and writing media containers
- Audio resampling with
SwrContext - Image scaling and pixel format conversion with
SwsContext - Using
MediaSourcefor simplified decoding - Encoding
- Filters
The examples are intentionally kept small and focused, with each project demonstrating a single feature or workflow.
➡️ Source Code: https://github.com/Pascal-Krenckel/FFmpeg.Examples
| 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.1.2.4 && < 9.0.0)
- System.IO.Pipelines (>= 10.0.11)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
- System.Security.Permissions (>= 10.0.11)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FFmpegDotNet:
| Package | Downloads |
|---|---|
|
FFmpegDotNet.Skia
Provides SkiaSharp integration for the FFmpeg .NET wrapper (FFmpegDotNet). Converts FFmpeg AVFrames to SKImage or SKBitmap and back, with crop, color space (YUV matrix, range, HDR) and alpha handling, and includes high-level classes (FFCodec2Skia, SKVideo, SKAnimatedImage) for decoding and rendering videos and animated images with Skia. The package version starts with the FFmpeg major version: 8.x for FFmpegDotNet 8 (FFmpeg 8.1), 9.x for FFmpegDotNet 9 (FFmpeg 9.0). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.9.4 | 153 | 11/19/2026 |
| 9.9.3.1 | 92 | 11/19/2026 |
| 9.9.3 | 89 | 11/19/2026 |
| 9.9.2 | 87 | 11/19/2026 |
| 9.9.1 | 89 | 11/19/2026 |
| 9.9.0.2 | 92 | 11/18/2026 |
| 9.9.0.1 | 234 | 9/3/2026 |
| 9.9.0 | 145 | 9/2/2026 |
| 8.1.2.15 | 135 | 11/19/2026 |
| 8.1.2.14 | 86 | 11/18/2026 |
| 8.1.2.13 | 153 | 9/2/2026 |
| 8.1.2.12 | 138 | 9/1/2026 |
| 8.1.2.11 | 199 | 8/16/2026 |
| 8.1.2.10 | 134 | 8/16/2026 |
| 8.1.2.9 | 143 | 8/15/2026 |
| 8.1.2.8 | 176 | 8/14/2026 |
| 8.1.2.6 | 163 | 7/30/2026 |
| 8.1.2.5 | 144 | 7/28/2026 |
| 8.1.2.4 | 148 | 7/26/2026 |
| 8.1.2.3 | 154 | 7/25/2026 |
--- 8.1.2.15 ---
BugFix: SetOption(string,IDictionary) was changed by Claude to behave like SetOption(IDictionary) and not setting the underlying Dictionary like intended. SetOption(IDictionary) is no obsolet use SetOptions instead.
--- 8.1.2.14 ---
Many BugFixes found in a code review:
IO: custom IOContext callbacks are rooted and no longer let exceptions escape into native code; IOContext/CodecContext can be finalized; use-after-free when opening custom IO failed; IOStreamContext no longer throws on construction; seeking works for seekable IOContexts; AVIOContext.seekable was read from the wrong offset on Windows (32-bit C long).
Formats/Codecs: MuxerContext double dispose, NoFile check and time base rescaling; extradata is padded as FFmpeg requires; SendFrame no longer changes an open encoder's time base; encoded subtitle packets use a correct time base; MediaSource keeps its decoders, drains all of them at end of file and SeekExactly ends only for the requested stream; seeks past ~35 minutes and timestamp setters past ~6.6 hours no longer overflow.
Utils: Rational +, - and int * Rational overflow; TimeSpan / Rational saturated; AVPacket leak and Size overrun; AVFrame.GetData/Copy/Size/Clone for bottom-up and audio frames; AVBuffer.ReplaceWith use-after-free; Move/Clone/Reference onto itself emptied the packet; AVResult64.ToString named wrong errors.
Audio: AudioFifo layout conversion and peeks beyond one chunk, pinning of channel spans; SwrContext wrote past the buffer when converting at an offset; AudioBuffer Copy/MakeWriteable shared data through stale plane pointers, planar-to-packed copies were wrong, start index is validated; AudioClock counted time twice after Pause; ChannelLayout.Init kept a freed map after a failure, custom channel names must be NUL-terminated.
Collections: CircularArray.IndexOf/Clear, AVChapter removal keeps its order, SubtitleRect text setters crashed, hardware device/frames context references crashed when empty.
Options: binary options were read from the wrong address, the generic getter for color, duration and array options, bool in SetOption(name, object), SetOption with dictionaries uses av_opt_set_dict2.
MediaPlayer: VideoBuffer/AudioBuffer lost writes and CanSeek was reversed, AudioBuffer binary search could loop forever, SetBufferSize estimate, Stop state, decoding errors now fault the player.
Misc: SVTAV1.CreateAvif encoded the wrong frame; Transcoder decoded a packet twice; Logger kept no prefix state across av_log calls; FormatContext.Url is read as UTF-8; SwsContext throws if it cannot be created.
--- 8.1.2.13 ---
BugFix: CircularArray.RemoveAt cleared the wrong slot.
--- 8.1.2.12 ---
BugFix: MediaSource.SetCodecContext did not set the time base.
BugFix: SetOption(...,Dictionary,...) now removes all set options.
--- 8.1.2.11 ---
BugFix: EventHandler BeginInvoke is not supported.
--- 8.1.2.10 ---
BugFix: CancellableWorkItem would still perform the action if canceled.
FFmpeg.Helper.Exceptions include now static extenstions for easy throwing, especially under .netstandard (e.g. ObjectDisposeException.ThrowIfTrue(bool,this))
--- 8.1.2.9 ---
Added FFmpegWorkQueue, a concurrency-limited work queue for asynchronous FFmpeg operations.
Supports cancellable send/receive operations for codecs and filters, hardware frame reception, arbitrary FFmpeg work such as seeking, configurable concurrency, and synchronous/asynchronous disposal.
CancellableWorkItem operations can be awaited directly.
--- 8.1.2.8 ---
BugFix: Peek samples calculation missing "/ Channels"
BugFix: FilterGraph Copy ignores auto_ filters. Added Flush().
BugFix: AVResult.ThrowIfError now throws if error is TryAgain
Added class FFmpeg.Collections.CircularArray<T>
Added MediaPlayer namespace for easy MediaPlayer implementation (see example project 9.)
--- 8.1.2.7 ---
Readme fixed
--- 8.1.2.6 ---
FFmpegDotNet._AutoGen was not build against FFmpeg 8.1.2 but master - FFmpeg 9.0 (pre)
--- 8.1.2.5 ---
Reworked filtering
Removed dupplicated function in filters, moved FilterContext Create[Filter] function in Audio/VideoFilters.
Documentation
Some BugFixes in FilterGraph
--- 8.1.2.4 ---
BugFix: FormatContext.WritePacket wrote interleaved packets previously.
BugFix/full implementation: MediaSink is now fully implemented, some bugs got fixed
BugFix: SwsContext copies now into "readonly" AVFrame
BugFix: SwsContext does create a Buffer if the frame does not have one. The plane pointers are fetched after the buffer was created
--- 8.1.2.3 ---
XML Docu no in nuget package
Support for custom audio channel layout
AudioFifo-Bugfix
Some smaller changes
--- 8.1.2.2 ---
Added namespace FFmpeg.Logging for logging.
--- 8.1.2.1 ---
MediaSource now copies the streams timebase into the CodecContexts timebase.
The CodecContexts timebase is writen into the frame if the frame's timebase's numerator is 0.
=== 8.1.2 ===
Update to ffmpeg 8.1.2 "Hoarse".
FormatContext was split into DemuxerContext and MuxerContext.
MediaSource no longer thread-safe. It doesn't make sense to make it thread-safe as most of the time it will only be called from one thread.
Update dependencies.