Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

Address PR nits

webadderall7c97867020e6
diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx
index 66d2b0f3..5e594d95 100644
--- a/src/components/video-editor/SettingsPanel.tsx
+++ b/src/components/video-editor/SettingsPanel.tsx
@@ -1480,6 +1480,15 @@ export function SettingsPanel({
const resetZoomSection = () => {
onZoomMotionBlurTuningChange?.(initialEditorPreferences.zoomMotionBlurTuning);
+ onCameraSpringStiffnessMultiplierChange?.(
+ initialEditorPreferences.cameraSpringStiffnessMultiplier,
+ );
+ onCameraSpringDampingMultiplierChange?.(
+ initialEditorPreferences.cameraSpringDampingMultiplier,
+ );
+ onCameraSpringMassMultiplierChange?.(
+ initialEditorPreferences.cameraSpringMassMultiplier,
+ );
onZoomInDurationMsChange?.(initialEditorPreferences.zoomInDurationMs);
onZoomOutDurationMsChange?.(initialEditorPreferences.zoomOutDurationMs);
onZoomClassicModeChange?.(false);
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx
index a82cd153..269eebaf 100644
--- a/src/components/video-editor/VideoEditor.tsx
+++ b/src/components/video-editor/VideoEditor.tsx
@@ -1413,6 +1413,7 @@ export default function VideoEditor() {
zoomInEasing,
zoomInOverlapMs,
zoomMotionBlur,
+ zoomMotionBlurTuning,
zoomTemporalMotionBlur,
zoomMotionBlurSampleCount,
zoomMotionBlurShutterFraction,
@@ -2139,11 +2140,10 @@ export default function VideoEditor() {
setZoomOutDurationMs(normalizedEditor.zoomOutDurationMs);
setConnectedZoomGapMs(normalizedEditor.connectedZoomGapMs);
setConnectedZoomDurationMs(normalizedEditor.connectedZoomDurationMs);
- setZoomInEasing(normalizedEditor.zoomInEasing);
- setZoomOutEasing(normalizedEditor.zoomOutEasing);
- setConnectedZoomEasing(normalizedEditor.connectedZoomEasing);
- setSessionShowCursorOverride(null);
- setShowCursor(normalizedEditor.showCursor);
+ setZoomInEasing(normalizedEditor.zoomInEasing);
+ setZoomOutEasing(normalizedEditor.zoomOutEasing);
+ setConnectedZoomEasing(normalizedEditor.connectedZoomEasing);
+ setShowCursor(normalizedEditor.showCursor);
setLoopCursor(normalizedEditor.loopCursor);
setCursorStyle(normalizedEditor.cursorStyle);
setCursorSize(normalizedEditor.cursorSize);
diff --git a/src/components/video-editor/VideoPlayback.tsx b/src/components/video-editor/VideoPlayback.tsx
index 18fae01e..764eef78 100644
--- a/src/components/video-editor/VideoPlayback.tsx
+++ b/src/components/video-editor/VideoPlayback.tsx
@@ -1296,6 +1296,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
return;
}
+ motionBlurStateRef.current = createMotionBlurState();
videoEffectsContainer.filters =
zoomMotionBlur > 0 ? [motionBlurFilter, zoomBlurFilter] : null;
}, [zoomMotionBlur]);
@@ -1385,7 +1386,6 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
zoomScale: 1,
focusX: DEFAULT_FOCUS.cx,
focusY: DEFAULT_FOCUS.cy,
- motionIntensity: 0,
isPlaying: false,
motionBlurAmount: 0,
motionBlurState: motionBlurStateRef.current,
@@ -1780,8 +1780,6 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
const applyTransform = (
transform: { scale: number; x: number; y: number },
focus: ZoomFocus,
- motionIntensity: number,
- motionVector: { x: number; y: number },
) => {
const cameraContainer = cameraContainerRef.current;
if (!cameraContainer) return;
@@ -1798,8 +1796,6 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
zoomProgress: state.progress,
focusX: focus.cx,
focusY: focus.cy,
- motionIntensity,
- motionVector,
isPlaying: isPlayingRef.current,
motionBlurAmount: zoomMotionBlurRef.current,
motionBlurTuning: zoomMotionBlurTuningRef.current,
@@ -1903,9 +1899,6 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
}
const state = animationStateRef.current;
- const prevScale = state.appliedScale;
- const prevX = state.x;
- const prevY = state.y;
state.scale = targetScaleFactor;
state.focusX = targetFocus.cx;
@@ -1976,22 +1969,9 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
resetSpringState(springYRef.current, appliedY);
}
- const motionIntensity = Math.max(
- Math.abs(appliedScale - prevScale),
- Math.abs(appliedX - prevX) / Math.max(1, stageSizeRef.current.width),
- Math.abs(appliedY - prevY) / Math.max(1, stageSizeRef.current.height),
- );
-
- const motionVector = {
- x: appliedX - prevX,
- y: appliedY - prevY,
- };
-
applyTransform(
{ scale: appliedScale, x: appliedX, y: appliedY },
targetFocus,
- motionIntensity,
- motionVector,
);
applyWebcamBubbleLayout(animationStateRef.current.appliedScale || 1);
diff --git a/src/components/video-editor/videoPlayback/motionSmoothing.ts b/src/components/video-editor/videoPlayback/motionSmoothing.ts
index 60dce08f..6ffed00e 100644
--- a/src/components/video-editor/videoPlayback/motionSmoothing.ts
+++ b/src/components/video-editor/videoPlayback/motionSmoothing.ts
@@ -272,17 +272,20 @@ export function getCursorSpringConfig(
}, tuning);
}
-export function getZoomSpringConfig(smoothnessFactor = 0.5): SpringConfig {
+export function getZoomSpringConfig(
+ smoothnessFactor = 0.5,
+ tuning?: CursorSpringTuning,
+): SpringConfig {
const clamped = Math.max(0, Math.min(1, smoothnessFactor));
if (clamped <= 0) {
- return {
+ return applyCursorSpringTuning({
stiffness: 1000,
damping: 100,
mass: 1,
restDelta: 0.0001,
restSpeed: 0.001,
- };
+ }, tuning);
}
// Map 0-1 slider to the internal 0-2 spring range so that
@@ -294,11 +297,11 @@ export function getZoomSpringConfig(smoothnessFactor = 0.5): SpringConfig {
// The overshoot clamp in stepSpringValue prevents wobble even at
// this low damping, so animations stay fast and responsive.
// Higher scaled → lower stiffness + higher mass → slower, floatier settle.
- return {
+ return applyCursorSpringTuning({
stiffness: 100 / scaled,
damping: 21,
mass: 1.0 * scaled,
restDelta: 0.0005,
restSpeed: 0.015,
- };
+ }, tuning);
}
diff --git a/src/components/video-editor/videoPlayback/zoomTransform.test.ts b/src/components/video-editor/videoPlayback/zoomTransform.test.ts
index 4d3f5677..6031977a 100644
--- a/src/components/video-editor/videoPlayback/zoomTransform.test.ts
+++ b/src/components/video-editor/videoPlayback/zoomTransform.test.ts
@@ -32,7 +32,6 @@ describe("applyZoomTransform motion blur routing", () => {
zoomScale: 1,
focusX: 0.5,
focusY: 0.5,
- motionIntensity: 0,
isPlaying: true,
motionBlurAmount: 1,
motionBlurState,
@@ -82,7 +81,6 @@ describe("applyZoomTransform motion blur routing", () => {
zoomScale: 1,
focusX,
focusY,
- motionIntensity: 0,
isPlaying: true,
motionBlurAmount: 1,
motionBlurState,
@@ -104,7 +102,6 @@ describe("applyZoomTransform motion blur routing", () => {
zoomScale: 1.7,
focusX,
focusY,
- motionIntensity: 0,
isPlaying: true,
motionBlurAmount: 1,
motionBlurState,
diff --git a/src/components/video-editor/videoPlayback/zoomTransform.ts b/src/components/video-editor/videoPlayback/zoomTransform.ts
index 6365e9e7..65fe8ce7 100644
--- a/src/components/video-editor/videoPlayback/zoomTransform.ts
+++ b/src/components/video-editor/videoPlayback/zoomTransform.ts
@@ -35,8 +35,6 @@ interface TransformParams {
zoomProgress?: number;
focusX: number;
focusY: number;
- motionIntensity: number;
- motionVector?: { x: number; y: number };
isPlaying: boolean;
motionBlurAmount?: number;
motionBlurTuning?: ZoomMotionBlurTuning;
@@ -471,8 +469,6 @@ export function applyZoomTransform({
zoomProgress = 1,
focusX,
focusY,
- motionIntensity: _motionIntensity,
- motionVector: _motionVector,
isPlaying,
motionBlurAmount = 0,
motionBlurTuning,
diff --git a/src/lib/exporter/frameRenderer.ts b/src/lib/exporter/frameRenderer.ts
index 3bc4addb..e8e61a48 100644
--- a/src/lib/exporter/frameRenderer.ts
+++ b/src/lib/exporter/frameRenderer.ts
@@ -233,7 +233,6 @@ export class FrameRenderer {
private motionBlurState: MotionBlurState;
private layoutCache: LayoutCache | null = null;
private currentVideoTime = 0;
- private lastMotionVector = { x: 0, y: 0 };
private springScale: SpringState;
private springX: SpringState;
private springY: SpringState;
@@ -1449,13 +1448,10 @@ export class FrameRenderer {
const TICKS_PER_FRAME = 1;
- let maxMotionIntensity = 0;
for (let i = 0; i < TICKS_PER_FRAME; i++) {
- const motionIntensity = this.updateAnimationState(timeMs);
- maxMotionIntensity = Math.max(maxMotionIntensity, motionIntensity);
+ this.updateAnimationState(timeMs);
}
- // Apply transform once with maximum motion intensity from all ticks
applyZoomTransform({
cameraContainer: this.cameraContainer,
zoomBlurFilter: this.zoomBlurFilter,
@@ -1466,8 +1462,6 @@ export class FrameRenderer {
zoomProgress: this.animationState.progress,
focusX: this.animationState.focusX,
focusY: this.animationState.focusY,
- motionIntensity: maxMotionIntensity,
- motionVector: this.lastMotionVector,
isPlaying: true,
motionBlurAmount: this.config.zoomMotionBlur ?? 0,
motionBlurTuning: this.config.zoomMotionBlurTuning,
@@ -1876,11 +1870,6 @@ export class FrameRenderer {
);
}
- this.lastMotionVector = {
- x: state.x - prevX,
- y: state.y - prevY,
- };
-
return Math.max(
Math.abs(state.appliedScale - prevScale),
Math.abs(state.x - prevX) / Math.max(1, this.layoutCache.stageSize.width),
@@ -1931,7 +1920,7 @@ export class FrameRenderer {
},
);
- const motionIntensity = this.updateAnimationState(timeMs);
+ this.updateAnimationState(timeMs);
applyZoomTransform({
cameraContainer: this.cameraContainer,
@@ -1943,8 +1932,6 @@ export class FrameRenderer {
zoomProgress: this.animationState.progress,
focusX: this.animationState.focusX,
focusY: this.animationState.focusY,
- motionIntensity,
- motionVector: this.lastMotionVector,
isPlaying: true,
motionBlurAmount: useVelocityMotionBlur ? (this.config.zoomMotionBlur ?? 0) : 0,
motionBlurTuning: this.config.zoomMotionBlurTuning,
diff --git a/src/lib/exporter/modernFrameRenderer.ts b/src/lib/exporter/modernFrameRenderer.ts
index c1ca62a3..11342a83 100644
--- a/src/lib/exporter/modernFrameRenderer.ts
+++ b/src/lib/exporter/modernFrameRenderer.ts
@@ -402,7 +402,6 @@ export class FrameRenderer {
private lastContentTimeMs: number | null = null;
private layoutCache: LayoutCache | null = null;
private currentVideoTime = 0;
- private lastMotionVector = { x: 0, y: 0 };
private cursorOverlay: PixiCursorOverlay | null = null;
private lastSyncedWebcamTime: number | null = null;
private lastWebcamCacheRefreshTime: number | null = null;
@@ -2521,7 +2520,7 @@ export class FrameRenderer {
);
}
- const motionIntensity = this.updateAnimationState(timeMs);
+ this.updateAnimationState(timeMs);
applyZoomTransform({
cameraContainer: this.cameraContainer,
@@ -2533,8 +2532,6 @@ export class FrameRenderer {
zoomProgress: this.animationState.progress,
focusX: this.animationState.focusX,
focusY: this.animationState.focusY,
- motionIntensity,
- motionVector: this.lastMotionVector,
isPlaying: true,
motionBlurAmount: useVelocityMotionBlur ? (this.config.zoomMotionBlur ?? 0) : 0,
motionBlurTuning: this.config.zoomMotionBlurTuning,
@@ -2770,9 +2767,7 @@ export class FrameRenderer {
);
}
- let maxMotionIntensity = 0;
- const motionIntensity = this.updateAnimationState(timeMs);
- maxMotionIntensity = Math.max(maxMotionIntensity, motionIntensity);
+ this.updateAnimationState(timeMs);
applyZoomTransform({
cameraContainer: this.cameraContainer,
@@ -2784,8 +2779,6 @@ export class FrameRenderer {
zoomProgress: this.animationState.progress,
focusX: this.animationState.focusX,
focusY: this.animationState.focusY,
- motionIntensity: maxMotionIntensity,
- motionVector: this.lastMotionVector,
isPlaying: true,
motionBlurAmount: this.config.zoomMotionBlur ?? 0,
motionBlurTuning: this.config.zoomMotionBlurTuning,
@@ -3288,11 +3281,6 @@ export class FrameRenderer {
);
}
- this.lastMotionVector = {
- x: state.x - previousX,
- y: state.y - previousY,
- };
-
return Math.max(
Math.abs(state.appliedScale - previousScale),
Math.abs(state.x - previousX) / Math.max(1, this.layoutCache.stageSize.width),