ffmpeg-sys-next

repository·master·Indexed 42 days ago

https://github.com/zmwangx/rust-ffmpeg-sys

Low-level Rust FFI bindings to the FFmpeg C libraries. Version 9.0.0 provides unsafe bindings intended for use as a dependency for higher-level crates like ffmpeg-next, with versioning that follows FFmpeg's major and minor releases.

Tokens
745
Snippets
2
Records
3
Agent score
3%

What's inside ffmpeg-sys-next

  1. Understand the relationship between ffmpeg-sys-next and ffmpeg-next

    master

    The ffmpeg-sys-next crate provides low-level, unsafe bindings to the FFmpeg C libraries. If you are looking for a high-level, safe Rust API for FFmpeg, you should use the ffmpeg-next crate instead.

    Versioning follows FFmpeg's major and minor versions. For example, version 4.2.x of this crate supports the 4.2.x series of FFmpeg. Patch versions of this crate are used for crate-specific bug fixes and do not necessarily track FFmpeg patch versions.

  2. Use compile-time feature flags for FFmpeg version detection

    master

    In addition to standard Cargo.toml features, this crate exposes several compile-time flags based on the FFmpeg installation detected on your system. You can use these flags in your code (e.g., using #[cfg(feature = "...")]) to handle version-specific APIs or features.

    To see the full details of what the build script detects, run cargo build -vv.

    ### Available Feature Flags
    
    #### FFmpeg Version Flags
    Indicates the FFmpeg installation is at least version `<x>.<y>`. 
    Example: `ffmpeg_4_4` indicates FFmpeg version >= 4.4.
    
    - `ffmpeg_3_0` through `ffmpeg_3_4`
    - `ffmpeg_4_0` through `ffmpeg_4_4`
    - `ffmpeg_5_0`, `ffmpeg_5_1`
    - `ffmpeg_6_0`, `ffmpeg_6_1`
    - `ffmpeg_7_0`, `ffmpeg_7_1`
    - `ffmpeg_8_0`, `ffmpeg_8_1`
    - `ffmpeg_9_0`
    
    #### AVCodec Version Flags
    Indicates if the `avcodec` version is greater than a specific version.
    Example: `avcodec_version_greater_than_58_90`
    
    #### API Feature Flags
    Used to check for specific feature availability or deprecation guards.
    - `ff_api_<feature>` (e.g., `ff_api_vaapi`): Enabled if the feature's uppercase deprecation guard evaluates to true.
    - `ff_api_<feature>_is_defined` (e.g., `ff_api_vappi_is_defined`): Enabled as long as the corresponding deprecation guard is defined.
  3. Use the avutil module for FFmpeg utility functions

    master

    The avutil module provides access to FFmpeg's utility functions (avutil). These functions are exported at the crate root for convenience. Use these for common FFmpeg tasks such as memory management, math utilities, and data structure manipulation provided by the FFmpeg library.

    use ffmpeg_sys_next::avutil::*;