shaka-project / shaka-streamer

A simple config-file based approach to preparing streaming media, based on FFmpeg and Shaka Packager.
https://shaka-project.github.io/shaka-streamer/
Apache License 2.0
199 stars 62 forks source link

Offer hermetic copies of Shaka Packager and FFmpeg #60

Closed joeyparrish closed 3 years ago

joeyparrish commented 4 years ago

Currently, users must install Shaka Packager and FFmpeg separately and system-wide in order to use Shaka Streamer.

If permitted by their licenses, we should try to bundle binaries of Shaka Packager and FFmpeg for convenience, and offer a command-line option to choose between hermetic versions and installed system versions.

See the Installing Prerequisites ​here .

mariocynicys commented 3 years ago

We decided that the best way to address this issue is to make a separate PyPi package for the hermetic binaries (FFmepg&FFprobe&Packager) and maintain the platform-specific binaries in there. If the user chooses hermetic_ffmpeg: True in the pipeline config while the separate hermetic ffmpeg binary is not installed yet, we will error prompting them to install it pip install binaries-package-name, which will install the right prebuilt static ffmpeg/ffprobe/packager for their machine based on the CPU architecture and the OS.

We will be using the static builds from this repo. We will refer to PEP 425 to choose the compatibility tags for prebuilt package distributions and this will let pip handle choosing the right package to download for each OS/CPUarch.

joeyparrish commented 3 years ago

I'm open to debate on these specifics if you disagree, but here's what I would do:

  1. The binary package should be called shaka-streamer-binaries
  2. The documentation on how to install Streamer should recommend pip install -ing both shaka-streamer and shaka-streamer-binaries
  3. Instead of a pipeline config field, the choice of hermetic binaries should be based on command-line arguments to the frontend
  4. The frontend argument could translate to a parameter on the controller node
  5. The default should be to use hermetic binaries, and a frontend argument like --use-system-binaries would switch to using ffmpeg and packager from the PATH environment variable
  6. If hermetic binaries are on, and the package hasn't been installed, there should be an explicit error message pointing out both the existence of the binary package and the command line argument to use system binaries
  7. If hermetic binaries are on, we should check the version of the binary package installed, which should match the exact version of shaka-streamer's package (since we will be shipping known-good binaries and versions that will understand the command lines we generate)
mariocynicys commented 3 years ago

Nice, can't disagree.