Skip to content

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

chore(export): surface native skip diagnostics

wiiiii1239a90dfb9d8cc
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx
index 20e9da77..609f09d7 100644
--- a/src/components/video-editor/VideoEditor.tsx
+++ b/src/components/video-editor/VideoEditor.tsx
@@ -5230,9 +5230,21 @@ export default function VideoEditor() {
return encoderName ? `${pathLabel} (${encoderName})` : pathLabel;
}, [exportProgress]);
- const exportNativeSkipLabel = exportProgress?.nativeStaticLayoutSkipReason
- ? `Native skipped: ${exportProgress.nativeStaticLayoutSkipReason}`
- : null;
+ const exportNativeSkipReasons =
+ exportProgress?.nativeStaticLayoutSkipReasons &&
+ exportProgress.nativeStaticLayoutSkipReasons.length > 0
+ ? exportProgress.nativeStaticLayoutSkipReasons
+ : exportProgress?.nativeStaticLayoutSkipReason
+ ? [exportProgress.nativeStaticLayoutSkipReason]
+ : [];
+ const exportNativeSkipLabel =
+ exportNativeSkipReasons.length > 0
+ ? `Native skipped: ${exportNativeSkipReasons[0]}${
+ exportNativeSkipReasons.length > 1
+ ? ` (+${exportNativeSkipReasons.length - 1} more)`
+ : ""
+ }`
+ : null;
const exportPercentLabel = exportProgress
? isExportPreparing
? t("editor.exportStatus.preparing", "Preparing export...")
diff --git a/src/lib/exporter/modernVideoExporter.nativeStaticLayout.test.ts b/src/lib/exporter/modernVideoExporter.nativeStaticLayout.test.ts
index 9db31fb1..1ea75f84 100644
--- a/src/lib/exporter/modernVideoExporter.nativeStaticLayout.test.ts
+++ b/src/lib/exporter/modernVideoExporter.nativeStaticLayout.test.ts
@@ -53,6 +53,11 @@ function createExporter(overrides: Record<string, unknown> = {}) {
videoInfo: DecodedVideoInfo,
effectiveDurationSec: number,
) => string | null;
+ getNativeStaticLayoutSkipReasons: (
+ audioPlan: unknown,
+ videoInfo: DecodedVideoInfo,
+ effectiveDurationSec: number,
+ ) => string[];
resolveNativeStaticLayoutBackground: () => Promise<unknown>;
createNativeStaticLayoutGradient: (
ctx: CanvasRenderingContext2D,
@@ -274,6 +279,39 @@ describe("ModernVideoExporter native static-layout eligibility", () => {
).toBe("unsupported-background-video");
});
+ it("collects every native static-layout blocker for beta diagnostics", () => {
+ const exporter = createExporter({
+ width: 1921,
+ wallpaper: "file:///C:/Recordly/background.webm",
+ speedRegions: [{ id: "speed-1", startMs: 1_000, endMs: 4_000, speed: 1.5 }],
+ annotationRegions: [{ id: "annotation-1", startMs: 0, endMs: 1_000 }],
+ autoCaptions: [{ id: "caption-1", text: "hello", startMs: 0, endMs: 1_000 }],
+ webcam: { enabled: true },
+ frame: "macbook",
+ cropRegion: { top: 0.1, bottom: 0, left: 0, right: 0 },
+ });
+
+ expect(
+ exporter.getNativeStaticLayoutSkipReasons(
+ {
+ audioMode: "edited-track",
+ strategy: "offline-render-fallback",
+ },
+ videoInfo,
+ 59,
+ ),
+ ).toEqual([
+ "odd-output-dimensions",
+ "unsupported-background-video",
+ "native-speed-timeline-validation-pending",
+ "unsupported-annotation-overlay",
+ "unsupported-caption-overlay",
+ "unsupported-webcam-source",
+ "unsupported-frame-overlay",
+ "non-default-crop",
+ ]);
+ });
+
it("materializes uploaded data-url image backgrounds for native static-layout", async () => {
const jpegBytes = new Uint8Array([0xff, 0xd8, 0xff, 0xd9]);
const dataUrl = `data:image/jpeg;base64,${Buffer.from(jpegBytes).toString("base64")}`;
diff --git a/src/lib/exporter/modernVideoExporter.ts b/src/lib/exporter/modernVideoExporter.ts
index 50a777c1..6d8f92c9 100644
--- a/src/lib/exporter/modernVideoExporter.ts
+++ b/src/lib/exporter/modernVideoExporter.ts
@@ -283,6 +283,7 @@ export class ModernVideoExporter {
private maxNativeWriteInFlight = 1;
private lastNativeExportError: string | null = null;
private nativeStaticLayoutSkipReason: string | null = null;
+ private nativeStaticLayoutSkipReasons: string[] = [];
private nativeStaticLayoutBackgroundSkipReason: string | null = null;
private nativeH264Encoder: VideoEncoder | null = null;
private nativeEncoderError: Error | null = null;
@@ -321,6 +322,7 @@ export class ModernVideoExporter {
this.encoderError = null;
this.nativeEncoderError = null;
this.nativeStaticLayoutSkipReason = null;
+ this.nativeStaticLayoutSkipReasons = [];
this.nativeStaticLayoutBackgroundSkipReason = null;
this.totalExportStartTimeMs = this.getNowMs();
const backendPreference = this.config.backendPreference ?? "auto";
@@ -1215,34 +1217,35 @@ export class ModernVideoExporter {
}
}
- private getNativeStaticLayoutSkipReason(
+ private getNativeStaticLayoutSkipReasons(
audioPlan: NativeAudioPlan,
videoInfo: DecodedVideoInfo,
effectiveDurationSec: number,
- ): string | null {
+ ): string[] {
+ const reasons: string[] = [];
if (
typeof window === "undefined" ||
!window.electronAPI?.nativeStaticLayoutExport ||
!window.electronAPI?.nativeStaticLayoutExportCancel
) {
- return "native-static-api-unavailable";
+ reasons.push("native-static-api-unavailable");
}
if (this.config.width % 2 !== 0 || this.config.height % 2 !== 0) {
- return "odd-output-dimensions";
+ reasons.push("odd-output-dimensions");
}
if (!this.canUseNativeStaticLayoutAudioPlan(audioPlan)) {
- return `unsupported-audio-mode:${audioPlan.audioMode}`;
+ reasons.push(`unsupported-audio-mode:${audioPlan.audioMode}`);
}
const speedRegions = this.config.speedRegions ?? [];
const configuredWallpaper = this.config.wallpaper?.trim() ?? "";
if (isVideoWallpaperSource(configuredWallpaper)) {
- return "unsupported-background-video";
+ reasons.push("unsupported-background-video");
}
if (speedRegions.length > 0) {
- return "native-speed-timeline-validation-pending";
+ reasons.push("native-speed-timeline-validation-pending");
}
const hasZoomRegions = (this.config.zoomRegions ?? []).length > 0;
@@ -1251,35 +1254,49 @@ export class ModernVideoExporter {
effectiveDurationSec,
);
if (needsTimelineMap && this.config.experimentalNativeExport !== true) {
- return "native-timeline-requires-windows-gpu";
+ reasons.push("native-timeline-requires-windows-gpu");
}
if (
+ speedRegions.length === 0 &&
needsTimelineMap &&
this.buildNativeStaticLayoutVideoTimelineSegments(videoInfo).length === 0
) {
- return speedRegions.length > 0
- ? "unsupported-native-speed-timeline"
- : "unsupported-native-trim-timeline";
+ reasons.push("unsupported-native-trim-timeline");
}
if (hasZoomRegions && this.config.experimentalNativeExport !== true) {
- return "native-zoom-requires-windows-gpu";
+ reasons.push("native-zoom-requires-windows-gpu");
}
if ((this.config.annotationRegions ?? []).length > 0) {
- return "unsupported-annotation-overlay";
+ reasons.push("unsupported-annotation-overlay");
}
if ((this.config.autoCaptions ?? []).length > 0) {
- return "unsupported-caption-overlay";
+ reasons.push("unsupported-caption-overlay");
}
if (this.config.webcam?.enabled && !this.getNativeWebcamSourcePath()) {
- return "unsupported-webcam-source";
+ reasons.push("unsupported-webcam-source");
}
if (this.config.frame) {
- return "unsupported-frame-overlay";
+ reasons.push("unsupported-frame-overlay");
+ }
+
+ if (!this.isDefaultCropRegion()) {
+ reasons.push("non-default-crop");
}
- return this.isDefaultCropRegion() ? null : "non-default-crop";
+ return reasons;
+ }
+
+ private getNativeStaticLayoutSkipReason(
+ audioPlan: NativeAudioPlan,
+ videoInfo: DecodedVideoInfo,
+ effectiveDurationSec: number,
+ ): string | null {
+ return (
+ this.getNativeStaticLayoutSkipReasons(audioPlan, videoInfo, effectiveDurationSec)[0] ??
+ null
+ );
}
private async resolveNativeStaticLayoutBackground(): Promise<NativeStaticLayoutBackground | null> {
@@ -1950,10 +1967,15 @@ export class ModernVideoExporter {
videoInfo,
effectiveDuration,
);
+ const skipReasons = skipReason
+ ? this.getNativeStaticLayoutSkipReasons(audioPlan, videoInfo, effectiveDuration)
+ : [];
if (skipReason) {
this.nativeStaticLayoutSkipReason = skipReason;
+ this.nativeStaticLayoutSkipReasons = skipReasons;
console.info("[VideoExporter] Native static layout skipped", {
reason: skipReason,
+ reasons: skipReasons,
audioMode: audioPlan.audioMode,
zoomRegions: this.config.zoomRegions?.length ?? 0,
speedRegions: this.config.speedRegions?.length ?? 0,
@@ -1975,12 +1997,14 @@ export class ModernVideoExporter {
this.nativeStaticLayoutSkipReason = !sourcePath
? "missing-source-path"
: "missing-audio-options";
+ this.nativeStaticLayoutSkipReasons = [this.nativeStaticLayoutSkipReason];
return null;
}
const background = await this.resolveNativeStaticLayoutBackground();
if (!background) {
this.nativeStaticLayoutSkipReason =
this.nativeStaticLayoutBackgroundSkipReason ?? "unsupported-background";
+ this.nativeStaticLayoutSkipReasons = [this.nativeStaticLayoutSkipReason];
return null;
}
@@ -2005,6 +2029,7 @@ export class ModernVideoExporter {
effectiveDuration <= 0
) {
this.nativeStaticLayoutSkipReason = "invalid-layout-or-duration";
+ this.nativeStaticLayoutSkipReasons = [this.nativeStaticLayoutSkipReason];
await this.cleanupNativeStaticLayoutBackground(background);
return null;
}
@@ -2044,6 +2069,7 @@ export class ModernVideoExporter {
(this.config.speedRegions ?? []).length > 0
? "invalid-native-speed-timeline"
: "invalid-native-trim-timeline";
+ this.nativeStaticLayoutSkipReasons = [this.nativeStaticLayoutSkipReason];
await this.cleanupNativeStaticLayoutBackground(background);
return null;
}
@@ -2058,6 +2084,7 @@ export class ModernVideoExporter {
: null;
if (cursorTelemetry && cursorTelemetry.length > 0 && !cursorAtlas) {
this.nativeStaticLayoutSkipReason = "cursor-atlas-unavailable";
+ this.nativeStaticLayoutSkipReasons = [this.nativeStaticLayoutSkipReason];
await this.cleanupNativeStaticLayoutBackground(background);
return null;
}
@@ -2078,6 +2105,7 @@ export class ModernVideoExporter {
this.lastProgressSampleFrame = 0;
this.nativeStaticLayoutSessionId = sessionId;
this.nativeStaticLayoutSkipReason = null;
+ this.nativeStaticLayoutSkipReasons = [];
this.nativeStaticLayoutAverageFps = null;
this.encodeBackend = "ffmpeg";
const runtimePlatform =
@@ -2272,6 +2300,7 @@ export class ModernVideoExporter {
console.warn("[VideoExporter] Native static layout export failed; falling back", error);
this.nativeStaticLayoutSkipReason = "native-static-runtime-failed";
+ this.nativeStaticLayoutSkipReasons = [this.nativeStaticLayoutSkipReason];
restoreEncoderState();
return null;
} finally {
@@ -2843,6 +2872,10 @@ export class ModernVideoExporter {
encodeBackend: this.encodeBackend ?? undefined,
encoderName: this.encoderName ?? undefined,
nativeStaticLayoutSkipReason: this.nativeStaticLayoutSkipReason ?? undefined,
+ nativeStaticLayoutSkipReasons:
+ this.nativeStaticLayoutSkipReasons.length > 0
+ ? this.nativeStaticLayoutSkipReasons
+ : undefined,
phase,
renderProgress: safeRenderProgress,
audioProgress,
@@ -2877,6 +2910,10 @@ export class ModernVideoExporter {
encoderName: this.encoderName ?? undefined,
backpressureProfile: this.backpressureProfile?.name,
nativeStaticLayoutSkipReason: this.nativeStaticLayoutSkipReason ?? undefined,
+ nativeStaticLayoutSkipReasons:
+ this.nativeStaticLayoutSkipReasons.length > 0
+ ? this.nativeStaticLayoutSkipReasons
+ : undefined,
effectiveDurationSec: this.effectiveDurationSec || undefined,
finalizationStageMs: hasFinalizationStageMetrics ? this.finalizationStageMs : undefined,
averageFrameCallbackMs:
diff --git a/src/lib/exporter/types.ts b/src/lib/exporter/types.ts
index 3312ecbc..e0eb7934 100644
--- a/src/lib/exporter/types.ts
+++ b/src/lib/exporter/types.ts
@@ -30,6 +30,7 @@ export interface ExportProgress {
encodeBackend?: ExportEncodeBackend;
encoderName?: string;
nativeStaticLayoutSkipReason?: string;
+ nativeStaticLayoutSkipReasons?: string[];
phase?: "preparing" | "extracting" | "finalizing" | "saving"; // Phase of export
renderProgress?: number; // 0-100, progress of GIF rendering phase
audioProgress?: number; // 0-1, progress of real-time audio rendering (speed/audio regions)
@@ -132,6 +133,7 @@ export interface ExportMetrics {
encoderName?: string;
backpressureProfile?: string;
nativeStaticLayoutSkipReason?: string;
+ nativeStaticLayoutSkipReasons?: string[];
averageFrameCallbackMs?: number;
averageRenderFrameMs?: number;
averageEncodeWaitMs?: number;