This repository has been archived on 2021-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
eltelive/tmpl/rtmp.conf

63 lines
2.4 KiB
Plaintext

rtmp {
server {
listen 1935;
chunk_size 4096;
max_streams 300;
buflen 6s;
idle_streams on;
max_connections 3000;
wait_video on;
application publish {
live on;
# record off;
record all;
record_path /var/www/recording;
record_suffix -%Y-%m-%d-%T.flv;
exec_record_done /var/www/convert.sh $name $filename $basename;
# exec /usr/bin/ffmpeg -i rtmp://localhost:1935/publish/$name -c:v copy -c:a copy -f flv rtmp://localhost:1935/live/$name >>/var/log/ffmpeg/ffmpeg-$name-tmp.log 2>&1;
# exec /usr/bin/ffmpeg -i rtmp://localhost:1935/publish/$name -c:v libx264 -profile:v high -preset faster -tune stillimage -b:v 800k -force_key_frames expr:gte(t,n_forced*3) -c:a aac -b:a 128k -f flv rtmp://localhost:1935/live/$name >>/var/log/ffmpeg/ffmpeg-$name-tmp.log 2>&1;
exec /usr/bin/ffmpeg -i rtmp://localhost:1935/publish/$name -c:v libx264 -profile:v high -preset $VIDEOPRESET -tune stillimage -b:v 800k -force_key_frames expr:gte(t,n_forced*3) -c:a copy -f flv rtmp://localhost:1935/live/$name >>/var/log/ffmpeg/ffmpeg-$name-tmp.log 2>&1;
exec /usr/bin/ffmpeg -i rtmp://localhost:1935/publish/$name -c:v libx264 -filter:v scale=-8:360 -profile:v high -preset $VIDEOLQPRESET -tune stillimage -b:v 100k -force_key_frames expr:gte(t,n_forced*3) -c:a aac -ac:a 1 -b:a 64k -f flv rtmp://localhost:1935/livelq/$name >>/var/log/ffmpeg/ffmpeg-$name-lq-tmp.log 2>&1;
on_publish http://localhost/publish/token/auth_publish.cgi;
allow publish all;
allow play 127.0.0.1;
deny play all;
}
application live {
live on;
allow publish 127.0.0.1;
deny publish all;
allow play all;
hls on;
hls_path /tmp/livehls;
hls_fragment 3s;
hls_playlist_length 60s;
# dash on;
# dash_path /tmp/livedash;
# dash_fragment 3s;
# dash_playlist_length 60s;
}
application livelq {
live on;
allow publish 127.0.0.1;
deny publish all;
allow play all;
hls on;
hls_path /tmp/livehlslq;
hls_fragment 3s;
hls_playlist_length 60s;
}
}
}