Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miketangoecho/marathon
Use the live chat to stream loop your videos.
https://github.com/miketangoecho/marathon
chatbot ffmpeg streaming twitch
Last synced: 29 days ago
JSON representation
Use the live chat to stream loop your videos.
- Host: GitHub
- URL: https://github.com/miketangoecho/marathon
- Owner: MikeTangoEcho
- License: mit
- Created: 2024-08-20T09:19:24.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-08-20T09:40:48.000Z (3 months ago)
- Last Synced: 2024-10-13T08:22:25.339Z (about 1 month ago)
- Topics: chatbot, ffmpeg, streaming, twitch
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Marathon
Use the live chat to stream loop your videos.
## How it works
**Requirements**: Install FFmpeg
* https://www.ffmpeg.org/download.html```sh
marathon start --twitch-stream-key [twitch stream key. ex: live_XXXX] --twitch-broadcaster-channel [twitch username, ex: justintv]
```1. The bot connects to iRc and joins your channel, then wait for commands
2. On `!play lotr.playlist` => the bot will stream in real time your playlist with FFmpeg ffconcat.
3. On `!shutdown` => the bot will halt the stream and exits.## What's Next ?
Streaming platform
* [x] Twitch
* [ ] YouTubeBroadcaster
* [x] FFmpeg *concat*
* [ ] vlc
* [ ] liquidsoap## Usefull links
* https://help.twitch.tv/s/twitch-ingest-recommendation
* https://help.twitch.tv/s/article/broadcasting-guidelines
* https://ffmpeg.org/ffmpeg-all.html#toc-Preset-files
* https://ffmpeg.org/ffmpeg-protocols.html#udp
* https://trac.ffmpeg.org/wiki/Concatenate
* https://trac.ffmpeg.org/wiki/EncodingForStreamingSites
* https://trac.ffmpeg.org/wiki/StreamingGuide
* https://trac.ffmpeg.org/wiki/Encode/H.264## Local Mock: RTMP server to HLS stream
**Start RTMP server that write an HLS stream**
https://ffmpeg.org/ffmpeg-formats.html#toc-hls-2
```sh
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.
```sh
python3 -m http.server 8080
```**Read the HLS stream**
```sh
.\ffplay -x 640 -y 360 http://127.0.0.1:8080/testsrc.m3u8
```## Start a RTPM stream
Use `testsrc` source.
```sh
ffmpeg -re -f lavfi -i testsrc -f flv rtmp://127.0.0.1:1935/live/app
```Or use a playlist with `ffconcat`
```sh
ffmpeg -re -stream_loop -1 -f concat -i playlist.txt -f flv rtmp://127.0.0.1:1935/live/app
```