You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cross platform FFI bindings for FFmpeg inner libraries. This is a crate that:
8
-
1. Generates Rust binding for FFmpeg libraries which can be used directly.
9
-
2. Emits specific cargo metadata for linking FFmpeg libraries.
10
8
11
-
## Building
9
+
1. Linking FFmpeg libraries for you.
10
+
2. Generates Rust binding for FFmpeg libraries.
12
11
13
-
### Generate and build the bindings:
12
+
##Usage
14
13
15
-
1. Set(always) `FFMPEG_INCLUDE_DIR` to the path to the header files for generating bindings.
14
+
To use this crate, you need to set several environment variables.
16
15
17
-
2. Set `FFMPEG_DLL_PATH` for dynamic linking with `dll` or `so`. (Windows: Put corresponding `.lib` file next to the `.dll` file.)
16
+
### To link:
18
17
19
-
3.Set `FFMPEG_PKG_CONFIG_PATH` for static linking with `pkg-config` files.
18
+
1. Dynamic linking with prebuilt dylib: Set `FFMPEG_DLL_PATH` to the path of `dll` or `so`. (Windows: Put corresponding `.lib` file next to the `.dll` file.)
20
19
21
-
4.Set `FFMPEG_LIBS_DIR` for static linking with static libs.
20
+
2. Static linking with prebuilt staticlib: Set `FFMPEG_PKG_CONFIG_PATH` to the path of the FFmpeg package-config files or set `FFMPEG_LIB_DIR` to the path of the FFmpeg prebuilt libs directory.
22
21
23
-
FFMPEG_INCLUDE_DIR=${HOME}/ffmpeg_build/include FFPEG_LIBS_DIR=${HOME}/ffmpeg_build/lib cargo run --example slice
24
-
FFMPEG_INCLUDE_DIR=${HOME}/ffmpeg_build/include FFMPEG_PKG_CONFIG_PATH=${HOME}/ffmpeg_build/lib/pkgconfig cargo run --example slice
22
+
### To generate bindings:
23
+
24
+
1. Compile-time binding generation(requires clang dylib): Set `FFMPEG_INCLUDE_DIR` to the path to the header files for binding generation.
25
+
26
+
2. Use pre-built binding: Set `FFMPEG_BINDING_PATH` to the prebuilt binding file.
27
+
28
+
### Attention
29
+
30
+
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 have some typical use cases, you can check it. File an issue if you still have some problem.
0 commit comments