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)
- Copy contents of home folder to desired location(Example:
cp -R home/* /home/
You can copy it to any location.) - 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.
- Delete or change logo.png
- Change font.ttf if you want.
- Add videos to the vids folder.
- Add mp3 files to the _mp3 folder.
- 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.) - start.sh needs to point to your home folder.
- Build docker image:
docker build -t app .
- Run docker image:
docker run -v /home:/home app
(on host machine, /home will be connected to docker /home)