The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.
Rust ffmpegfree-video-editormodel-context-protocolnon-linear-editoroffline-firstopen-source-video-editorself-hostedvideo-editingvideo-editing-automationvideo-editing-softwarevideo-editing-toolsvideo-editorvoice-cloningyoutube-automationyoutube-shorts
fix(ui): timecode derives both fields from the frame count
Jareer5696c2737b0b
diff --git a/desktop/src/lib/time.test.ts b/desktop/src/lib/time.test.tsindex 6777f654..a67a8046 100644--- a/desktop/src/lib/time.test.ts+++ b/desktop/src/lib/time.test.ts@@ -37,6 +37,15 @@ describe("timecode", () => {test("negative time clamps to zero rather than going surreal", () => {expect(timecode(-5, 30)).toBe("00:00:00:00");});++ test("fractional rates keep frames and seconds in one clock", () => {+ // Non-drop-frame: both fields derive from the frame count. 100s at+ // 29.97 is frame 2997 exactly - second 99, frame 27 - and the frame+ // field must roll to :00 exactly when its own seconds increment, never+ // disagree with them (the old wall-clock seconds read 01:40 here).+ expect(timecode(100, 29.97)).toBe("00:01:39:27");+ expect(timecode(100.101, 29.97)).toBe("00:01:40:00");+ });});describe("shortDuration", () => {diff --git a/desktop/src/lib/time.ts b/desktop/src/lib/time.tsindex 444e06c4..bb821fec 100644--- a/desktop/src/lib/time.ts+++ b/desktop/src/lib/time.ts@@ -9,8 +9,14 @@export function timecode(seconds: number, frameRate: number): string {const safe = Math.max(0, seconds);const totalFrames = Math.floor(safe * frameRate);- const frames = totalFrames % Math.round(frameRate);- const totalSeconds = Math.floor(safe);+ // Both fields derive from the frame count - non-drop-frame timecode. The+ // seconds used to come from the wall clock instead, so at 29.97 the frame+ // field disagreed with its own seconds near boundaries (00:01:40:27 where+ // :00 belonged). NDF runs slightly behind the wall clock at NTSC rates;+ // that is the standard trade, not a bug.+ const fps = Math.max(1, Math.round(frameRate));+ const frames = totalFrames % fps;+ const totalSeconds = Math.floor(totalFrames / fps);const pad = (value: number) => value.toString().padStart(2, "0");return [