/Loop-Streamer

Streaming videos & mp3 from 2 folder, sends it to nginx that is doing HLS

Primary LanguageC

Loop-Streamer

Streaming videos & mp3 from 2 folder, sends it to nginx that is doing HLS.

The videos are edited with the moviepy python library. Moviepy is using ffmpeg.

Python has to be version 3. ~/.bashrc needs to contain line "alias python=python3.5"

moviepy needs to be installed. It can be installed with pip, first need to have pip: $ apt install python3-pip

Then moviepy can be installed with: $ pip3 install moviepy

Timezone on the server needs to be set, see this manual.

Need to download nginx with RTMP module, and create a service for it (the original nginx service needs to be deactivated)

Install with Docker

  1. Copy contents of home folder to desired location(Example: cp -R home/* /home/ You can copy it to any location.)
  2. Create config.conf file in the newly created directory, use config.conf.save as a template. Important: root_path, clips_path, mp3_path, vids_path.
  3. Delete or change logo.png
  4. Change font.ttf if you want.
  5. Add videos to the vids folder.
  6. Add mp3 files to the _mp3 folder.
  7. Add your streaming key to the nginx.conf file. This is the line you need to edit: push rtmp://a.rtmp.youtube.com/live2/KEY (It is possible to push RTMP stream to multiple server.)
  8. start.sh needs to point to your home folder.
  9. Build docker image: docker build -t app .
  10. Run docker image: docker run -v /home:/home app (on host machine, /home will be connected to docker /home)