Browse Source

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 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 5 months ago
parent
commit
b615bc8d6c
  1. 2
      src/hooks/useStitchVideos.ts

2
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;

Loading…
Cancel
Save