Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 2.68 KB

README.md

File metadata and controls

51 lines (38 loc) · 2.68 KB

BillardCam 🎱

This project runs on a RaspberryPi with a connected Raspberry Pi HQ Camera equipped with a 130 Degree M12 lens by Arducam (or any other compatible lens with enough fov to cover the table).

It is currently mounted with 3D printed parts in the lamp above my Billard table. This project allows me to stream the gameplay happening on the table to online services (at the moment twitch but potentially also youtube or others supporting rtmp streaming). With this project no cool shot will ever be missed because you can create clips of every moment after it happened.

It's always running continous recording so you can always record clips to your sd card and while your streaming twitch clips will be created if you wish to save a shot.

The streaming can be started/stopped via a web interface or via a REST-API with an apiKey. Clips can also be created via the web interface or a GET api request. For twitch clips to be created you have to log into the web interface with your broadcaster twitch account at least once for it to save the oauth tokens.

You can also combine the REST-API with e.g. ifft to create clips by yelling at Alexa.

Getting started

  1. Make python3 virtualenv virtualenv -p python3 venv
  2. Activate it source venv/bin/activate
  3. Install requirements.txt via pip install -r ./requirements.txt
  4. Copy config.py.example to config.py and enter your twitch stream and api_key
  5. Run dev flask server via python ./app.py

Autostart on boot

  1. Create service via: sudo systemctl --force --full edit billardcam.service and paste
[Unit]
Description=Starts control server to stream billard and save clips
After=network.target

[Service]
ExecStart=/home/pi/billardCamProject/venv/bin/python /home/pi/billardCamProject/app.py
User=pi
Group=pi

[Install]
WantedBy=multi-user.target

(Maybe you have to edit the paths to your virtual-environment and the app.py file if you cloned the repo to a different path)

  1. Reload services via sudo systemctl daemon-reload
  2. Enable autostart of service: sudo systemctl enable billardcam.service

Security

This app saves unencrypted access key to your broadcaster twitch account to disk. This is a security risk. Only install on machines you and only you fully control be aware of this risk.