Installing Prerequisites¶
TL;DR¶
If you installed Shaka Streamer via pip, you already have the necessary Python dependencies. If you don’t want to use your own FFmpeg and Shaka Packager, install our prebuilt binaries with:
pip3 install shaka-streamer-binaries
The rest of this document only matters for development setup if you plan to make changes to Shaka Streamer.
Required runtime modules¶
To install required modules via Ubuntu or Debian packages:
sudo apt -y install python3-yaml python3-distro
For any platform, you can install them via pip:
pip3 install -r requirements.txt
Development modules¶
To install development modules via Ubuntu or Debian packages:
sudo apt -y install \
python3-flask python3-mypy python3-setuptools \
python3-sphinx python3-wheel
For any platform, you can install them via pip:
pip3 install -r optional_requirements.txt
Shaka Streamer Binaries package (recommended)¶
Shaka Streamer requires Shaka Packager and FFmpeg as it uses them internally.
These binaries can be installed for your platform easily with the
shaka-streamer-binaries
package:
pip3 install shaka-streamer-binaries
The static FFmpeg builds are pulled from here: https://github.com/shaka-project/static-ffmpeg-binaries
The static Shaka Packager builds are pulled from here: https://github.com/shaka-project/shaka-packager
FFmpeg builds for Ubuntu require you to install vaapi packages:
sudo apt -y install libva2 libva-drm2
Shaka Packager (manual installation, not recommended)¶
Pre-built Shaka Packager binaries can be downloaded from github here: https://github.com/shaka-project/shaka-packager/releases
To install a Shaka Packager binary on Linux:
sudo install -m 755 ~/Downloads/packager-linux \
/usr/local/bin/packager
To build Shaka Packager from source, follow instructions here: https://shaka-project.github.io/shaka-packager/html/build_instructions.html
FFmpeg (manual installation, not recommended)¶
If your Linux distribution has FFmpeg v4.1+, you can just install the package. For example, this will work in Ubuntu 19.04+:
sudo apt -y install ffmpeg
For older versions of Ubuntu or any other Linux distro which does not have a new enough version of FFmpeg, you can build it from source. For example:
sudo apt -y install \
libx264-dev libvpx-dev libopus-dev libfreetype6-dev \
libfontconfig1-dev libsdl2-dev yasm \
va-driver-all libnvidia-encode1
git clone https://github.com/FFmpeg/FFmpeg ffmpeg
cd ffmpeg
git checkout n4.1.3
./configure \
--enable-libx264 --enable-libvpx --enable-libopus \
--enable-gpl --enable-libfreetype --enable-libfontconfig
make
sudo make install
For macOS, you can either build FFmpeg from source or you can use Homebrew to install it:
brew install ffmpeg
Cloud Storage (optional)¶
Shaka Streamer can push content directly to a Google Cloud Storage or Amazon S3 bucket. To use this feature, additional Python modules are required.
See Cloud Storage for details.
Test Dependencies (optional)¶
To run the end-to-end tests, you must also install nodejs and NPM.
To install these via Ubuntu or Debian packages:
sudo apt -y install nodejs npm
To install Node.js and NPM on any other platform, you can try one of these: