Skip to content

Source of the Shaka Player History live stream

License

Notifications You must be signed in to change notification settings

shaka-project/shaka-player-history

Repository files navigation

Shaka Player History

This is the source of the Shaka Player History live stream. It is a dynamically-generated video stream with a visualization of Shaka Player's commit history. The stream loops forever, and the contents of each iteration of the loop get longer as more commits are added to Shaka Player.

The video frames are generated by an open-source tool called Gource.

The audio of the stream is a loop of 24 solo piano works by J.S. Bach. See sources/bach/#readme for details.

The full stream is encoded with FFmpeg and packaged into DASH and HLS by Shaka Packager. These two tools are orchestrated by Shaka Streamer, which also uploads the output to Google Cloud Storage.

The live streams are publicly accessible:

Click here to play instantly in Shaka Player.

Nota Bene

This is published in the hopes that it is at least interesting, if not useful to people outside of the Shaka family. It's also nice for us to have the details of this stream formalized and revision-controlled. That said, if you want to fork it or run your own instances, please go ahead!

Note that before you install or run this, we have hard-coded certain details that you might want to adjust if you fork this to upload to another location or to visualize another repository:

  • scripts/update-git.sh and sources/pre-release.log hard-code the repo URL https://github.com/shaka-project/shaka-player and certain pre-historical details about Shaka Player
  • scripts/rename-aliases.sh and sources/user-images are specific to Shaka Player committers
  • sources/title.txt mentions Shaka Player
  • launch-streamer.sh hard-codes the output bucket gs://shaka-live-assets/

Service Installation

# Create an unpriveleged user
sudo adduser \
  --quiet \
  --system \
  shaka-player-history \
  --home /opt/shaka-player-history \
  --no-create-home

# Install this repo to /opt/shaka-player-history
git clone https://github.com/shaka-project/shaka-player-history
sudo mv shaka-player-history /opt/shaka-player-history

# Make this owned by the unpriveleged user
sudo chown -R shaka-player-history /opt/shaka-player-history

# Give the unpriveleged user access to your hardware encoder
# One of these groups might work, depending on your distro
sudo usermod -a -G video shaka-player-history || true
sudo usermod -a -G render shaka-player-history || true

# Install dependencies
sudo apt -y install gource xvfb apt-transport-https ca-certificates gnupg curl
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt -y update && sudo apt -y install google-cloud-cli
sudo apt -y install python3-yaml python3-distro
sudo python3 -m pip install --upgrade shaka-streamer shaka-streamer-binaries google-cloud-storage || \
sudo python3 -m pip install --upgrade --break-system-packages shaka-streamer shaka-streamer-binaries google-cloud-storage

# Set up Google Cloud credentials with access to your output bucket
sudo su shaka-player-history -s /bin/bash -c 'gcloud init'
sudo su shaka-player-history -s /bin/bash -c 'gcloud auth application-default login'

# Install the service
sudo install -m 0644 /opt/shaka-player-history/shaka-player-history.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start shaka-player-history

Checking Service Logs

journalctl -axefu shaka-player-history.service

You can see the uptime of the stream after "time=", and if everything is healthy and keeping up with real time, you should see status ending with "1x". Ex:

frame=112832 fps= 25 q=19.0 q=21.0 q=-0.0 q=-0.0 q=35.0 q=31.0 size= 1092696KiB time=01:15:11.12 bitrate=1984.3kbits/s speed=   1x

About

Source of the Shaka Player History live stream

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages