参考我上一篇流媒体服务器搭建的步骤https://blog.csdn.net/weixin_45380730/article/details/104824262
不同的地方:将mp4放在服务器目录上
修改nginx.conf
rtmp {
server {
listen 1935;
application myapp {
live on;
}
application hls {
live on;
hls on;
hls_path /tmp/hls;
}
}
}
http下添加:
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /tmp;
add_header Cache-Control no-cache;
推流:
[root@localhost mp4]# ffmpeg -re -i test.mp4 -c copy -f flv rtmp://192.168.247.128:1935/hls/test1
方法一;用vlc打开视频:
参考:https://blog.csdn.net/li