一、nginx-http-flv-module转发码流,web使用flv.js直播码流
端口按照nginx.conf里面配置
拉取镜像
docker pull mycujoo/nginx-http-flv-module
启动容器
docker run -d -p 8001:8001 -p 8002:8002 --name http-flv -v /root/video:/root mycujoo/nginx-http-flv-module:latest
进入容器
docker exec -it http-flv sh
打开配置文件
vi /opt/nginx/nginx.conf
修改配置文件
daemon off;
error_log /var/log/nginx/error.log warn;
events {
worker_connections 1024;
}
rtmp {
out_queue 4096;
out_cork 8;
max_streams 64;
server {
listen 8001;
access_log off; # 取消操作日志
application live {
live on;
gop_cache on; #open GOP cache for reducing the wating time for the first picture of video
}
}
}
http {
server {
listen 8002;
access_log off; # 取消操作日志
location /live {
flv_live on; #open flv live streaming (subscribe)
chunked_transfer_encoding on; #open 'Transfer-Encoding: c