Use the live chat to stream loop your videos.
Requirements: Install FFmpeg
marathon start --twitch-stream-key [twitch stream key. ex: live_XXXX] --twitch-broadcaster-channel [twitch username, ex: justintv]
!play lotr.playlist
=> the bot will stream in real time your playlist with FFmpeg ffconcat.!shutdown
=> the bot will halt the stream and exits.Streaming platform
Broadcaster
Start RTMP server that write an HLS stream
https://ffmpeg.org/ffmpeg-formats.html#toc-hls-2
ffmpeg -f flv -listen 1 -i rtmp://127.0.0.1:1935/live/app -hls_time 2 -hls_list_size 5 -hls_flags delete_segments -start_number 0 testsrc.m3u8
Start HTTP server to serve HLS stream
Reading the file m3u8 directly on the disk will prevent m3u8.tmp to be swapped with the main one. So the stream stops when reaching the last segments of the main one.
python3 -m http.server 8080
Read the HLS stream
.\ffplay -x 640 -y 360 http://127.0.0.1:8080/testsrc.m3u8
Use testsrc
source.
ffmpeg -re -f lavfi -i testsrc -f flv rtmp://127.0.0.1:1935/live/app
Or use a playlist with ffconcat
ffmpeg -re -stream_loop -1 -f concat -i playlist.txt -f flv rtmp://127.0.0.1:1935/live/app