FFmpeg.AutoGen Documentation

repository·main·Indexed 23 days ago

https://github.com/ruslan-b/ffmpeg.autogen

Unsafe C#/.NET and Mono bindings for the FFmpeg multimedia framework. FFmpeg.AutoGen exposes the FFmpeg C API with minimal modifications for high-performance video and audio processing, utilizing CppSharp for binding generation.

Tokens
427
Snippets
2
Records
5
Agent score
32%

What's inside FFmpeg.AutoGen

  1. Configure FFmpeg library paths for macOS and Linux

    main

    On macOS and Linux, you should install FFmpeg using your system's package manager (e.g., brew install ffmpeg on macOS).

    You must set the static ffmpeg.RootPath property to the full path where the FFmpeg libraries are located.

  2. How to use FFmpeg.AutoGen for video processing

    main

    FFmpeg.AutoGen exposes the vast FFmpeg API with minimal modifications. For basic operations like video decoding, conversion, and frame extraction to JPEG, refer to the FFmpeg.AutoGen.Example project included in the repository.

    For complex operations, you should consult the official FFmpeg Documentation, specifically the API section, as the library is a direct mapping of the C API.

  3. Generate FFmpeg.AutoGen bindings using CppSharp

    main

    The bindings are generated using [CppSharp].

    Prerequisites:

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

    Steps to regenerate bindings:

    1. Run FFmpeg.AutoGen.CppSharpUnsafeGenerator;
    2. All files with the extension *.g.cs in the FFmpeg.AutoGen project will be regenerated.
    FFmpeg.AutoGen.CppSharpUnsafeGenerator;
  4. Configure FFmpeg library paths for Windows

    main

    On Windows, you must provide the x64 libraries (sourced from CODEX FFMPEG). You can use the provided download script to retrieve the required DLLs:

    .\FFmpeg\download-ffmpeg.ps1

    Refer to the FFmpeg.AutoGen.Example project to see how to correctly specify the path to these libraries in your code.

  5. Install FFmpeg.AutoGen via NuGet

    main
    FFmpeg.AutoGen provides auto-generated unsafe bindings for C#/.NET and Mono. The NuGet packages follow semantic versioning and are kept in sync with the MAJOR and MINOR versions of FFmpeg. PATCH increments are used for non-breaking API changes.