2022-06-02 02:18:48 +00:00
|
|
|
# FFmpeg wrapper
|
|
|
|
|
2023-11-14 23:37:42 +00:00
|
|
|
This is a minimal FFmpeg 5.0+ wrapper for use with the virtio-video device, allowing to run a
|
|
|
|
virtual video device backed by software decoding or encoding. This is useful for development and
|
|
|
|
testing in situations where no supported video acceleration is available on the host.
|
2022-06-02 02:18:48 +00:00
|
|
|
|
|
|
|
Although several FFmpeg binding crates exist, most of them are not able to link against the system
|
|
|
|
FFmpeg, and [the only one that does](https://crates.io/crates/ffmpeg-sys) is released under a
|
2023-11-14 23:37:42 +00:00
|
|
|
software license that makes our lawyers nervous.
|
2022-06-02 02:18:48 +00:00
|
|
|
|
|
|
|
So taking this in consideration, as well as the extra work that it is to depend on external Rust
|
2022-12-29 21:24:33 +00:00
|
|
|
crates in ChromeOS, it is preferable to add our own simple bindings here that cover just the parts
|
2022-06-02 02:18:48 +00:00
|
|
|
of FFmpeg that we need.
|
|
|
|
|
|
|
|
This crate has minimal dependencies ; on the FFmpeg side, it just uses `libavcodec`, `libavutil` and
|
|
|
|
`libswscale`.
|
|
|
|
|
2023-11-14 23:37:42 +00:00
|
|
|
A few elements that bindgen cannot generate because they are behind C macros are re-defined in
|
|
|
|
`avutil.rs` and `error.rs`, as well as tests to ensure their correctness.
|
2022-06-02 02:18:48 +00:00
|
|
|
|
|
|
|
And that's about it.
|