安装Nginx
https://blog.csdn.net/qq_37598011/article/details/93497219
安装Nginx-rtmp-module
下载:
git clone https://github.com/arut/nginx-rtmp-module.git
(这里我安装的是/usr/local/src目录下)
编译:
./configure --with-http_ssl_module --with-debug --add-module=/usr/local/src/nginx-rtmp-module
make && make install
修改Nginx配置文件:
rtmp {
server {
listen 1935; #监听的端口
chunk_size 4000;
application zzf { #rtmp推流请求路径
live on;
hls on;
hls_path /usr/share/nginx/html/hls;
hls_fragment 5s;
}
}
}
最后重启!!!
测试
打开obs:
然后推流!!!
ok!!!!搭建完成
录制demo:
rtmp {
server {
listen 1935; #监听的端口
#chunk_size 4000;
application zzf { #rtmp推流请求路径
live on;
hls_cleanup off; #close clean
record_path /video;
record video;
record_suffix -%Y-%m-%d-%H-%M-%S.mp4;
record_max_size 60M;
record_append on;
}
}
}