Skip to content

Commit 235fe83

Browse files
committed
Better documentation
1 parent 14b76cb commit 235fe83

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,31 @@ Cross platform FFI bindings for FFmpeg inner libraries. This is a crate that:
1414

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

17-
### Simplest:
17+
### The simplest usage:
1818

19-
Build ffmpeg staticly and set `FFMPEG_PKG_CONFIG_PATH` to the path of the generated FFmpeg package-config files. And you don't need to set other environment variables for static linking.
19+
#### *nix
2020

21-
### More complex
21+
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.
2222

23-
You need to set environment variable for both linking and generating bindings.
23+
(Hint: set `FFMPEG_PKG_CONFIG_PATH` to some placeholder value will let `rusty_ffmpeg` probing system library.)
24+
25+
#### Windows
26+
27+
Set no environment variable, then `rusty_ffmpeg` will help you download, compile and statically linking FFmpeg using `vcpkg`.
28+
29+
### Fine-grained usage:
30+
31+
You need to set environment variables for both linking and binding generating procedure.
2432

2533
#### To link:
2634

27-
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.)
35+
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.)
2836

29-
2. Static linking with prebuilt staticlib: or set `FFMPEG_LIB_DIR` to the path of the FFmpeg prebuilt libs directory.
37+
2. Static linking with pre-built staticlib: Set `FFMPEG_LIB_DIR` to the path of the FFmpeg pre-built libs directory.
3038

3139
#### To generate bindings:
3240

33-
1. Compile-time binding generation(requires clang dylib): Set `FFMPEG_INCLUDE_DIR` to the path to the header files for binding generation.
41+
1. Compile-time binding generation([requires the `Clang` dylib](https://github.com/KyleMayes/clang-sys/blob/c9ae24a7a218e73e1eccd320174349eef5a3bd1a/build.rs#L23)): Set `FFMPEG_INCLUDE_DIR` to the path to the header files for binding generation.
3442

3543
2. Use pre-built binding: Set `FFMPEG_BINDING_PATH` to the prebuilt binding file.
3644

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ fn static_linking(env_vars: &EnvVars) {
305305
if let Some(ffmpeg_binding_path) = env_vars.ffmpeg_binding_path.as_ref() {
306306
use_prebuilt_binding(ffmpeg_binding_path, output_binding_path);
307307
} else if let Some(ffmpeg_include_dir) = env_vars.ffmpeg_include_dir.as_ref() {
308-
// If use ffmpeg_pkg_config_path with ffmpeg_include_dir, prefer usinig the user given dir rather than pkg_config_path.
308+
// If use ffmpeg_pkg_config_path with ffmpeg_include_dir, prefer using the user given dir rather than pkg_config_path.
309309
generate_bindings(Some(ffmpeg_include_dir), HEADERS.iter().cloned())
310310
.expect("Binding generation failed.")
311311
.write_to_file(output_binding_path)

0 commit comments

Comments
 (0)