https://github.com/ossrs/srs/wiki/v3_CN_SampleHttpFlv
docker stop srs && docker rm srs &&
docker run -d --name srs -p 1935:1935 -p 1985:1985 -p 1980:8080 -v /root/video/conf/http.flv.live.conf:/usr/local/srs/conf/srs.conf --restart=always --privileged=true ossrs/srs:4
http.flv.live.conf
# main config for srs.
# @see full.conf for detail config.
listen 1935;
max_connections 1000;
srs_log_tank file;
srs_log_file ./objs/srs.log;
#daemon on;
http_api {
enabled on;
listen 1985;
}
http_api {
enabled on;
listen 1985;
raw_api {
enabled on;
allow_reload on;
allow_query on;
allow_update on;
}
}
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
#stats {
# network 0;
# disk sda sdb xvda xvdb;
#}
vhost __defaultVhost__ {
#min_latency on;
#mr {
# enabled off;
# latency 350;
#}
#mw_latency 100;
#gop_cache off;
#queue_length 10;
# hls {
# enabled on;
# }
# dvr {
# enabled on;
# dvr_path ./objs/nginx/html/[app]/[stream].mp4;
# dvr_duration 5;
# dvr_plan session;
#}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
hstrs on;
}
http_hooks {
enabled on;
on_connect http://10.224.2.61:8081/srs/connect;
on_publish http://10.224.2.61:8081/srs/publish;
on_play http://10.224.2.61:8081/srs/play;
on_close http://10.224.2.61:8081/srs/close;
on_stop http://10.224.2.61:8081/srs/stop;
on_dvr http://10.224.2.61:8081/srs/dvrs;
}
}
Q.E.D.