Installing Prerequisites¶
Yaml Module (required for development only)¶
We use the Python “yaml” module to parse config files. If you install Shaka
Streamer via pip3
, then this dependency will be installed for you
automatically. If you got Shaka Streamer source from GitHub, you will need to
install the module separately.
To install it on Ubuntu:
sudo apt -y install python3-yaml
This can also be installed via pip3
on any platform:
# To install/upgrade globally (drop the "sudo" for Windows):
sudo pip3 install --upgrade pyyaml
# To install/upgrade per-user:
pip3 install --user --upgrade pyyaml
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/joeyparrish/static-ffmpeg-binaries
The static Shaka Packager builds are pulled from here: https://github.com/google/shaka-packager
Shaka Packager (manual installation, not recommended)¶
Pre-built Shaka Packager binaries can be downloaded from github here: https://github.com/google/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://google.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, the Google Cloud SDK is required.
See https://cloud.google.com/sdk/install for details on installing the Google Cloud SDK on your platform.
Google Cloud Storage¶
If you haven’t already, you will need to initialize your gcloud environment and log in through your browser.
gcloud init
Follow the instructions given to you by gcloud to initialize the environment and login.
Amazon S3¶
To authenticate to Amazon S3, you can either add credentials to your boto config file or login interactively using the AWS CLI.
Test Dependencies (optional)¶
To run the end-to-end tests, you must install Flask and NPM. In Ubuntu 19.04+:
sudo apt -y install python3-flask nodejs npm
# Upgrade to a recent npm, which is not packaged:
sudo npm install -g npm
Flask can also be installed via pip3
on any platform:
# To install/upgrade globally (drop the "sudo" for Windows):
sudo pip3 install --upgrade flask
# To install/upgrade per-user:
pip3 install --user --upgrade flask
To install Node.js and NPM on any other platform, you can try one of these: