From b615bc8d6c07dab6b215b0125ebc09eb0da73ce2 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Thu, 5 Feb 2026 07:56:54 +1300 Subject: [PATCH] fix: prevent negative timestamp in video stitching Offset segmentBaseTime by frameInterval so the first frame starts at timestamp 0 instead of -frameInterval, which the encoder rejects. Co-Authored-By: Claude Opus 4.5 --- src/hooks/useStitchVideos.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useStitchVideos.ts b/src/hooks/useStitchVideos.ts index 26cb4eb5..509915c2 100644 --- a/src/hooks/useStitchVideos.ts +++ b/src/hooks/useStitchVideos.ts @@ -351,7 +351,7 @@ export async function stitchVideosAsync( const videoDuration = await input.computeDuration(); // Track the base offset for this video segment - const segmentBaseTime = highestWrittenTimestamp; + const segmentBaseTime = highestWrittenTimestamp + frameInterval; // Track minimum timestamp in this segment to normalize let segmentMinTimestamp: number | null = null;