• Home
Name Date Size #Lines LOC

..--

src/03-May-2024-5,2514,778

Cargo.tomlD03-May-2024193 1411

README.mdD03-May-20241.3 KiB2518

VERSIONSD03-May-2024115 54

bindgen.shD03-May-20241.2 KiB3623

build.rsD03-May-2024823 3221

README.md

1# FFmpeg wrapper
2
3This is a minimal FFmpeg 5.0 wrapper for use with the virtio-video device, allowing to run a virtual
4video device backed by software decoding or encoding. This is useful for development and testing in
5situations where no supported video acceleration is available on the host.
6
7Although several FFmpeg binding crates exist, most of them are not able to link against the system
8FFmpeg, and [the only one that does](https://crates.io/crates/ffmpeg-sys) is released under a
9software license that makes our lawyers nervous. Also they all run bindgen at build time, which is
10not possible to do under the ChromeOS build system and would require to patch the crate with fully
11generated bindings.
12
13So taking this in consideration, as well as the extra work that it is to depend on external Rust
14crates in ChromeOS, it is preferable to add our own simple bindings here that cover just the parts
15of FFmpeg that we need.
16
17This crate has minimal dependencies ; on the FFmpeg side, it just uses `libavcodec`, `libavutil` and
18`libswscale`.
19
20The bindings can be updated using the `bindgen.sh` script. A few elements that bindgen cannot
21generate because they are behind C macros are re-defined in `avutil.rs` and `error.rs`, as well as
22tests to ensure their correctness.
23
24And that's about it.
25