Video tab tweaks

With the changes in https://github.com/blakeblackshear/frigate/pull/18220, the video tab in the Tracked Object Details pane now correctly trims the in-browser HLS video. Because of keyframes and record/detect stream differences, we can manually subtract a couple of seconds from the event start_time to ensure the first few frames aren't cut off from the video
This commit is contained in:
Josh Hawkins 2025-06-02 08:15:43 -05:00
parent 0bdd33cc4d
commit 7677c97d53

View File

@ -1231,7 +1231,9 @@ export function VideoTab({ search }: VideoTabProps) {
]); ]);
const endTime = useMemo(() => search.end_time ?? Date.now() / 1000, [search]); const endTime = useMemo(() => search.end_time ?? Date.now() / 1000, [search]);
const source = `${baseUrl}vod/${search.camera}/start/${search.start_time}/end/${endTime}/index.m3u8`; // subtract 2 seconds from start_time to account for keyframes and any differences in the record/detect streams
// to help the start of the event from not being completely cut off
const source = `${baseUrl}vod/${search.camera}/start/${search.start_time - 2}/end/${endTime}/index.m3u8`;
return ( return (
<> <>