通過錄像檔案模拟直播源,通過rtmp協定推送到nginx伺服器
nginx 配置檔案 增加
rtmp {
server {
listen 1935;
application hls {
live on;
hls on;
hls_path /tmp/app;
hls_fragment 5s;
}
}
}
http 下面增加
location /hls {
#server hls fragments
types{
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
alias /tmp/app;
expires -1;
}
在 safari浏覽器或者vlc中打開 測試位址: http://192.168.1.105:8080/hls/test.m3u8
可以直播了