nathanbabcock / ffmpeg-sidecar

Wrap a standalone FFmpeg binary in an intuitive Iterator interface. 🏍
MIT License
195 stars 11 forks source link

difference with rust-ffmpeg? #34

Open louis030195 opened 1 week ago

louis030195 commented 1 week ago

hey i'm curious what is the difference with rust-ffmpeg:

https://github.com/zmwangx/rust-ffmpeg

? I'm using rust-ffmpeg atm in https://github.com/louis030195/screen-pipe but might be open to change because of the download feature etc. quite pain to package ffmpeg for deployment

what do you think are pros and cons?

nathanbabcock commented 1 week ago

Hey Louis,

The biggest difference is that rust-ffmpeg statically links against FFmpeg's source code library and libav directly. That means a lot of FFI, extern "C" stuff and whatnot. Compiling your program becomes a lot more involved, because you need an entire C toolchain in addition to what's required by Rust itself. I tried going down this route on Windows, and it was such a headache that it was one of the main motivations behind this crate.

Under the hood, ffmpeg-sidecar does everything through the FFmpeg CLI binary, the same way you might do it from the command line. You can think of it as just a wrapper around Rust std::Command and a bunch of helper functions for processing I/O. That means you can just ship with standard FFmpeg binaries if you want (or even have your users download them at runtime from an official source). As a bonus, since you aren't linking with FFmpeg's licensed source code, you can avoid a lot of the licensing restrictions that apply to the GPL-licensed parts of FFmpeg.