Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
fix(architecture): anchor modifiers to clip boundaries and reproject regions on structural edits
Etienne Lescot470a9f613d87
diff --git a/poc-d3d/src/live.rs b/poc-d3d/src/live.rsindex f5e29c487..cb3bd5b9a 100644--- a/poc-d3d/src/live.rs+++ b/poc-d3d/src/live.rs@@ -81,11 +81,17 @@ unsafe fn open_and_seek_clip() -> Result<PrefetchedClip> {let source_time_sec = source_time_sec.max(0.0);let mut sdec = Decoder::open(screen_path, gpu)?;- let mut wdec = Decoder::open(webcam_path, gpu)?;+ let mut wdec = match Decoder::open(webcam_path, gpu) {+ Ok(d) => d,+ Err(_) => Decoder::open(screen_path, gpu)?,+ };let sf = sdec.seek_to(source_time_sec)?;- let wf = wdec.seek_to(webcam_seek_time(source_time_sec, webcam_offset_sec))?;- if sf.is_null() || wf.is_null() {- anyhow::bail!("clip préchargé vide au temps source {source_time_sec:.3}s (screen=\"{screen_path}\", webcam=\"{webcam_path}\")");+ let mut wf = wdec.seek_to(webcam_seek_time(source_time_sec, webcam_offset_sec))?;+ if wf.is_null() {+ wf = wdec.seek_to(0.0)?;+ }+ if sf.is_null() {+ anyhow::bail!("clip préchargé vide au temps source {source_time_sec:.3}s (screen=\"{screen_path}\")");}let idx = (source_time_sec * sdec.fps()).round().max(0.0) as u32;let cursor_track = CursorTrack::load(&format!("{screen_path}.cursor.json"), 0.0, 24.0 * 3600.0).ok();@@ -106,9 +112,13 @@ pub struct Player {impl Player {pub unsafe fn open(screen: &str, webcam: &str, gpu: &Gpu) -> Result<Player> {+ let wdec = match Decoder::open(webcam, gpu) {+ Ok(d) => d,+ Err(_) => Decoder::open(screen, gpu)?,+ };Ok(Player {sdec: Decoder::open(screen, gpu)?,- wdec: Decoder::open(webcam, gpu)?,+ wdec,gpu: Gpu {device: gpu.device.clone(),context: gpu.context.clone(),diff --git a/src/components/ai-edition/NativeCompositorOverlay.tsx b/src/components/ai-edition/NativeCompositorOverlay.tsxindex 50a9c842c..150246246 100644--- a/src/components/ai-edition/NativeCompositorOverlay.tsx+++ b/src/components/ai-edition/NativeCompositorOverlay.tsx@@ -3,11 +3,12 @@ import { useProjectStore } from "@/lib/ai-edition/store/projectStore";import {setActiveClip,setCurrentNativeViewId,+ setNativePlaying,setNativeScene,useNativeCompositorView,} from "@/native";import { resolveNativePlaybackPosition } from "@/native/nativePlaybackPosition";-import { buildSceneDescription } from "@/native/sceneDescription";+import { buildSceneDescription, resolveVisibleClips } from "@/native/sceneDescription";import {getWebcamNativeSize,getWebcamNativeSizeRevision,@@ -63,10 +64,7 @@ export function NativeCompositorOverlay() {// les trims.const nativeClips = useMemo(() => {if (!document) return [];- const assetById = new Map(document.assets.map((asset) => [asset.id, asset]));- return [...document.timeline.clips]- .sort((a, b) => a.timelineStartSec - b.timelineStartSec)- .filter((clip) => assetById.get(clip.assetId)?.originalPath);+ return resolveVisibleClips(document);}, [document]);const activePosition = useMemo(() => resolveNativePlaybackPosition(nativeClips, currentTimeSec),@@ -87,7 +85,10 @@ export function NativeCompositorOverlay() {}return {screenPath: primary.originalPath,- webcamPath: primary.cameraTrack?.sourcePath ?? undefined,+ webcamPath:+ primary.cameraTrack?.visible && primary.cameraTrack.sourcePath+ ? primary.cameraTrack.sourcePath+ : undefined,// sidecar convention (electron/ipc/handlers.ts readCursorRecordingFile) : la// télémétrie curseur vit à côté de la vidéo tant qu'elle n'a pas bougé. Absente →// le natif ignore juste le curseur (CursorTrack::load échoue silencieusement).@@ -97,7 +98,6 @@ export function NativeCompositorOverlay() {const ready = sources !== null;const { viewId } = useNativeCompositorView(canvasRef, {- enabled: ready,sources: sources ?? undefined,});@@ -114,6 +114,7 @@ export function NativeCompositorOverlay() {// `_webcamSizeRevision` ci-dessus) : le layout preset et cie pilotent le rendu (remplace le// layout fixture). Effet APRÈS celui du viewId ci-dessus → currentViewId est déjà publié// quand on pousse.+ // biome-ignore lint/correctness/useExhaustiveDependencies: size revisionuseEffect(() => {if (viewId === null || !document) {return;@@ -138,6 +139,8 @@ export function NativeCompositorOverlay() {const activeSourceTimeSec = activePosition?.sourceTimeSec ?? null;const pendingTargetClipIdRef = useRef<string | null>(null);+ const playing = useProjectStore((s) => s.playing);+// Change les décodeurs screen/webcam uniquement quand le playhead entre dans un autre clip.useEffect(() => {if (@@ -158,14 +161,20 @@ export function NativeCompositorOverlay() {return;}const cam = asset.cameraTrack;+ const webcamPath = cam && cam.visible && cam.sourcePath ? cam.sourcePath : "";const targetClipId = activeClipId;pendingTargetClipIdRef.current = targetClipId;previousActiveClipIdRef.current = targetClipId;+ const isPlaying = playing;+ if (isPlaying) {+ setNativePlaying(false);+ }+setActiveClip(viewId,asset.originalPath,- cam?.sourcePath ?? asset.originalPath,+ webcamPath,cam ? (cam.startMs + cam.offsetMs) / 1000 : 0,activeClipIndex,activeSourceTimeSec,@@ -174,6 +183,9 @@ export function NativeCompositorOverlay() {if (pendingTargetClipIdRef.current !== targetClipId) {return;}+ if (isPlaying) {+ setNativePlaying(true);+ }}).catch((error: unknown) => {console.warn("[compositor-view] setActiveClip failed:", error);@@ -181,7 +193,7 @@ export function NativeCompositorOverlay() {previousActiveClipIdRef.current = null;}});- }, [viewId, document, activeClipId, activeClip, activeClipIndex, activeSourceTimeSec]);+ }, [viewId, document, activeClipId, activeClip, activeClipIndex, activeSourceTimeSec, playing]);if (!ready) {return null;diff --git a/src/components/ai-edition/NewEditorShell.tsx b/src/components/ai-edition/NewEditorShell.tsxindex e06ebda91..b9459470f 100644--- a/src/components/ai-edition/NewEditorShell.tsx+++ b/src/components/ai-edition/NewEditorShell.tsx@@ -13,6 +13,7 @@ import { PLACEHOLDER_DURATION_SEC, useTimeline } from "@/lib/ai-edition/store/usimport { matchesShortcut } from "@/lib/shortcuts";import { nativeBridgeClient } from "@/native";import type { AiEditionProjectSummary } from "@/native/contracts";+import { resolveVisibleClips } from "@/native/sceneDescription";import { useNativePlaybackSync } from "@/native/useNativePlaybackSync";import { ExportDialog } from "./ExportDialog";import { LeftPanel } from "./LeftPanel";@@ -128,19 +129,8 @@ export function NewEditorShell() {document?.assets.find((a) => a.id === document.project.primaryAssetId)?.originalPath ?? null;void primaryAssetPath;const clips: AxcutClip[] = document?.timeline.clips ?? [];- // Mirror transport/playhead onto the native compositor view (no-op if inactive). The hook- // maps absolute timeline time into the active clip's trimmed source-media clock.- //- // BUG corrigé : `currentTimeSec` est — et doit rester — la position sur le timeline- // RAW/document (celle de la règle, des zoom/speed regions, du marqueur de trim- // lui-même). Un instant, `<Preview>` et ce hook recevaient une liste de clips COMPACTÉE- // (trim-rétrécie) alors que `currentTimeSec` restait RAW — la tête de lecture visuelle- // (règle) et le clock de lecture (natif/scrub) se retrouvaient dans deux référentiels- // différents : le marqueur de trim ne représentait plus rien de cohérent, et la tête de- // lecture le traversait au lieu de le sauter. Voir `VirtualPreview.tsx` pour où le saut- // par-dessus un trim doit réellement se produire (sur l'horloge SOURCE du <video>, pas- // sur le timeline virtuel rapporté au parent).- useNativePlaybackSync(playing, currentTimeSec, clips);+ const visibleClips = useMemo(() => (document ? resolveVisibleClips(document) : []), [document]);+ useNativePlaybackSync(playing, currentTimeSec, visibleClips);const hasProject = Boolean(document);const hasAsset = projectId !== null && (document?.assets.length ?? 0) > 0;const project = document?.projectdiff --git a/src/lib/ai-edition/document/operations.ts b/src/lib/ai-edition/document/operations.tsindex 8758e1462..5b7778ab0 100644--- a/src/lib/ai-edition/document/operations.ts+++ b/src/lib/ai-edition/document/operations.ts@@ -16,6 +16,7 @@ import {normalizeIntervals,primaryAssetDuration,replaceTimeline,+ reprojectDocumentRegions,resequenceClips,} from "./timeline";@@ -272,7 +273,8 @@ export function applyTimelineOperation(return { document: next, summary: "restored full timeline" };}case "update_clip_range": {- const clips = document.timeline.clips.map((c) => {+ const oldClips = document.timeline.clips;+ const clips = oldClips.map((c) => {if (c.id !== op.clipId) return c;const lo = Math.max(0, Math.min(op.sourceStartSec, op.sourceEndSec));const hi = Math.max(lo, Math.max(op.sourceStartSec, op.sourceEndSec));@@ -284,16 +286,18 @@ export function applyTimelineOperation(timelineEndSec: 0,};});- const next: AxcutDocument = {+ const newClips = resequenceClips(clips);+ const nextDoc: AxcutDocument = {...document,timeline: {...document.timeline,- clips: resequenceClips(clips),+ clips: newClips,},preview: { ...document.preview, revision: document.preview.revision + 1 },};+ const finalDoc = reprojectDocumentRegions(nextDoc, oldClips, newClips);return {- document: next,+ document: finalDoc,summary: `trimmed clip to ${formatSec(Math.min(op.sourceStartSec, op.sourceEndSec))}–${formatSec(Math.max(op.sourceStartSec, op.sourceEndSec))}`,};}diff --git a/src/lib/ai-edition/document/timeline.ts b/src/lib/ai-edition/document/timeline.tsindex a441b30a2..189134b50 100644--- a/src/lib/ai-edition/document/timeline.ts+++ b/src/lib/ai-edition/document/timeline.ts@@ -197,6 +197,54 @@ export function invertIntervals(intervals: Interval[], durationSec: number): Intreturn cuts;}+export function reprojectDocumentRegions(+ document: AxcutDocument,+ oldClips: AxcutClip[],+ newClips: AxcutClip[],+): AxcutDocument {+ if (oldClips.length === 0 || newClips.length === 0) return document;+ const legacy = document.legacyEditor as Record<string, unknown> | null;+ const speedRegions = legacy?.speedRegions as+ | Array<{ id: string; startMs: number; endMs: number }>+ | undefined;+ const cameraFullscreenRegions = legacy?.cameraFullscreenRegions as+ | Array<{ id: string; startMs: number; endMs: number }>+ | undefined;++ return {+ ...document,+ zoomRanges: reprojectRegionsForReorder(document.zoomRanges, oldClips, newClips, () =>+ createId("zoom"),+ ) as AxcutDocument["zoomRanges"],+ annotations: reprojectRegionsForReorder(document.annotations, oldClips, newClips, () =>+ createId("ann"),+ ) as AxcutDocument["annotations"],+ legacyEditor:+ legacy && (speedRegions || cameraFullscreenRegions)+ ? {+ ...legacy,+ ...(speedRegions+ ? {+ speedRegions: reprojectRegionsForReorder(speedRegions, oldClips, newClips, () =>+ createId("speed"),+ ),+ }+ : {}),+ ...(cameraFullscreenRegions+ ? {+ cameraFullscreenRegions: reprojectRegionsForReorder(+ cameraFullscreenRegions,+ oldClips,+ newClips,+ () => createId("camfull"),+ ),+ }+ : {}),+ }+ : document.legacyEditor,+ };+}+export function replaceTimeline(document: AxcutDocument,intervals: Interval[],@@ -209,6 +257,7 @@ export function replaceTimeline(}const duration = primaryAssetDuration(document);const normalized = normalizeIntervals(duration, intervals);+ const oldClips = document.timeline.clips;const clips = buildTimelineFromIntervals(assetId, normalized, {origin,reason,@@ -222,7 +271,7 @@ export function replaceTimeline(origin,reason,}));- return {+ const next: AxcutDocument = {...document,timeline: {...document.timeline,@@ -235,6 +284,7 @@ export function replaceTimeline(revision: document.preview.revision + 1,},};+ return oldClips.length > 0 ? reprojectDocumentRegions(next, oldClips, clips) : next;}// ponytail: reorder an existing clip by removing it from its current@@ -263,50 +313,8 @@ export function moveClip(const reordered = [...remaining.slice(0, bounded), movingClip, ...remaining.slice(bounded)];const oldClips = document.timeline.clips;const newClips = resequenceClips(reordered);- // Carry the user's timeline work (zoom/speed/annotation) along with the clip- // it sits on, so reordering clips doesn't strand regions over unrelated- // content. Regions are *ventilated*: a region straddling several clips is- // split into one piece per clip (each following its clip), and pieces that- // stay contiguous after the move are merged back. Trims need no shift — they- // follow via their source anchor.- const legacy = document.legacyEditor as Record<string, unknown> | null;- const speedRegions = legacy?.speedRegions as- | Array<{ id: string; startMs: number; endMs: number }>- | undefined;- const cameraFullscreenRegions = legacy?.cameraFullscreenRegions as- | Array<{ id: string; startMs: number; endMs: number }>- | undefined;- return {+ const next: AxcutDocument = {...document,- zoomRanges: reprojectRegionsForReorder(document.zoomRanges, oldClips, newClips, () =>- createId("zoom"),- ) as AxcutDocument["zoomRanges"],- annotations: reprojectRegionsForReorder(document.annotations, oldClips, newClips, () =>- createId("ann"),- ) as AxcutDocument["annotations"],- legacyEditor:- legacy && (speedRegions || cameraFullscreenRegions)- ? {- ...legacy,- ...(speedRegions- ? {- speedRegions: reprojectRegionsForReorder(speedRegions, oldClips, newClips, () =>- createId("speed"),- ),- }- : {}),- ...(cameraFullscreenRegions- ? {- cameraFullscreenRegions: reprojectRegionsForReorder(- cameraFullscreenRegions,- oldClips,- newClips,- () => createId("camfull"),- ),- }- : {}),- }- : document.legacyEditor,timeline: {...document.timeline,clips: newClips,@@ -316,6 +324,7 @@ export function moveClip(revision: document.preview.revision + 1,},};+ return reprojectDocumentRegions(next, oldClips, newClips);}// ponytail: duplicate a clip (preserves the original). Used for "split this@@ -338,22 +347,21 @@ export function duplicateClip(origin,reason: reason || original.reason,};- const next = [- ...document.timeline.clips.slice(0, index + 1),- copy,- ...document.timeline.clips.slice(index + 1),- ];- return {+ const oldClips = document.timeline.clips;+ const next = [...oldClips.slice(0, index + 1), copy, ...oldClips.slice(index + 1)];+ const newClips = resequenceClips(next);+ const updatedDoc: AxcutDocument = {...document,timeline: {...document.timeline,- clips: resequenceClips(next),+ clips: newClips,},preview: {...document.preview,revision: document.preview.revision + 1,},};+ return reprojectDocumentRegions(updatedDoc, oldClips, newClips);}export function restoreFullTimeline(document: AxcutDocument): AxcutDocument {diff --git a/src/lib/ai-edition/store/useTimeline.test.ts b/src/lib/ai-edition/store/useTimeline.test.tsindex 69d4f361f..d933f6523 100644--- a/src/lib/ai-edition/store/useTimeline.test.ts+++ b/src/lib/ai-edition/store/useTimeline.test.ts@@ -4,10 +4,17 @@ import { useProjectStore } from "./projectStore";import { useTimeline } from "./useTimeline";const probeVideoDurationMock = vi.hoisted(() => vi.fn());+const probeVideoDimensionsMock = vi.hoisted(() =>+ vi.fn().mockResolvedValue({ width: 1920, height: 1080 }),+);vi.mock("../timeline/duration", async (importOriginal) => {const actual = await importOriginal<typeof import("../timeline/duration")>();- return { ...actual, probeVideoDuration: probeVideoDurationMock };+ return {+ ...actual,+ probeVideoDuration: probeVideoDurationMock,+ probeVideoDimensions: probeVideoDimensionsMock,+ };});const bridgeMocks = vi.hoisted(() => ({diff --git a/src/lib/ai-edition/store/useTimeline.ts b/src/lib/ai-edition/store/useTimeline.tsindex 35e7e5dc7..f9a978901 100644--- a/src/lib/ai-edition/store/useTimeline.ts+++ b/src/lib/ai-edition/store/useTimeline.ts@@ -10,6 +10,7 @@ import { createId } from "../document/ids";import {duplicateClip as duplicateClipInDocument,moveClip as moveClipInDocument,+ reprojectDocumentRegions,resequenceClips,} from "../document/timeline";import type { AxcutClipCropRegion, AxcutDocument } from "../schema";@@ -736,16 +737,20 @@ export function useTimeline() {const clamp = (n: number) => (Number.isFinite(n) ? Math.max(0, n) : 0);const s = clamp(sourceStartSec);const e = clamp(sourceEndSec);- const arr = document.timeline.clips.map((c) =>+ const oldClips = document.timeline.clips;+ const arr = oldClips.map((c) =>c.id === clipId? { ...c, sourceStartSec: Math.min(s, e), sourceEndSec: Math.max(s, e) }: c,);+ const newClips = resequenceClips(arr);const next: AxcutDocument = {...document,- timeline: { ...document.timeline, clips: resequenceClips(arr) },+ timeline: { ...document.timeline, clips: newClips },};- await saveDocument(next);+ const finalDoc =+ oldClips.length > 0 ? reprojectDocumentRegions(next, oldClips, newClips) : next;+ await saveDocument(finalDoc);},[document, saveDocument],);@@ -816,18 +821,22 @@ export function useTimeline() {origin: "user" as const,reason: "Split right",};+ const oldClips = document.timeline.clips;const nextClips: AxcutDocument["timeline"]["clips"] = [- ...document.timeline.clips.slice(0, targetIdx),+ ...oldClips.slice(0, targetIdx),left,insert,right as (typeof document.timeline.clips)[number],- ...document.timeline.clips.slice(targetIdx + 1),+ ...oldClips.slice(targetIdx + 1),];+ const newClips = resequenceClips(nextClips);const next: AxcutDocument = {...document,- timeline: { ...document.timeline, clips: nextClips },+ timeline: { ...document.timeline, clips: newClips },};- await saveDocument(next);+ const finalDoc =+ oldClips.length > 0 ? reprojectDocumentRegions(next, oldClips, newClips) : next;+ await saveDocument(finalDoc);},[document, saveDocument, addClipAfter],);@@ -870,9 +879,10 @@ export function useTimeline() {// earlier clips too, corrupting their positions). resequenceClips lays// everything back-to-back from t=0 using each clip's own (now correct)// length, so it's the correct + already-shared way to renormalize.+ const oldClips = doc.timeline.clips;const nextClips = correctDuration? resequenceClips(- doc.timeline.clips.map((c) =>+ oldClips.map((c) =>c.id === clipId? {...c,@@ -882,7 +892,7 @@ export function useTimeline() {: c,),)- : doc.timeline.clips;+ : oldClips;const nextAssets = doc.assets.map((a) => {if (a.id !== assetId) return a;return {@@ -932,14 +942,18 @@ export function useTimeline() {origin: "user",reason: "Inserted from media panel",};- const arr = [...currentDoc.timeline.clips];+ const oldClips = currentDoc.timeline.clips;+ const arr = [...oldClips];const at = Math.max(0, Math.min(arr.length, index));arr.splice(at, 0, newClip);+ const newClips = resequenceClips(arr);const next: AxcutDocument = {...currentDoc,- timeline: { ...currentDoc.timeline, clips: resequenceClips(arr) },+ timeline: { ...currentDoc.timeline, clips: newClips },};- await saveDocument(next);+ const finalDoc =+ oldClips.length > 0 ? reprojectDocumentRegions(next, oldClips, newClips) : next;+ await saveDocument(finalDoc);setClipSelection(newClip.id);// If we used the placeholder, kick off the probe in the background.@@ -986,12 +1000,18 @@ export function useTimeline() {const removeClip = useCallback(async (clipId: string) => {if (!document) return;- const arr = document.timeline.clips.filter((c) => c.id !== clipId);+ const oldClips = document.timeline.clips;+ const arr = oldClips.filter((c) => c.id !== clipId);+ const newClips = resequenceClips(arr);const next: AxcutDocument = {...document,- timeline: { ...document.timeline, clips: resequenceClips(arr) },+ timeline: { ...document.timeline, clips: newClips },};- await saveDocument(next);+ const finalDoc =+ oldClips.length > 0 && newClips.length > 0+ ? reprojectDocumentRegions(next, oldClips, newClips)+ : next;+ await saveDocument(finalDoc);if (clipSelection === clipId) setClipSelection(null);},[document, clipSelection, saveDocument],diff --git a/src/lib/ai-edition/timeline/clipDuration.ts b/src/lib/ai-edition/timeline/clipDuration.tsindex 08011f49e..b79ee6fe5 100644--- a/src/lib/ai-edition/timeline/clipDuration.ts+++ b/src/lib/ai-edition/timeline/clipDuration.ts@@ -22,7 +22,15 @@ import type { AxcutAsset, AxcutClip } from "../schema";* to the timeline-duration formula at step 3.*/export function resolveClipSourceEndSec(clip: AxcutClip, asset: AxcutAsset | undefined): number {- if (clip.sourceEndSec !== undefined) return clip.sourceEndSec;- if (asset?.durationSec !== undefined) return asset.durationSec;+ const assetDuration =+ asset?.durationSec !== undefined && asset.durationSec > 0 ? asset.durationSec : undefined;+ if (clip.sourceEndSec !== undefined) {+ return assetDuration !== undefined+ ? Math.min(clip.sourceEndSec, assetDuration)+ : clip.sourceEndSec;+ }+ if (assetDuration !== undefined) {+ return assetDuration;+ }return clip.sourceStartSec + (clip.timelineEndSec - clip.timelineStartSec);}diff --git a/src/native/nativePlaybackPosition.ts b/src/native/nativePlaybackPosition.tsindex 6e541086d..cbacc3a93 100644--- a/src/native/nativePlaybackPosition.ts+++ b/src/native/nativePlaybackPosition.ts@@ -34,10 +34,8 @@ export function resolveNativePlaybackPosition(const clip = ordered[clipIndex];const unclampedSourceTime = clip.sourceStartSec + (timelineTimeSec - clip.timelineStartSec);- const maxAllowedSourceTime =- clip.sourceEndSec !== undefined- ? Math.max(clip.sourceStartSec, clip.sourceEndSec - 0.033)- : unclampedSourceTime;+ const sourceEnd = clip.sourceEndSec !== undefined ? clip.sourceEndSec : unclampedSourceTime;+ const maxAllowedSourceTime = Math.max(clip.sourceStartSec, sourceEnd - 0.033);return {clip,clipIndex,diff --git a/src/native/sceneDescription.test.ts b/src/native/sceneDescription.test.tsindex c1e6e1ecf..23579343f 100644--- a/src/native/sceneDescription.test.ts+++ b/src/native/sceneDescription.test.ts@@ -251,11 +251,9 @@ describe("buildSceneDescription.clips", () => {expect(clips[0].webcamOffsetSec).toBe((250 + 750) / 1000);});- it("falls back to the screen path and 0 offset when no cameraTrack", () => {- const asset = makeAsset({ id: "a", originalPath: "/screen.mp4", cameraTrack: null });+ it("emits empty webcamPath and 0 offset when no cameraTrack", () => {+ const asset = makeAsset({ originalPath: "/screen.mp4", cameraTrack: null });const clip = makeClip({- id: "c1",- assetId: "a",sourceStartSec: 0,sourceEndSec: 4,timelineStartSec: 0,@@ -264,7 +262,7 @@ describe("buildSceneDescription.clips", () => {const doc = makeDoc({ assets: [asset], clips: [clip] });const { clips } = buildSceneDescription(doc);expect(clips[0].screenPath).toBe("/screen.mp4");- expect(clips[0].webcamPath).toBe("/screen.mp4");+ expect(clips[0].webcamPath).toBe("");expect(clips[0].webcamOffsetSec).toBe(0);});diff --git a/src/native/sceneDescription.ts b/src/native/sceneDescription.tsindex 1f3dbd32e..8ce1a1cc2 100644--- a/src/native/sceneDescription.ts+++ b/src/native/sceneDescription.ts@@ -324,7 +324,7 @@ export function buildSceneDescription(return [{screenPath: asset.originalPath,- webcamPath: cam?.sourcePath ?? asset.originalPath,+ webcamPath: cam && cam.visible && cam.sourcePath ? cam.sourcePath : "",sourceStartSec: clip.sourceStartSec,sourceEndSec: resolveClipSourceEndSec(clip, asset),webcamOffsetSec: cam ? (cam.startMs + cam.offsetMs) / 1000 : 0,