linux nginx rtmp流
nginx相关操作
启动:[root@VM-4-10-centos nginx-1.8.0]# sudo nginx
查看运行状态:
netstat -ano | grep "80"
检查配置文件是否存在问题:nginx -t 配置文件路径(nginx.conf)
根据指定配置文件启动,命令:nginx -c 配置文件路径(nginx.conf)
优雅停止服务:nginx -s quit
重新加载配置文件,命令:nginx -s reload
1、下载编译librtmp:
git clone git://git.ffmpeg.org/rtmpdump
cd rtmpdump/
make
sudo make install
2、搭建nginx服务器:
git clone https://github.com/arut/nginx-rtmp-module
wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar -xvf nginx-1.8.0.tar.gz
cd nginx-1.8.0/
./configure --add-module=../nginx-rtmp-module --with-http_ssl_module
make
sudo make install
安装后,建立软链接:
ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
ffmpeg -re -i C://Users//ray//Desktop//video.mp4 -vcodec libx264 -acodec aac -f flv rtmp://1.4.59.36:1935/live/home
rtmp://1.4.59.36:1935/live/home
obs
rtmp://1.4.59.36:1935/live/1234
rtmp://1.4.59.36:1935/live/1234
https://blog.csdn.net/weixin_43796767/article/details/117307845