mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-11 08:03:01 +03:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fba967c74b |
@@ -150,17 +150,18 @@ export function TrackingDetails({
|
|||||||
|
|
||||||
// Fetch the VOD manifest JSON to get the actual clipFrom after keyframe
|
// Fetch the VOD manifest JSON to get the actual clipFrom after keyframe
|
||||||
// snapping. The backend may snap clipFrom backwards to a keyframe, making
|
// snapping. The backend may snap clipFrom backwards to a keyframe, making
|
||||||
// the video start earlier than the requested time.
|
// the video start earlier than the requested time. Uses sourceOffsetRef so
|
||||||
|
// the manifest describes the same clip as videoSource.
|
||||||
const vodManifestUrl = useMemo(() => {
|
const vodManifestUrl = useMemo(() => {
|
||||||
if (!event.camera) return null;
|
if (!event.camera) return null;
|
||||||
const startTime =
|
const sourceOffset = sourceOffsetRef.current;
|
||||||
event.start_time + annotationOffset / 1000 - REVIEW_PADDING;
|
const startTime = event.start_time + sourceOffset / 1000 - REVIEW_PADDING;
|
||||||
const endTime =
|
const endTime =
|
||||||
(event.end_time ?? Date.now() / 1000) +
|
(event.end_time ?? Date.now() / 1000) +
|
||||||
annotationOffset / 1000 +
|
sourceOffset / 1000 +
|
||||||
REVIEW_PADDING;
|
REVIEW_PADDING;
|
||||||
return `vod/clip/${event.camera}/start/${startTime}/end/${endTime}`;
|
return `vod/clip/${event.camera}/start/${startTime}/end/${endTime}`;
|
||||||
}, [event, annotationOffset]);
|
}, [event]);
|
||||||
|
|
||||||
const { data: vodManifest } = useSWR<VodManifest>(vodManifestUrl, null, {
|
const { data: vodManifest } = useSWR<VodManifest>(vodManifestUrl, null, {
|
||||||
revalidateOnFocus: false,
|
revalidateOnFocus: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user