mirror of https://gitgud.io/fatchan/stream.git
parent
eeeabfe3e0
commit
e57c8015a1
20 changed files with 30 additions and 55 deletions
@ -0,0 +1,13 @@ |
||||
# stream |
||||
|
||||
The source of [stream.loki](http://stream.loki) (or another simple nginx-rtmp-based streaming site). |
||||
|
||||
The aim is to have a simple streaming site with chat (irc iframe), view count, an index page ([/streams](http://stream.loki/streams)) of all live streams, and do it with minimal backend. |
||||
|
||||
This repo provides: |
||||
- the nginx configs and static files |
||||
- small nodejs http server for nginx to authenticate stream keys (optional) |
||||
- some cronjobs to generate viewer counts and stream thumbnails |
||||
|
||||
## License |
||||
GNU AGPLv3, see [LICENSE](LICENSE). |
@ -1,17 +0,0 @@ |
||||
STREAM_NAME="" |
||||
STREAM_KEY="" |
||||
|
||||
while true; |
||||
do |
||||
rm ~/anime/list.* |
||||
for f in ~/anime/*.mp4 ; do |
||||
echo file "$f" >> ~/anime/list.txt; |
||||
#echo file "$f" >> ~/anime/list.tmp; |
||||
done |
||||
#shuf ~/anime/list.tmp > ~/anime/list.txt |
||||
ffmpeg \ |
||||
-re -f concat -safe 0 -i ~/anime/list.txt \ |
||||
-c:a copy -c:v copy \ |
||||
-f flv "rtmp://stream.loki/live/${STREAM_NAME}?key=${STREAM_KEY}" |
||||
sleep 15 |
||||
done |
@ -0,0 +1,3 @@ |
||||
# every minute, run both scripts to update viewer count and stream thumbnails |
||||
* * * * * bash /var/www/stream/viewers.sh |
||||
* * * * * bash /var/www/stream/posters.sh |
@ -1,21 +0,0 @@ |
||||
STREAM_NAME="" |
||||
STREAM_KEY="" |
||||
|
||||
while true; |
||||
do |
||||
rm ~/music/list.* |
||||
for f in ~/music/*.opus ; do |
||||
echo file "$f" >> ~/music/list.tmp; |
||||
done |
||||
shuf ~/music/list.tmp > ~/music/list.txt |
||||
#NOTE: creates 2x2 dummy video stream to make nginx happy, or else it will not show in the stream list. |
||||
#NOTE: timeout kills after 12 hours, because nginx is shite. it will loop, shuffle and run again. |
||||
timeout --foreground --kill-after=10 43200 ffmpeg \ |
||||
-re -f lavfi -i "color=size=2x2:rate=1:color=black" \ |
||||
-re -f concat -safe 0 -thread_queue_size 512 -i ~/music/list.txt \ |
||||
-map 0:v:0 -map 1:a:0 \ |
||||
-c:v libx264 -pix_fmt yuv420p -preset superfast -r 2 -g 2 -b:v 1k \ |
||||
-c:a aac -b:a 128k -bufsize 512k \ |
||||
-f flv "rtmp://stream.loki/live/${STREAM_NAME}?key=${STREAM_KEY}" |
||||
sleep 15 |
||||
done |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Loading…
Reference in new issue