Fix intermittent hangs in Tracking Details videos (#21185)
CI / AMD64 Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
CI / ARM Build (push) Waiting to run
CI / ARM Extra Build (push) Blocked by required conditions

* remove extra gap controller overrides

* new vod endpoint for clips to set discontinuity

ensure tracking-detail playlists emit #EXT-X-DISCONTINUITY (avoids fMP4 timestamp rewrites and playback stalls) while leaving standard recordings behavior unchanged

* use new endpoint
This commit is contained in:
Josh Hawkins
2025-12-07 12:58:33 -06:00
committed by GitHub
parent 644c7fa6b4
commit 28b0ad782a
3 changed files with 54 additions and 23 deletions
@@ -446,7 +446,7 @@ export function TrackingDetails({
(event.end_time ?? Date.now() / 1000) + annotationOffset / 1000;
const startTime = eventStartRecord - REVIEW_PADDING;
const endTime = eventEndRecord + REVIEW_PADDING;
const playlist = `${baseUrl}vod/${event.camera}/start/${startTime}/end/${endTime}/index.m3u8`;
const playlist = `${baseUrl}vod/clip/${event.camera}/start/${startTime}/end/${endTime}/index.m3u8`;
return {
playlist,
@@ -559,7 +559,6 @@ export function TrackingDetails({
isDetailMode={true}
camera={event.camera}
currentTimeOverride={currentTime}
enableGapControllerRecovery={true}
/>
{isVideoLoading && (
<ActivityIndicator className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" />
+2 -19
View File
@@ -57,7 +57,6 @@ type HlsVideoPlayerProps = {
isDetailMode?: boolean;
camera?: string;
currentTimeOverride?: number;
enableGapControllerRecovery?: boolean;
};
export default function HlsVideoPlayer({
@@ -82,7 +81,6 @@ export default function HlsVideoPlayer({
isDetailMode = false,
camera,
currentTimeOverride,
enableGapControllerRecovery = false,
}: HlsVideoPlayerProps) {
const { t } = useTranslation("components/player");
const { data: config } = useSWR<FrigateConfig>("config");
@@ -173,21 +171,12 @@ export default function HlsVideoPlayer({
}
// Base HLS configuration
const baseConfig: Partial<HlsConfig> = {
const hlsConfig: Partial<HlsConfig> = {
maxBufferLength: 10,
maxBufferSize: 20 * 1000 * 1000,
startPosition: currentSource.startPosition,
};
const hlsConfig = { ...baseConfig };
if (enableGapControllerRecovery) {
hlsConfig.highBufferWatchdogPeriod = 1; // Check for stalls every 1 second (default: 3)
hlsConfig.nudgeOffset = 0.2; // Nudge playhead forward 0.2s when stalled (default: 0.1)
hlsConfig.nudgeMaxRetry = 5; // Try up to 5 nudges before giving up (default: 3)
hlsConfig.maxBufferHole = 0.5; // Tolerate up to 0.5s gaps between fragments (default: 0.1)
}
hlsRef.current = new Hls(hlsConfig);
hlsRef.current.attachMedia(videoRef.current);
hlsRef.current.loadSource(currentSource.playlist);
@@ -201,13 +190,7 @@ export default function HlsVideoPlayer({
hlsRef.current.destroy();
}
};
}, [
videoRef,
hlsRef,
useHlsCompat,
currentSource,
enableGapControllerRecovery,
]);
}, [videoRef, hlsRef, useHlsCompat, currentSource]);
// state handling