Warning: This project is in "Alpha" status and is being updated frequently with breaking changes.
PyRestreamer is a simple app built with FFMPEG, Streamlink, Docker, and Python to re-stream video content from DASH or HLS streams to RTMP. One possible use case is to allow re-broadcasting content from sources that only provide DASH or HLS endpoints to other services and endpoints that require RTMP.
The general idea is that you specify the times you would like to be actively re-streaming, and then PyReStreamer will automatically start streaming at the specified time and stop after the specified duration. FFMPEG is used under the hood, so you can output anything supported by FFMPEG.
This app was specifically built to automate restreaming from Living as One to PhoneLiveStreaming.com.
PyReStreamer is designed to be deployed in a Docker container. As such, you'll need a host running Docker Engine to get started. Once you've got that up and running, these steps will get you started:
- Pull the image from Docker Hub:
docker pull billdeitrick/pyrestreamer
- Copy the sample .env and logging.yml files and edit according to your requirements. The .env file is fairly well documented, and the logging.yml file is configured for suitable Docker defaults. PushOver support is built in (in example file) if you are a PushOver user. Otherwise, you can learn more about logging options in the Python docs. Generally I prefer to drop them in
/opt/pyrestreamer
on my Docker host. - Start the container; here's an example command:
docker run -d --name pyrestreamer --restart unless-stopped --env-file /path/to/.env -v /path/to/logging.yml:/opt/app/logging.yml billdeitrick/pyrestreamer