See https://www.martin-riedl.de/2018/08/24/using-ffmpeg-as-a-hls-streaming-server-part-1/ https://www.martin-riedl.de/2018/08/24/using-ffmpeg-as-a-hls-streaming-server-part-2/ as `stream.sh` are based on that.
To run this yourself, get this source code. As the project currently exists you might need to change some things:
* If you're on Windows `stream.sh` will be wrong for you and so will all the fonts in `app.py`.
* If you're on macOS `stream.sh` might need to be changed a bit and you might not have the fonts in `app.py`.
* If you're on Linux `stream.sh` will probably be alright but you might not have all the fonts in `app.py`.
Lots of the stuff in `app.py` and `stream.sh` should at some point be moved into a configuration file that you can edit more easily.
Assuming you've dealt with that, this is what you have to do.
### FFmpeg
Go to the project root and type `sh stream.sh`. This starts the livestream.
### Flask
Go to the project root and type `flask run`. This starts the websever.
### tor
Now your webserver is running on port 5000 (or whichever port you set it to, if you did that). We need to tell tor to create a hidden service and to point it at port 5000.
In your [torrc](https://support.torproject.org/tbb/tbb-editing-torrc/), add these two lines
```
HiddenServiceDir $PROJECT_ROOT/hidden_service
HiddenServicePort 80 127.0.0.1:5000
```
where `$PROJECT_ROOT` is the root folder of this project. When you reload tor it will create the `hidden_service` directory and your website will be online. Your onion address is in `hidden_service/hostname`.