#audio-video #ffmpeg #codec #multimedia #pixel-format

ac-ffmpeg

Simple and safe Rust interface for FFmpeg libraries

13 releases

0.18.1 Jan 6, 2023
0.17.4 May 17, 2022
0.17.3 Mar 8, 2022
0.17.1 Sep 6, 2021
0.15.5 Oct 29, 2020

#131 in Video

Download history 164/week @ 2024-07-22 152/week @ 2024-07-29 34/week @ 2024-08-05 61/week @ 2024-08-12 46/week @ 2024-08-19 63/week @ 2024-08-26 39/week @ 2024-09-02 54/week @ 2024-09-09 29/week @ 2024-09-16 162/week @ 2024-09-23 115/week @ 2024-09-30 62/week @ 2024-10-07 29/week @ 2024-10-14 37/week @ 2024-10-21 29/week @ 2024-10-28 67/week @ 2024-11-04

170 downloads per month
Used in 4 crates (3 directly)

MIT license

250KB
6.5K SLoC

Rust 5K SLoC // 0.0% comments C 1.5K SLoC // 0.0% comments

Rust wrapper for FFmpeg libraries

Crates.io MIT licensed Build Status

This library provides a Rust interface for FFmpeg libraries. Rather than supporting all FFmpeg features, we focus on safety and simplicity of the interface.

Supported features

  • Demuxing any self-contained media container
  • Muxing any self-contained media container
  • Setting metadata
  • Seeking
  • Decoding audio and video
  • Encoding audio and video
  • Video frame scaling and pixel format transformations
  • Audio resampling
  • Bitstream filters

Requirements

  • FFmpeg v4.x or v5.x libraries. The following libraries are required:
    • libavutil
    • libavcodec
    • libavformat
    • libswresample
    • libswscale

Compilation

The following env. variables can be used to set correct paths to FFmpeg header files and libraries:

  • FFMPEG_INCLUDE_DIR - path to the FFmpeg header files
  • FFMPEG_LIB_DIR - path to the FFmpeg libs

If you require building for multiple platforms, you can append _PLATFORM_TARGET_TRIPLET to both of the above to create platform specific env. variables, for example:

  • FFMPEG_INCLUDE_DIR_AARCH64_LINUX_ANDROID = ${jniInclude}/arm64-v8a/
  • FFMPEG_LIB_DIR_AARCH64_LINUX_ANDROID = ${jniLibs}/arm64-v8a/
  • FFMPEG_INCLUDE_DIR_X86_64_LINUX_ANDROID = ${jniInclude}/x86_64/
  • FFMPEG_LIB_DIR_X86_64_LINUX_ANDROID = ${jniLibs}/x86_64/

If you prefer static linking, you can force it using:

  • FFMPEG_STATIC=1

License

Even though this library is distributed under the MIT license, the FFmpeg project has its own license policies that need to be respected. See https://ffmpeg.org/legal.html for more details.

Dependencies

~6–295KB