简体   繁体   English

如何在远程机器上播放 nginx & rtmp based hls live stream

[英]how to play nginx & rtmp based hls live stream on a remote machine

I have installed nginx, rtmp and ffmpeg based hls live streaming working on ubuntu machine.我已经在 ubuntu 机器上安装了 nginx、rtmp 和基于 ffmpeg 的 hls 直播。 I use this command to stream hls我用这个命令来 stream hls

sudo ffmpeg -re -i sample.mp4 -vcodec libx264 -vprofile high -g 30 -acodec aac -strict -2 -f flv rtmp://localhost/show/stream2

when I try to play this stream using VLC using following commands on the same machine it works well.当我尝试在同一台机器上使用以下命令使用 VLC 播放此 stream 时,效果很好。

http://myIp:8080/hls/stream2.m3u8

or要么

http://localhost:8080/hls/stream2.m3u8

However when I try to access from remote computer connected to same WIFI, not able to play.但是,当我尝试从连接到同一 WIFI 的远程计算机访问时,无法播放。 VLC gives an error that unable to play the file. VLC 给出无法播放文件的错误。

Solution to this problem has to be in two places 1. open ports in ufw 2. enable pings in home router这个问题的解决方案必须在两个地方 1. 在 ufw 中打开端口 2. 在家庭路由器中启用 ping

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM