FFmpeg 执行命令:ffmpeg -i rtsp://xxx.xxx.xxx.xxx/live/chn0 -fflags flush_packets -max_delay 1 -hls_flags delete_segments -hls_time 2 -g 15 /home/pub/video/hlsdb/test.m3u8
nginx config:
location /hlsdb {
#server hls fragments
types{
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /home/pub/video/hlsdb;
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE;
}
前端用了一个EasyPlayer.js 播放 m3u8/HLS;
测试延迟基本上在12s的样子,请问有什么好的优化方案吗?能控制在2S以内的延迟,就可以接受了。
相似问题