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

consider downloading ffmpeg and ffprobe from https://github.com/eugeneware/ffmpeg-static #19

Open
prabirshrestha opened this issue Oct 11, 2023 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@prabirshrestha
Copy link

Use https://github.com/eugeneware/ffmpeg-static as it contains both ffmpeg and ffprobe and supports lot of different OS and architectures.

Currently it uses multiple domains. Having all from github.com would be great.

/// URL for the latest published FFmpeg release. The correct URL for the target
/// platform is baked in at compile time.
pub fn ffmpeg_download_url() -> Result<&'static str> {
  if cfg!(all(target_os = "windows", target_arch = "x86_64")) {
    Ok("https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip")
  } else if cfg!(all(target_os = "linux", target_arch = "x86_64")) {
    Ok("https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz")
  } else if cfg!(all(target_os = "macos", target_arch = "x86_64")) {
    Ok("https://evermeet.cx/ffmpeg/getrelease")
  } else if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
    Ok("https://www.osxexperts.net/ffmpeg6arm.zip") // Mac M1
  } else {
    Err(Error::msg(
      "Unsupported platform; you can provide your own URL instead and call download_ffmpeg_package directly.",
    ))
  }
}
@nathanbabcock
Copy link
Owner

Great idea, I'm looking into this.

@nathanbabcock nathanbabcock added the enhancement New feature or request label Oct 11, 2023
@nathanbabcock nathanbabcock added the good first issue Good for newcomers label Oct 27, 2023
@niraj-khatiwada
Copy link

Hey @nathanbabcock I wanted to ask you about the licensing of FFMPEG. Is it legal to include static binaries of ffmpeg directly in our commercial product? I read the FFMPEG legal page but was not so sure about it. Since HypeTrigger also does similar kind of thing(including static binaries in the bundle), I wanted to ask you directly. Thanks

@nathanbabcock
Copy link
Owner

@niraj-khatiwada Great question and I'd encourage you to do your own research to be 100% sure for your own use case, but here is my understanding based on this official source: https://www.ffmpeg.org/legal.html.

  1. The core parts of FFmpeg are LGPL, which do allow for commercial use
  2. However, it may be compiled with extensions that are GPL (for example, certain proprietary codecs) which forbid commercial use

For a given FFmpeg binary, you can check which license applies to it by looking through the configuration flags that are printed out on every command, and check for --enable-gpl and/or --enable-nonfree.

As for ffmpeg-sidecar, some of the auto-downloaded binaries do include nonfree extensions (although the exact builds vary by platform). If you want to commercialize your product, you would want to replace these auto-download sources with your own custom build of FFmpeg that complies with the appropriate licensing terms. For example, if Hypetrigger introduced a paid plan in the future, we would do something similar.


As an aside — I actually think using the "sidecar" methodology offers some big advantages compared to other ways of using FFmpeg, such as static linking. In theory, you could skip bundling FFmpeg with your application entirely, and offer a step at runtime that guides the user to either download an official binary from a 3rd-party source, or provide their own. This would bypass most of the licensing constraints since you would be neither distributing nor linking against any part of the FFmpeg codebase. It would be more akin to the way a website is not bound by the licensing terms of any particular browser that opens it.

But to reiterate, if you are going to build a $10M startup that uses FFmpeg heavily, maybe check with an actual lawyer first :)

@nathanbabcock
Copy link
Owner

So to answer the question more directly:

Is it legal to include static binaries of ffmpeg directly in our commercial product?

Yes, if your app is non-commercial and you stick to an LGPL build of FFmpeg.

@niraj-khatiwada
Copy link

@niraj-khatiwada Great question and I'd encourage you to do your own research to be 100% sure for your own use case, but here is my understanding based on this official source: https://www.ffmpeg.org/legal.html.

  1. The core parts of FFmpeg are LGPL, which do allow for commercial use
  2. However, it may be compiled with extensions that are GPL (for example, certain proprietary codecs) which forbid commercial use

For a given FFmpeg binary, you can check which license applies to it by looking through the configuration flags that are printed out on every command, and check for --enable-gpl and/or --enable-nonfree.

As for ffmpeg-sidecar, some of the auto-downloaded binaries do include nonfree extensions (although the exact builds vary by platform). If you want to commercialize your product, you would want to replace these auto-download sources with your own custom build of FFmpeg that complies with the appropriate licensing terms. For example, if Hypetrigger introduced a paid plan in the future, we would do something similar.

As an aside — I actually think using the "sidecar" methodology offers some big advantages compared to other ways of using FFmpeg, such as static linking. In theory, you could skip bundling FFmpeg with your application entirely, and offer a step at runtime that guides the user to either download an official binary from a 3rd-party source, or provide their own. This would bypass most of the licensing constraints since you would be neither distributing nor linking against any part of the FFmpeg codebase. It would be more akin to the way a website is not bound by the licensing terms of any particular browser that opens it.

But to reiterate, if you are going to build a $10M startup that uses FFmpeg heavily, maybe check with an actual lawyer first :)

This was incredibly helpful Nathan. Thank you so much for your time and effort for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants