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
Library linking is static by default, setting environment variable `FFMPEG_DYNAMIC_LINKING` will make rusty_ffmpeg link dynamic libraries.
16
+
17
+
#### Linux & MacOS
21
18
22
19
1. Start to prepare FFmpeg libraries:
23
-
+ If you have a pre-built ffmpeg, set `PKG_CONFIG_PATH` to the path which points to `*.pc` files in the build result(e.g. `PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" cargo build`) then this crate will use the pre-built FFmpeg libraries.
24
-
+ If no `PKG_CONFIG_PATH` is set, this crate will first check if there are `libav*-dev` installed in this system.
20
+
+ If you have a pre-built ffmpeg, set `FFMPEG_PKG_CONFIG_PATH` to the path which points to `*.pc` files in the build result(e.g. `FFMPEG_PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" cargo build`) then this crate will use the pre-built FFmpeg libraries.
21
+
+ If no `FFMPEG_PKG_CONFIG_PATH` is set, this crate will first check if there are `libav*-dev` installed in this system.
25
22
+ If the libraries exists, this crate will use them.
26
23
+ If not, it will git clone the FFmpeg from <https://github.com/ffmpeg/ffmpeg> and then configure and compile it for you.
27
24
2. After the FFmpeg libraries are ready, the build script will take advantage of the package-config(`*.pc`) files to:
@@ -30,12 +27,16 @@ Run `cargo build` to build the bindings:
30
27
31
28
So there are three ways for developers to provide FFmpeg libraries for this crate to generate bindings:
32
29
33
-
1. Provide self compiled FFmpeg by setting `PKG_CONFIG_PATH`
30
+
1. Provide self compiled FFmpeg by setting `FFMPEG_PKG_CONFIG_PATH`
34
31
2. Install FFmpeg libraries via system package manager.(Make sure they can be found by pkg-config)
35
32
3. Doesn't provide FFmpeg, waiting for this crate cloning and building a FFmpeg with some default configuration from scratch.
36
33
37
-
## Testing
34
+
### Windows
35
+
36
+
1. Install vcpkg.
37
+
2. Install FFmpeg using it with specific triplet according to your building target and rustflags. (Check [here](https://github.com/ldm0/rusty_ffmpeg/blob/bf4ee3c5c826443426d3f5c1ac6417b43fc88429/.github/workflows/ci.yml#L325)).
38
+
3. build with `VCPKG_ROOT` set to the vcpkg path, and `VCPKG_DEFAULT_TRIPLET` set to the triplet you used.
38
39
39
-
You can use `cargo test` to test the generated bindings. If you haven't run `cargo build` and you have pre-built FFmpeg libraries. Set the `PKG_CONFIG_PATH` like this: `PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" cargo test` which doesn't need to build the FFmpeg separately.
40
+
## Testing
40
41
41
-
To see it works, you can run`cargo run --example slice`.
42
+
You can use `cargo test` to test the generated bindings. Want to see it works? There is a small example for you. Run`cargo run --example slice`.
0 commit comments