Create polished demo videos without editing skills. Mac/Windows/Linux
merge main into beta/pr410-native-gpu-export-test
wiiiii123618d2134c411
diff --cc src/components/video-editor/SettingsPanel.tsxindex 5e594d95,c0492821..c66f77f8--- a/src/components/video-editor/SettingsPanel.tsx+++ b/src/components/video-editor/SettingsPanel.tsx@@@ -45,7 -45,11 +45,11 @@@ import { useI18n, useScopedT } from "..import type { AppLocale } from "../../i18n/config";import { SUPPORTED_LOCALES } from "../../i18n/config";import { AnnotationSettingsPanel } from "./AnnotationSettingsPanel";- import { CURSOR_MOTION_PRESETS, type CursorMotionPresetId } from "./cursorMotionPresets";+ import {+ CURSOR_MOTION_PRESETS,- getMatchingCursorMotionPresetId,+ type CursorMotionPresetId,++ getMatchingCursorMotionPresetId,+ } from "./cursorMotionPresets";import { loadEditorPreferences, saveEditorPreferences } from "./editorPreferences";import { SliderControl } from "./SliderControl";import { KeyboardShortcutsDialog } from "./TutorialHelp";@@@ -1486,9 -1490,9 +1490,7 @@@ export function SettingsPanel(onCameraSpringDampingMultiplierChange?.(initialEditorPreferences.cameraSpringDampingMultiplier,);-- onCameraSpringMassMultiplierChange?.(-- initialEditorPreferences.cameraSpringMassMultiplier,-- );++ onCameraSpringMassMultiplierChange?.(initialEditorPreferences.cameraSpringMassMultiplier);onZoomInDurationMsChange?.(initialEditorPreferences.zoomInDurationMs);onZoomOutDurationMsChange?.(initialEditorPreferences.zoomOutDurationMs);onZoomClassicModeChange?.(false);@@@ -3003,21 -3004,21 +3002,21 @@@)}</div>)}-- <div className="rounded-lg border border-foreground/10 bg-foreground/[0.03] px-3 py-2">-- <div className="text-[10px] text-muted-foreground">-- {showDevMotionControls-- ? tSettings(-- "effects.exportBlurMovedToDev",-- "Export blur tuning is available in Settings > Dev.",-- )-- : tSettings(-- "effects.exportBlurLocked",-- "Export blur is fixed for this build.",-- )}-- </div>-- <div className="mt-1 text-[12px] font-medium text-foreground">-- {`${TEMPORAL_MOTION_BLUR_DEFAULT_SAMPLE_COUNT} samples · ${Math.round(TEMPORAL_MOTION_BLUR_DEFAULT_SHUTTER_FRACTION * 100)}% shutter`}-- </div>++ <div className="rounded-lg border border-foreground/10 bg-foreground/[0.03] px-3 py-2">++ <div className="text-[10px] text-muted-foreground">++ {showDevMotionControls++ ? tSettings(++ "effects.exportBlurMovedToDev",++ "Export blur tuning is available in Settings > Dev.",++ )++ : tSettings(++ "effects.exportBlurLocked",++ "Export blur is fixed for this build.",++ )}++ </div>++ <div className="mt-1 text-[12px] font-medium text-foreground">++ {`${TEMPORAL_MOTION_BLUR_DEFAULT_SAMPLE_COUNT} samples · ${Math.round(TEMPORAL_MOTION_BLUR_DEFAULT_SHUTTER_FRACTION * 100)}% shutter`}++ </div></div>{selectedZoomId && (<Buttondiff --cc src/components/video-editor/audio.test.tsindex 60a46f8a,b0510396..18e11b30--- a/src/components/video-editor/audio.test.ts+++ b/src/components/video-editor/audio.test.ts@@@ -235,3 -236,57 +236,55 @@@ describe("Audio region normalization",});});});++ describe("Motion preset normalization", () => {+ it("preserves the smooth preset when the saved values match it exactly", () => {+ const smooth = CURSOR_MOTION_PRESETS.smooth;+ const result = normalizeProjectEditor({+ zoomInDurationMs: smooth.zoomInDurationMs,+ zoomOutDurationMs: smooth.zoomOutDurationMs,+ cursorSize: smooth.cursorSize,+ cursorSmoothing: smooth.cursorSmoothing,+ cursorSpringStiffnessMultiplier: smooth.cursorSpringStiffnessMultiplier,+ cursorSpringDampingMultiplier: smooth.cursorSpringDampingMultiplier,+ cursorSpringMassMultiplier: smooth.cursorSpringMassMultiplier,+ cursorMotionBlur: smooth.cursorMotionBlur,+ cursorClickBounce: smooth.cursorClickBounce,+ cursorClickBounceDuration: smooth.cursorClickBounceDuration,+ } as any);++ expect(result.zoomInDurationMs).toBe(smooth.zoomInDurationMs);+ expect(result.zoomOutDurationMs).toBe(smooth.zoomOutDurationMs);- expect(result.cursorSpringStiffnessMultiplier).toBe(- smooth.cursorSpringStiffnessMultiplier,- );++ expect(result.cursorSpringStiffnessMultiplier).toBe(smooth.cursorSpringStiffnessMultiplier);+ expect(result.cursorSpringDampingMultiplier).toBe(smooth.cursorSpringDampingMultiplier);+ });++ it("falls back to focused when the saved values do not match a supported preset", () => {+ const focused = CURSOR_MOTION_PRESETS.focused;+ const result = normalizeProjectEditor({+ zoomInDurationMs: 275,+ zoomOutDurationMs: 410,+ cursorSize: 3.25,+ cursorSmoothing: 0.52,+ cursorSpringStiffnessMultiplier: 1.1,+ cursorSpringDampingMultiplier: 1.05,+ cursorSpringMassMultiplier: 1.6,+ cursorMotionBlur: 0.9,+ cursorClickBounce: 2.25,+ cursorClickBounceDuration: 280,+ } as any);++ expect(result.zoomInDurationMs).toBe(focused.zoomInDurationMs);+ expect(result.zoomOutDurationMs).toBe(focused.zoomOutDurationMs);+ expect(result.cursorSize).toBe(focused.cursorSize);+ expect(result.cursorSmoothing).toBe(focused.cursorSmoothing);+ expect(result.cursorSpringStiffnessMultiplier).toBe(+ focused.cursorSpringStiffnessMultiplier,+ );+ expect(result.cursorSpringDampingMultiplier).toBe(focused.cursorSpringDampingMultiplier);+ expect(result.cursorSpringMassMultiplier).toBe(focused.cursorSpringMassMultiplier);+ expect(result.cursorMotionBlur).toBe(focused.cursorMotionBlur);+ expect(result.cursorClickBounce).toBe(focused.cursorClickBounce);+ expect(result.cursorClickBounceDuration).toBe(focused.cursorClickBounceDuration);+ });+ });diff --cc src/components/video-editor/editorPreferences.test.tsindex efbc6f64,efbc6f64..ca1378dd--- a/src/components/video-editor/editorPreferences.test.ts+++ b/src/components/video-editor/editorPreferences.test.ts@@@ -4,11 -4,11 +4,11 @@@ importDEFAULT_EDITOR_PREFERENCES,EDITOR_PREFERENCES_STORAGE_KEY,EDITOR_PRESETS_STORAGE_KEY,-- loadEditorPresets,loadEditorPreferences,++ loadEditorPresets,normalizeEditorPreferences,-- saveEditorPresets,saveEditorPreferences,++ saveEditorPresets,} from "./editorPreferences";import { DEFAULT_AUTO_CAPTION_SETTINGS } from "./types";@@@ -223,11 -223,11 +223,11 @@@ describe("editorPreferences", () =>showCursor: false,loopCursor: true,cursorStyle: "figma",-- cursorSize: 3,-- cursorSmoothing: 1.25,-- cursorMotionBlur: 0.5,-- cursorClickBounce: 2.25,-- cursorClickBounceDuration: 350,++ cursorSize: DEFAULT_EDITOR_PREFERENCES.cursorSize,++ cursorSmoothing: DEFAULT_EDITOR_PREFERENCES.cursorSmoothing,++ cursorMotionBlur: DEFAULT_EDITOR_PREFERENCES.cursorMotionBlur,++ cursorClickBounce: DEFAULT_EDITOR_PREFERENCES.cursorClickBounce,++ cursorClickBounceDuration: DEFAULT_EDITOR_PREFERENCES.cursorClickBounceDuration,cursorSway: 1.5,borderRadius: 18,padding: { top: 30, right: 30, bottom: 30, left: 30, linked: true },diff --cc src/components/video-editor/timeline/TimelineEditor.tsxindex 740d01cb,f58353a2..f79757e7--- a/src/components/video-editor/timeline/TimelineEditor.tsx+++ b/src/components/video-editor/timeline/TimelineEditor.tsx@@@ -1236,12 -1235,12 +1235,7 @@@ const TimelineEditor = forwardRef<TimelonSelectAnnotation?.(null);onSelectAudio?.(null);setSelectAllBlocksActive(false);-- }, [-- onSelectAnnotation,-- onSelectAudio,-- onSelectClip,-- onSelectZoom,-- ]);++ }, [onSelectAnnotation, onSelectAudio, onSelectClip, onSelectZoom]);const hasAnyTimelineBlocks =zoomRegions.length > 0 ||@@@ -1479,7 -1478,7 +1473,9 @@@const activeClip =clipRegions.length === 0? { startMs: 0, endMs: totalMs }-- : clipRegions.find((clip) => startPos >= clip.startMs && startPos < clip.endMs);++ : clipRegions.find(++ (clip) => startPos >= clip.startMs && startPos < clip.endMs,++ );if (!activeClip) {return false;}@@@ -1487,7 -1486,7 +1483,9 @@@const sorted = [...zoomRegions].sort((a, b) => a.startMs - b.startMs);const nextRegion = sorted.find((region) => region.startMs > startPos);const gapToNextClipEdge = activeClip.endMs - startPos;-- const gapToNextRegion = nextRegion ? nextRegion.startMs - startPos : gapToNextClipEdge;++ const gapToNextRegion = nextRegion++ ? nextRegion.startMs - startPos++ : gapToNextClipEdge;const availableDuration = Math.min(gapToNextClipEdge, gapToNextRegion);const isOverlapping = sorted.some(diff --cc src/contexts/I18nContext.tsxindex 90c462de,ebca62da..9da6ab0c--- a/src/contexts/I18nContext.tsx+++ b/src/contexts/I18nContext.tsx@@@ -154,7 -154,7 +154,7 @@@ const messages: Record<AppLocale, Localshortcuts: zhCNShortcuts,extensions: zhCNExtensions,},-- "zh-TW": {++ "zh-TW": {common: zhTWCommon,launch: zhTWLaunch,editor: zhTWEditor,diff --cc src/lib/exporter/modernVideoExporter.tsindex 263c5721,ea0bd38e..501dd2b9--- a/src/lib/exporter/modernVideoExporter.ts+++ b/src/lib/exporter/modernVideoExporter.ts@@@ -1172,31 -825,34 +1172,36 @@@ export class ModernVideoExporter) {const sourceDurationMs = Math.max(0,- Math.round((videoInfo.streamDuration ?? videoInfo.duration) * 1000),+ Math.round(+ getEffectiveVideoStreamDurationSeconds({+ duration: videoInfo.duration,+ streamDuration: videoInfo.streamDuration,+ }) * 1000,+ ),);const trimRegions = this.config.trimRegions ?? [];- const strategy =- videoInfo.hasAudio &&- localVideoSourcePath &&- sourceAudioFallbackPaths.length === 0 &&- typeof videoInfo.audioSampleRate === "number" &&- Number.isFinite(videoInfo.audioSampleRate) &&- videoInfo.audioSampleRate > 0- ? classifyEditedTrackStrategy({- primaryAudioSourcePath,- sourceDurationMs,- trimRegions,- speedRegions,- audioRegions,- sourceAudioFallbackPaths,- })- : "offline-render-fallback";+ const canUsePrimaryAudioFiltergraph =+ Boolean(primaryAudioSourcePath) &&+ !hasTimedSourceAudioFallback &&+ (usesEmbeddedPrimaryAudio ||+ sourceAudioFallbackPaths.includes(primaryAudioSourcePath ?? "")) &&+ typeof primaryAudioSourceSampleRate === "number" &&+ Number.isFinite(primaryAudioSourceSampleRate) &&+ primaryAudioSourceSampleRate > 0;+ const strategy = canUsePrimaryAudioFiltergraph+ ? classifyEditedTrackStrategy({+ primaryAudioSourcePath,+ sourceDurationMs,+ trimRegions,+ speedRegions,+ audioRegions,+ sourceAudioFallbackPaths,+ })+ : "offline-render-fallback";if (strategy === "filtergraph-fast-path") {- const audioSourcePath = localVideoSourcePath;- const audioSourceSampleRate = videoInfo.audioSampleRate;+ const audioSourcePath = primaryAudioSourcePath;+ const audioSourceSampleRate = primaryAudioSourceSampleRate;const editedTrackSegments = buildEditedTrackSourceSegments(sourceDurationMs,trimRegions,diff --cc src/lib/exporter/videoExporter.tsindex a83bf115,a09b2736..cf8f6337--- a/src/lib/exporter/videoExporter.ts+++ b/src/lib/exporter/videoExporter.ts@@@ -191,8 -187,7 +192,7 @@@ export class VideoExporterconst shouldUseFfmpegAudioFallback =!useNativeEncoder &&audioPlan.audioMode !== "none" &&- (shouldUsePitchPreservingFfmpegAudio ||- !(await isAacAudioEncodingSupported()));- !(await isAacAudioEncodingSupported());++ (shouldUsePitchPreservingFfmpegAudio || !(await isAacAudioEncodingSupported()));if (!useNativeEncoder) {await this.initializeEncoder();@@@ -564,32 -552,34 +564,36 @@@) {const sourceDurationMs = Math.max(0,- Math.round((videoInfo.streamDuration ?? videoInfo.duration) * 1000),+ Math.round(+ getEffectiveVideoStreamDurationSeconds({+ duration: videoInfo.duration,+ streamDuration: videoInfo.streamDuration,+ }) * 1000,+ ),);const trimRegions = this.config.trimRegions ?? [];- const strategy =- videoInfo.hasAudio &&- localVideoSourcePath &&- sourceAudioFallbackPaths.length === 0 &&- typeof videoInfo.audioSampleRate === "number" &&- Number.isFinite(videoInfo.audioSampleRate) &&- videoInfo.audioSampleRate > 0- ? classifyEditedTrackStrategy({- primaryAudioSourcePath,- sourceDurationMs,- trimRegions,- speedRegions,- audioRegions,- sourceAudioFallbackPaths,- })- : "offline-render-fallback";+ const canUsePrimaryAudioFiltergraph =+ Boolean(primaryAudioSourcePath) &&+ !hasTimedSourceAudioFallback &&+ (usesEmbeddedPrimaryAudio ||+ sourceAudioFallbackPaths.includes(primaryAudioSourcePath ?? "")) &&+ typeof primaryAudioSourceSampleRate === "number" &&+ Number.isFinite(primaryAudioSourceSampleRate) &&+ primaryAudioSourceSampleRate > 0;- const strategy =- canUsePrimaryAudioFiltergraph- ? classifyEditedTrackStrategy({- primaryAudioSourcePath,- sourceDurationMs,- trimRegions,- speedRegions,- audioRegions,- sourceAudioFallbackPaths,- })- : "offline-render-fallback";++ const strategy = canUsePrimaryAudioFiltergraph++ ? classifyEditedTrackStrategy({++ primaryAudioSourcePath,++ sourceDurationMs,++ trimRegions,++ speedRegions,++ audioRegions,++ sourceAudioFallbackPaths,++ })++ : "offline-render-fallback";if (strategy === "filtergraph-fast-path") {- const audioSourcePath = localVideoSourcePath;- const audioSourceSampleRate = videoInfo.audioSampleRate;+ const audioSourcePath = primaryAudioSourcePath;+ const audioSourceSampleRate = primaryAudioSourceSampleRate;const editedTrackSegments = buildEditedTrackSourceSegments(sourceDurationMs,trimRegions,