Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up our dav1d-rs/rav1d forks #7575

Closed
emilk opened this issue Oct 3, 2024 · 2 comments
Closed

Clean up our dav1d-rs/rav1d forks #7575

emilk opened this issue Oct 3, 2024 · 2 comments
Labels
dependencies concerning crates, pip packages etc 🧑‍💻 dev experience developer experience (excluding CI) 🎞️ video

Comments

@emilk
Copy link
Member

emilk commented Oct 3, 2024

History

In the beginning there was dav1d; a C-library for decoding AV1 video.

dav1d-rs are bindings for the C-library dav1d, so one can use dav1d from Rust.

rav1d is a Rust-port of dav1d. Despite being written in Rust, it does not have a Rust API (memorysafety/rav1d#1252). It only provides a C API (so it can be a drop-in replacement for dav1d`).

We want to be pure Rust as far as possible, so we would prefer not to use dav1d, and instead use rav1d.

@jprochazk put together https://github.com/rerun-io/rav1d-rs to solve this. It is a fork of BOTH rav1d AND dav1d-rs.

In essence, rav1d-rs gets dav1d-rs to talk to rav1d instead of dav1d, making the whole things pure Rust (except for some asm in rav1d).

Now, this is all very confusing, so just to iterate:

  • dav1d: C library to decode AV1 (we don't want this)
  • rav1d: Rust library to decode AV1
  • dav1d-rs: Rust binding for dav1d
  • rav1d-rs: Our Rust bindings for rav1d

Options

  • Option 1: keep working on rav1d-rs
  • Option 2: add proper Rust bindings to rav1d instead (fork and upstream)

Option 1: keep working on rav1d-rs

https://github.com/rerun-io/rav1d-rs is a bit of a mess:

  • It is a fork of dav1d-rs
  • It also has a full copy of the rav1s source code (why? can we use the published crate instead?)
  • It's unclear what parts of dav1d-rs and rav1d has been modified in rav1d-rs
  • It has a bunch of big video test files that we should move to git lfs and rewrite history

I'd like to:

Option 2: fork rav1d and add Rust bindings to it

We can fork rav1d and add Rust bindings to it, i.e. do:

I don't know how much work this would be, but this definitely would be the nicest route (though not necessarily the easiest). We could upstream the fix, or keep using our own fork if they are not welcomed (or merged/published quick enough).

@emilk emilk added 🧑‍💻 dev experience developer experience (excluding CI) dependencies concerning crates, pip packages etc 🎞️ video labels Oct 3, 2024
@emilk
Copy link
Member Author

emilk commented Oct 3, 2024

Good news everyone! I took @jprochazk's code and just added it to rav1d, and it works:

memorysafety/rav1d#1362

This means we don't need our hacky https://github.com/rerun-io/rav1d-rs

Instead we either get the above PR merged, or we publish our own rav1d fork.

@emilk
Copy link
Member Author

emilk commented Oct 4, 2024

@emilk emilk closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies concerning crates, pip packages etc 🧑‍💻 dev experience developer experience (excluding CI) 🎞️ video
Projects
None yet
Development

No branches or pull requests

1 participant