FFmpeg_droidFix.AutoGen 8.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FFmpeg_droidFix.AutoGen --version 8.1.0
                    
NuGet\Install-Package FFmpeg_droidFix.AutoGen -Version 8.1.0
                    
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="FFmpeg_droidFix.AutoGen" Version="8.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FFmpeg_droidFix.AutoGen" Version="8.1.0" />
                    
Directory.Packages.props
<PackageReference Include="FFmpeg_droidFix.AutoGen" />
                    
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 FFmpeg_droidFix.AutoGen --version 8.1.0
                    
#r "nuget: FFmpeg_droidFix.AutoGen, 8.1.0"
                    
#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 FFmpeg_droidFix.AutoGen@8.1.0
                    
#: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=FFmpeg_droidFix.AutoGen&version=8.1.0
                    
Install as a Cake Addin
#tool nuget:?package=FFmpeg_droidFix.AutoGen&version=8.1.0
                    
Install as a Cake Tool

What changed from original project:

As very beginning of making projectFrameCut, I selected this library to implement AV decoding/encoding, etc. because this thing can let me call FFmpeg and read out frame directly, by all C# Managed code, save my time and increase the speed. Also the alternative choice FFmpegKit has been discontinued at that time, and I don't want to take this risk of using something has no longer be maintainced.

When I'm trying to test projectFrameCut on Android, while I try to call this library on the Android platform, I found that I kept receiving the "PlatformNotSupportedException" error. After some diagnosis, I discovered that it was caused by the changes in .NET 5+ to System.OSPlatform. So that I fixed this file by use the modern System.OperatingSystem API, also I added a Function Resolver for Android. Finally this is fixed in the upstream repo

But, I found this is not the only problem while running on Android devices. After this fix, I start receive a "DllImportException" when I try to call the library, after days of fix, I finally discover why: "libdl.so.2" isn't exists on Android devices, and dlopen moved to "libc.so" instead of libdl. I also added a user-friendly exception processing telling why libraries failed to load.

I also added a property AddVersionSuffixToLibraryPaththat allows you to manually disable adding a version suffix to library names when attempting to load a library. This can resolve issues where certain platforms remove the version suffix when packaging the application.

This fork is fully compatible with the original FFmpeg.AutoGen library (8.0.0 branch).

By the way, I also implement the support of .NET's Native AOT support this fork.

NuGet Version get the fork here

Important Announcement

This project is undergoing a transition to a semi-managed model over the coming months.

  • All existing packages and versions will continue to work - there will be no breaking changes to existing functionality
  • The project is now MIT licensed (changed from LGPL) - see LICENSE.txt for details
  • Contributions are welcome! If you'd like to help with the project, please feel free to contribute
  • The FFmpeg binaries continue to be distributed with their original licenses from the source

Founder & Maintainer: Ruslan Balanukhin (Rationale One)

For questions and support, please continue using stackoverflow.com or the questions repository.


Important

The FFmpeg API is vast and complex and this project exposes it with minimum modifications - support is very limited. Please consider to ask how to questions on stackoverflow.com or in special repository on github.com. The community may be able to offer some assistance but you will largely be on your own. As another option you can search for a solution in C(lang) as with some effort you can convert it to C#. Here repository with C# converted examples: https://github.com/stjeong/ffmpeg_autogen_cs

FFmpeg.AutoGen

main nuget

FFmpeg auto generated unsafe bindings for C#/.NET and Mono.

Usage

You may check to example project it shows how specify path to libraries, anc call these libraries like decode video, convert it and extract frames to jpeg.

The basic example of the library usage: video decoding, conversion and frame extraction to jpeg is included in FFmpeg.AutoGen.Example project.
For the more sophisticated operations please refer to offical ffmpeg Documentation expecially API section of it. Nuget packages version uses semantic versioning and in sync with MAJOR and MINOR version of FFmpeg as PATCH incremets does not changing API.

  • on Windows:
    Native ffmpeg libraries are NOT pre bundled in this repository, not like the origin build. Obtain the binary by yourself, either by downloading from ffmpeg official website or by compiling it by yourself.

    Set ffmpeg.RootPath to manual specify the path to the directory where the FFmpeg libraries are located.

    Othwerwise the library will try to load them from the AppDomain.CurrentDomain.BaseDirectory.

  • on OSX(macOS):

    This library's MacOS usage mostly only works in Console/Avalonia application (untested, but maybe work if you don't use MAUI as backend) , not MacCatalyst

    Install ffmpeg via Homebrew (brew install ffmpeg) or download the assets from ffmpeg official website and put them in your project

    Then set static ffmpeg.RootPath = with full path to FFmpeg libraries.

  • on iOS/iPadOS/TvOS/WatchOS/VisionOS/MacCatalyst, etc. (.NET MAUI):

    Currently not implemented yet.

    But you may try implement a IFunctionResolver by yourself, and set DynamicallyLoadedBindings.FunctionResolver to it.

  • on Android (.NET MAUI): Follow these steps to use this library on Android:

    1. add these code to any place in your app (suggested in MauiProgram.cs) before you call any FFmpeg functions:
    #if ANDROID
    ffmpeg.RootPath = Android.App.Application.Context.ApplicationInfo.NativeLibraryDir;
    JavaSystem.LoadLibrary("c");
    #endif
    
    1. Then, create a directory inside <your .NET MAUI project root path>/Platforms/Android/, name it whatever you want. Create a folder named same as the FFmpeg libraries' ABI name (like arm64-v8a) your get/compile inside the folder your created. Put all .so files inside it, don't add any suffix or prefix.

    2. Add these things to the project's .csproj file:

    <ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
            <AndroidNativeLibrary Include="Platforms\Android\<name of the directory your named>\**\*.so" />
    </ItemGroup>
    

    Don't forget to replace <name of the directory your named> to the name of the directory your named in 2nd step.

    Your project's file structure should like this:

    .
    |   
    |
    \---Platforms
        +---Android
        |   |   ......
        |   |
        |   +---Assets
        |   +---ffmpeg
        |   |   \---arm64-v8a
        |   |           libavcodec.so
        |   |           libavfilter.so
        |   |           libavformat.so
        |   |           libavutil.so
        |   |           libswresample.so
        |   |           libswscale.so
        |   |
        |   +---Resources
        |   ......
        |
    ......
    
  • on Linux:
    Use your package manager of choice, or download the assets from ffmpeg official website and put them in your project.

    Similar to Windows, set ffmpeg.RootPath to manual specify the path to the directory where the FFmpeg libraries are located.

    Othwerwise the library will try to load them from the AppDomain.CurrentDomain.BaseDirectory.

Generation

The bindings generator uses CppSharp.

Prerequisites:

  • Visual Studio 2022 with C# and C++ desktop development workloads and Windows SDK for desktop.

Steps to generate:

  • Run FFmpeg.AutoGen.CppSharpUnsafeGenerator;
  • All files with extension *.g.cs in FFmpeg.AutoGen project will be regenerated.

License

Copyright © 2025 Ruslan Balanukhin (Rationale One)
All rights reserved.

Distributed under the MIT License.
See LICENSE.txt for full license text.

Note: FFmpeg binaries are distributed under their original licenses (GPL/LGPL) from the source. Please refer to FFmpeg License for details.

The fork is created by hexadecimal0x12e. Copyright © 2025-2026 hexadecimal0x12e. All rights reserved.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

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
8.1.0.1 112 4/19/2026
8.1.0 96 4/18/2026
8.0.0 434 11/19/2025
7.1.1 203 10/14/2025