如何在远程机器上播放基于 nginx 和 rtmp 的 hls 直播
how to play nginx & rtmp based hls live stream on a remote machine
我已经在 ubuntu 机器上安装了基于 nginx、rtmp 和 ffmpeg 的 hls 直播。我使用此命令流式传输 hls
sudo ffmpeg -re -i sample.mp4 -vcodec libx264 -vprofile high -g 30 -acodec aac -strict -2 -f flv rtmp://localhost/show/stream2
当我尝试在同一台机器上使用以下命令使用 VLC 播放此流时,效果很好。
http://myIp:8080/hls/stream2.m3u8
或
http://localhost:8080/hls/stream2.m3u8
但是,当我尝试从连接到同一 WIFI 的远程计算机访问时,无法播放。 VLC报错无法播放文件
这个问题的解决方案必须在两个地方
1.在ufw中打开端口
2. 在家庭路由器中启用 ping
我已经在 ubuntu 机器上安装了基于 nginx、rtmp 和 ffmpeg 的 hls 直播。我使用此命令流式传输 hls
sudo ffmpeg -re -i sample.mp4 -vcodec libx264 -vprofile high -g 30 -acodec aac -strict -2 -f flv rtmp://localhost/show/stream2
当我尝试在同一台机器上使用以下命令使用 VLC 播放此流时,效果很好。
http://myIp:8080/hls/stream2.m3u8
或
http://localhost:8080/hls/stream2.m3u8
但是,当我尝试从连接到同一 WIFI 的远程计算机访问时,无法播放。 VLC报错无法播放文件
这个问题的解决方案必须在两个地方 1.在ufw中打开端口 2. 在家庭路由器中启用 ping