Giter Club home page Giter Club logo

rusty_ffmpeg's Introduction

Rusty FFmpeg

Doc Crates.io Downloads CI

Cross platform FFI bindings for FFmpeg inner libraries. This is a crate that:

  1. Linking FFmpeg libraries for you.
  2. Generates Rust binding for FFmpeg libraries.

Getting started:

To use this crate, you need to set several environment variables.

The simplest usage:

*nix

Build ffmpeg statically and set FFMPEG_PKG_CONFIG_PATH to the path of the generated FFmpeg pkg-config files. And you don't need to set other environment variables for static linking.

(Hint: setting FFMPEG_PKG_CONFIG_PATH to some placeholder value will leave a rusty_ffmpeg probing system library.)

Windows

rusty_ffmpeg can link FFmpeg using vcpkg. Install vcpkg, check documentation of the vcpkg crate for the environment variables to set, then it works.

Fine-grained usage:

You need to set several environment variables for both linking and binding generating procedures.

To link:

  1. Dynamic linking with pre-built dylib: Set FFMPEG_DLL_PATH to the path of dll or so. (Windows: Put corresponding .lib file next to the .dll file.)

  2. Static linking with pre-built staticlib: Set FFMPEG_LIBS_DIR to the path of the FFmpeg pre-built libs directory.

To generate bindings:

  1. Compile-time binding generation(requires the Clang dylib): Set FFMPEG_INCLUDE_DIR to the path to the header files for binding generation.

  2. Use your pre-built binding: Set FFMPEG_BINDING_PATH to the pre-built binding file. The pre-built binding is usually copied from the OUT_DIR of the compile-time binding generation, by using it you don't need to regenerate the same binding file again and again.

Linking FFmpeg installed by package manager on (*nix)

You can enable system-wide FFmpeg linking by enabling feature link_system_ffmpeg.

Attention

FFI is not that easy, especially when you are dealing with a big old C project. Don't feel depressed when there are some problems. The CI check already has some typical ffmpeg compilation and use cases for you to check. File an issue if you still have any problem.

rusty_ffmpeg's People

Contributors

ldm0 avatar cfsmp3 avatar prateekmedia avatar tusharxoxoxo avatar nxtn-staged avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.