rust-av / ffms2-rs

ffms2 bindings
MIT License
10 stars 5 forks source link

Cannot build ffms2-rs on Ubuntu 24.04 #35

Open mipimipi opened 5 months ago

mipimipi commented 5 months ago

Hi, when building ffms2-rs from the latest code version of the repo, I get the following error:

   Compiling ffms2 v0.3.0 (https://github.com/rust-av/ffms2-rs#87238d72)
error[E0063]: missing fields `DolbyVisionRPU`, `DolbyVisionRPUSize`, `HDR10Plus` and 1 other field in initializer of `ffms2_sys::FFMS_Frame`
  --> /home/mipi/.cargo/git/checkouts/ffms2-rs-deffbde628fee48c/87238d7/src/utility.rs:94:30
   |
94 |                 let $param = $type {
   |                              ^^^^^ missing `DolbyVisionRPU`, `DolbyVisionRPUSize`, `HDR10Plus` and 1 other field

For more information about this error, try `rustc --explain E0063`.
error: could not compile `ffms2` (lib) due to 1 previous error

This error occurs with Ubuntu 24.04 on x86_64 and arm64. It does not occurs on Arch Linux, neither for x86_64 nor for arm64. Do you have any idea why that happens?

Thanks!

Luni-4 commented 5 months ago

Yep, the FFMpeg version is more recent than the one supported by the current version of the crate. The new ffms2 version should fix that problem, but we are currently waiting for a third-party crate to be released so that we can continue its development

mipimipi commented 5 months ago

Ok, thanks for the update. I am waiting for the new version. As workaround, I am calling the ffmsindex binary from rust, but I prefer to call FFMS2 via the bindings in ffms2-rs crate because it's more performant. Unfortunately, there are too many problems currently. Thus, I decided to go for the workaround.

Luni-4 commented 5 months ago

Yep, it's a good workaround, let's hope the third-party crate will be released soon, they are working on it

mipimipi commented 5 months ago

Which crate is it?

Luni-4 commented 5 months ago

Ok, they have just released a new version https://crates.io/crates/ffmpeg-the-third, so we can go on with the refactoring

mipimipi commented 5 months ago

BTW, since you are the maintainer of this crate you must have some knowledge in the FFmpeg area, and thus you might be able to answer a question: The only 2 things that I need about a video file for my use case are (1) a list of key frame numbers, and (2) the timestamp of each frame. Currently, I use ffmsindex to get this info. Are you aware of a more "direct" way to get this info? With "direct" I mean without using FFMS2? I tried out video-rs, for example. VBut this crate consumes quite some time to retrieve information about frames. Thanks!

Luni-4 commented 4 months ago

Actually, I've decided to port ffms2 in Rust for nearly your same reasons. It is difficult to have an accurate frame-seeking library with just a small set of APIs to do that. ffmpeg-the-third offers a series of APIs to obtain what you are looking for but you have to fiddle with them, mixing them together, and this could lead to errors.

What is video-rs?

mipimipi commented 4 months ago

What is video-rs?

video-rs is yet another FFmpeg wrapper

Luni-4 commented 4 months ago

@mipimipi

Sorry for the late reply, but I'm pretty busy in this period. If you want to speed up the release of a new ffms2-rs version, feel free to contribute to this branch https://github.com/rust-av/ffms2-rs/tree/refactor

Three things should be done in order to branch it in master and publish the new version:

You can open a pull request if you want and I can review it step by step. Feel free to rebase, squash my commits without any problem