前提:
1.已安裝nginx
2.下載安裝xtmp模塊 ?nginx源碼目錄下 ./configure --add-module=/path/to/nginx-rtmp-module --with-http_ssl_module
make
sudo make install
3.啟動(dòng)nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
4.推拉流設(shè)置
1)./usr/local/nginx/conf/nginx.conf 文件下添加
rtmp{
server{
listen 1935;
application myapp {
live on;
record off;
}
application hls{
live on;
hls on;
hls_path /tmp/hls;
}
}
}
2).使用ffmpeg推流
ffmpeg -re -i test.mp4 -vcodec libx264 -f flv rtmp://localhost:1935/myapp/test1
3).打開obs楼镐,媒體->打開網(wǎng)絡(luò)串流潮瓶,在網(wǎng)絡(luò)中輸入U(xiǎn)RL地址
rtmp://192.168.44.131:1935/myapp/test1