安裝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;
}
}
}