bumblebee icon indicating copy to clipboard operation
bumblebee copied to clipboard

use `xav` instead of `ffmpeg`

Open kevinschweikert opened this issue 1 year ago • 5 comments

The xav library is a wrapper around the libav libs, from which FFmpeg is built. The nice thing is, that this compiles these libav functions to a NIF, so that you don't need FFmpeg installed on your computer.

There are two prerequisites until this could be merged:

  1. the xav library could precompile the NIF so we get a real benefit from this change. Otherwise, we just make it harder for the user to install the development packages (Install instructions from xav) instead of the normal FFmpeg binary
  2. xav needs to update nx so we can merge. I've already opened a PR https://github.com/elixir-webrtc/xav/pull/19. To test this branch, i temporarily set override: true on the nx dependency

kevinschweikert avatar Oct 22 '24 22:10 kevinschweikert

@kevinschweikert thanks for the PR! Dropping the ffmpeg dependency would be great, but yeah, I agree that we need xav to be precompiled for this to be beneficial.

jonatanklosko avatar Oct 23 '24 04:10 jonatanklosko

Sounds good to me!

jonatanklosko avatar Oct 23 '24 05:10 jonatanklosko

Awesome idea! I will bring back the ffmpeg implementation when xav is not available. Thanks for the feedback and suggestions!

kevinschweikert avatar Oct 23 '24 11:10 kevinschweikert

I've just realised that it's not just about precompilation, the main blocker is that xav still requires ffmpeg to be installed, so at the moment there is no benefit really (perhaps a tiny bit less overhead, because we don't need System.cmd, but I think that's fine). So I think what we need is xav having the necessary ffmpeg C code vendored, and then ideally precompilation.

jonatanklosko avatar Oct 23 '24 11:10 jonatanklosko

Precompiling FFmpeg is not an easy task as it has so many other dependencies. I agree that until Xav solves this problem, it's better for Bumblebee to stay with the current solution

mickel8 avatar Oct 23 '24 14:10 mickel8