diff options
-rw-r--r-- | localwebsite/handlers/MiscHandler.php | 9 | ||||
-rwxr-xr-x | tools/ipcam_rtsp2hls.sh | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/localwebsite/handlers/MiscHandler.php b/localwebsite/handlers/MiscHandler.php index 486ff45..772cd9b 100644 --- a/localwebsite/handlers/MiscHandler.php +++ b/localwebsite/handlers/MiscHandler.php @@ -55,8 +55,15 @@ class MiscHandler extends RequestHandler list($hls_debug, $video_events) = $this->input('b:hls_debug, b:video_events'); $hls_opts = [ - 'startPosition' => -1 + 'startPosition' => -1, + + // // https://github.com/video-dev/hls.js/issues/3884#issuecomment-842380784 + 'liveSyncDuration' => 2, + 'liveMaxLatencyDuration' => 3, + 'maxLiveSyncPlaybackRate' => 2, + 'liveDurationInfinity' => true, ]; + if ($hls_debug) $hls_opts['debug'] = true; diff --git a/tools/ipcam_rtsp2hls.sh b/tools/ipcam_rtsp2hls.sh index a468715..70111b0 100755 --- a/tools/ipcam_rtsp2hls.sh +++ b/tools/ipcam_rtsp2hls.sh @@ -110,5 +110,5 @@ fi ffmpeg $args -i rtsp://${USER}:${PASSWORD}@${IP}:${PORT}/Streaming/Channels/${CHANNEL} \ -c:v copy -c:a copy -bufsize 1835k \ -pix_fmt yuv420p \ - -flags -global_header -hls_time 5 -hls_list_size 6 -hls_wrap 5 \ + -flags -global_header -hls_time 2 -hls_list_size 3 \ ${OUTDIR}/${NAME}/live.m3u8 |