# ff-sys

Low-level FFmpeg FFI bindings generated by bindgen. Not intended for direct use; use the higher-level `ff-*` crates instead.

> **Project status (as of 2026-04-28):** The library foundation is in place. Development is currently focused on [**avio-editor-demo**](https://github.com/itsakeyfut/avio-editor-demo), a real-world video editing application built on `avio`. Building the demo surfaces bugs and drives API improvements in this library. Questions, bug reports, and feature requests are welcome — see the [main repository](https://github.com/itsakeyfut/avio) for full context.

## Installation Prerequisites

Before building any crate in this workspace, FFmpeg development libraries must be available on your system.

### Windows

Install FFmpeg via [vcpkg](https://github.com/microsoft/vcpkg):

```sh
vcpkg install ffmpeg:x64-windows
```

Set the `VCPKG_ROOT` environment variable to your vcpkg installation directory, then pass the toolchain file to Cargo via `RUSTFLAGS` or `.cargo/config.toml`.

### Linux

```sh
sudo apt install libavcodec-dev libavformat-dev libavfilter-dev \
                 libavdevice-dev libswscale-dev libswresample-dev
```

### macOS

```sh
brew install ffmpeg
```

## Platform Support

| Platform | Method            | Notes                                   |
|----------|-------------------|-----------------------------------------|
| Windows  | vcpkg             | `ffmpeg:x64-windows` triplet required   |
| Linux    | apt / system libs | Dev packages (`-dev`) must be installed |
| macOS    | Homebrew          | `brew install ffmpeg`                   |

## Wrapper Modules

In addition to the raw bindgen output, `ff-sys` ships thin safe-wrapper modules that isolate the most error-prone FFmpeg call sequences:

| Module       | Wraps                                      |
|--------------|--------------------------------------------|
| `avcodec`    | `AVCodecContext`, codec open/close         |
| `avformat`   | `AVFormatContext`, demux/mux lifecycle     |
| `swscale`    | `SwsContext`, pixel format conversion      |
| `swresample` | `SwrContext`, sample format / channel layout conversion |

These modules are `pub(crate)` to the workspace and are not part of the public API surface.

## MSRV

Rust 1.93.0 (edition 2024).

## License

MIT OR Apache-2.0
