Skip to content

Commit 19f159e

Browse files
committed
Update readme
1 parent ff636ff commit 19f159e

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,21 @@
44
[![Crates.io](https://img.shields.io/crates/v/rusty_ffmpeg.svg)](https://crates.io/crates/rusty_ffmpeg)
55
[![Doc](https://docs.rs/rusty_ffmpeg/badge.svg)](https://docs.rs/rusty_ffmpeg)
66

7-
FFI bindings for FFmpeg inner libraries. This is a crate that:
7+
Cross platform FFI bindings for FFmpeg inner libraries. This is a crate that:
88
1. Generates Rust binding for FFmpeg libraries which can be used directly.
99
2. Emits specific cargo metadata for linking FFmpeg libraries.
1010

1111
## Building
1212

13-
### Prerequisites
14-
15-
1. Linux environment.
16-
2. Rust environment([Install](https://www.rust-lang.org/tools/install)).
17-
1813
### Generate and build the bindings:
1914

20-
Run `cargo build` to build the bindings:
15+
Library linking is static by default, setting environment variable `FFMPEG_DYNAMIC_LINKING` will make rusty_ffmpeg link dynamic libraries.
16+
17+
#### Linux & MacOS
2118

2219
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.
2522
+ If the libraries exists, this crate will use them.
2623
+ If not, it will git clone the FFmpeg from <https://github.com/ffmpeg/ffmpeg> and then configure and compile it for you.
2724
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:
3027

3128
So there are three ways for developers to provide FFmpeg libraries for this crate to generate bindings:
3229

33-
1. Provide self compiled FFmpeg by setting `PKG_CONFIG_PATH`
30+
1. Provide self compiled FFmpeg by setting `FFMPEG_PKG_CONFIG_PATH`
3431
2. Install FFmpeg libraries via system package manager.(Make sure they can be found by pkg-config)
3532
3. Doesn't provide FFmpeg, waiting for this crate cloning and building a FFmpeg with some default configuration from scratch.
3633

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.
3839

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
4041

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

Comments
 (0)