Skip to content

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

Add computer hardware to export diagnostics

webadderalla2732ba3948b
diff --git a/electron/electron-env.d.ts b/electron/electron-env.d.ts
index c00ef322..856fb643 100644
--- a/electron/electron-env.d.ts
+++ b/electron/electron-env.d.ts
@@ -195,6 +195,28 @@ interface RendererNativeExportCapabilities {
};
}
+interface RendererExportHardwareInfo {
+ platform: NodeJS.Platform;
+ release: string;
+ arch: string;
+ cpuModel: string | null;
+ logicalProcessors: number;
+ totalMemoryGb: number;
+ machineModel: string | null;
+ gpus: Array<{
+ name: string;
+ vendor: string | null;
+ active: boolean | null;
+ videoMemoryMb: number | null;
+ }>;
+ gpuFeatures: {
+ videoDecode: string | null;
+ videoEncode: string | null;
+ webgl: string | null;
+ webgpu: string | null;
+ };
+}
+
interface Window {
electronAPI: {
hudOverlaySetIgnoreMouse: (ignore: boolean) => void;
@@ -343,6 +365,11 @@ interface Window {
capabilities?: RendererNativeExportCapabilities;
error?: string;
}>;
+ getExportHardwareInfo: () => Promise<{
+ success: boolean;
+ hardware?: RendererExportHardwareInfo;
+ error?: string;
+ }>;
nativeStaticLayoutExport: (options: {
sessionId?: string;
inputPath: string;
diff --git a/electron/ipc/export/native-video.test.ts b/electron/ipc/export/native-video.test.ts
index ee31dcdd..a55ddbd2 100644
--- a/electron/ipc/export/native-video.test.ts
+++ b/electron/ipc/export/native-video.test.ts
@@ -3,6 +3,12 @@ import { describe, expect, it, vi } from "vitest";
vi.mock("electron", () => ({
app: {
getAppPath: vi.fn(() => process.cwd()),
+ getGPUFeatureStatus: vi.fn(() => ({
+ video_decode: "enabled",
+ video_encode: "enabled",
+ webgl: "enabled",
+ webgpu: "enabled",
+ })),
getGPUInfo: vi.fn(async () => ({ gpuDevice: [] })),
getPath: vi.fn(() => process.env.TEMP ?? process.cwd()),
isPackaged: false,
@@ -55,6 +61,7 @@ import {
buildNativeVideoAudioMuxArgs,
canCopyAudioCodecIntoMp4,
getExperimentalNvidiaCudaExportSkipReason,
+ getExportHardwareInfo,
getNativeExportCapabilities,
getNativeGpuCompositorStallTimeoutMs,
getNativeStaticLayoutSourceProxyBitrate,
@@ -75,6 +82,7 @@ import {
parseWindowsGpuExportProgressLine,
parseWindowsGpuExportSummary,
resolveExperimentalNvidiaCudaExportScriptPath,
+ sanitizeExportGpuInfo,
shouldCreateNativeStaticLayoutSourceProxy,
validateNativeStaticLayoutSourceProxyMetadata,
validateNativeVideoStreamStats,
@@ -84,6 +92,7 @@ import {
const electronAppMock = app as unknown as {
getAppPath: ReturnType<typeof vi.fn>;
+ getGPUFeatureStatus: ReturnType<typeof vi.fn>;
getGPUInfo: ReturnType<typeof vi.fn>;
isPackaged: boolean;
};
@@ -412,6 +421,60 @@ describe("getNativeExportCapabilities", () => {
});
});
+describe("export hardware diagnostics", () => {
+ it("sanitizes machine and GPU details without exposing raw device identifiers", () => {
+ const hardware = sanitizeExportGpuInfo({
+ machineModelName: "MacBookPro",
+ machineModelVersion: "18,2",
+ gpuDevice: [
+ {
+ active: true,
+ vendorId: "0x10de",
+ deviceId: 9999,
+ deviceString: "NVIDIA GeForce RTX 4070",
+ videoMemory: 12_288,
+ },
+ ],
+ });
+
+ expect(hardware).toEqual({
+ machineModel: "MacBookPro 18,2",
+ gpus: [
+ {
+ name: "NVIDIA GeForce RTX 4070",
+ vendor: "NVIDIA",
+ active: true,
+ videoMemoryMb: 12_288,
+ },
+ ],
+ });
+ expect(JSON.stringify(hardware)).not.toContain("deviceId");
+ expect(JSON.stringify(hardware)).not.toContain("vendorId");
+ });
+
+ it("returns system capacity and GPU acceleration status", async () => {
+ electronAppMock.getGPUInfo.mockResolvedValueOnce({
+ gpuDevice: [{ active: true, vendorId: 0x8086 }],
+ });
+
+ const hardware = await getExportHardwareInfo();
+
+ expect(hardware).toMatchObject({
+ platform: process.platform,
+ arch: process.arch,
+ gpus: [{ name: "Intel", vendor: "Intel", active: true }],
+ gpuFeatures: {
+ videoDecode: "enabled",
+ videoEncode: "enabled",
+ webgl: "enabled",
+ webgpu: "enabled",
+ },
+ });
+ expect(hardware.logicalProcessors).toBeGreaterThan(0);
+ expect(hardware.totalMemoryGb).toBeGreaterThan(0);
+ });
+});
+
describe("getExperimentalNvidiaCudaExportSkipReason", () => {
it("requires user opt-in before packaged CUDA candidates run", async () => {
const reason = await withPackagedCudaCandidate(
diff --git a/electron/ipc/export/native-video.ts b/electron/ipc/export/native-video.ts
index 16b2993e..f01351b5 100644
--- a/electron/ipc/export/native-video.ts
+++ b/electron/ipc/export/native-video.ts
@@ -56,15 +56,41 @@ const NATIVE_STATIC_LAYOUT_SOURCE_PROXY_MAX_BITRATE = 80_000_000;
const NATIVE_STATIC_LAYOUT_SOURCE_PROXY_CONTAINERS = new Set([".mp4", ".m4v", ".mov"]);
type ElectronGpuDeviceLike = {
+ active?: boolean;
vendorId?: number | string;
vendorString?: string;
deviceString?: string;
+ videoMemory?: number;
};
type ElectronGpuInfoLike = {
gpuDevice?: ElectronGpuDeviceLike[];
+ machineModelName?: string;
+ machineModelVersion?: string;
};
+export interface ExportHardwareInfo {
+ platform: NodeJS.Platform;
+ release: string;
+ arch: string;
+ cpuModel: string | null;
+ logicalProcessors: number;
+ totalMemoryGb: number;
+ machineModel: string | null;
+ gpus: Array<{
+ name: string;
+ vendor: string | null;
+ active: boolean | null;
+ videoMemoryMb: number | null;
+ }>;
+ gpuFeatures: {
+ videoDecode: string | null;
+ videoEncode: string | null;
+ webgl: string | null;
+ webgpu: string | null;
+ };
+}
+
export type NativeVideoExportSession = {
ffmpegProcess: ChildProcessByStdio<Writable, null, Readable>;
outputPath: string;
@@ -1869,6 +1895,99 @@ export function hasNvidiaGpuDeviceInGpuInfo(gpuInfo: unknown) {
return Array.isArray(devices) && devices.some(isNvidiaGpuDevice);
}
+function getGpuVendorLabel(device: ElectronGpuDeviceLike): string | null {
+ if (device.vendorString?.trim()) {
+ return device.vendorString.trim();
+ }
+
+ const rawVendorId = device.vendorId;
+ const vendorId =
+ typeof rawVendorId === "number"
+ ? rawVendorId
+ : typeof rawVendorId === "string"
+ ? rawVendorId.toLowerCase().startsWith("0x")
+ ? Number.parseInt(rawVendorId.slice(2), 16)
+ : Number.parseInt(rawVendorId, 10)
+ : Number.NaN;
+ return (
+ {
+ [0x1002]: "AMD",
+ [0x106b]: "Apple",
+ [0x10de]: "NVIDIA",
+ [0x8086]: "Intel",
+ }[vendorId] ?? null
+ );
+}
+
+/** Reduces Electron's GPU response to support-safe hardware fields. */
+export function sanitizeExportGpuInfo(
+ gpuInfo: unknown,
+): Pick<ExportHardwareInfo, "machineModel" | "gpus"> {
+ if (!gpuInfo || typeof gpuInfo !== "object") {
+ return { machineModel: null, gpus: [] };
+ }
+
+ const info = gpuInfo as ElectronGpuInfoLike;
+ const machineModel =
+ [info.machineModelName, info.machineModelVersion]
+ .filter((value): value is string => Boolean(value?.trim()))
+ .join(" ") || null;
+ const gpus = Array.isArray(info.gpuDevice)
+ ? info.gpuDevice.map((device) => {
+ const vendor = getGpuVendorLabel(device);
+ return {
+ name: device.deviceString?.trim() || vendor || "Unknown GPU",
+ vendor,
+ active: typeof device.active === "boolean" ? device.active : null,
+ videoMemoryMb:
+ typeof device.videoMemory === "number" && device.videoMemory > 0
+ ? device.videoMemory
+ : null,
+ };
+ })
+ : [];
+
+ return { machineModel, gpus };
+}
+
+/** Captures sanitized hardware and GPU acceleration details for export support reports. */
+export async function getExportHardwareInfo(): Promise<ExportHardwareInfo> {
+ let sanitizedGpuInfo: Pick<ExportHardwareInfo, "machineModel" | "gpus"> = {
+ machineModel: null,
+ gpus: [],
+ };
+ try {
+ sanitizedGpuInfo = sanitizeExportGpuInfo(await app.getGPUInfo("basic"));
+ } catch {
+ // Hardware diagnostics are best effort and must not affect exporting.
+ }
+
+ let gpuFeatureStatus: Record<string, string> = {};
+ try {
+ gpuFeatureStatus = app.getGPUFeatureStatus() as unknown as Record<string, string>;
+ } catch {
+ // GPU feature status can be unavailable before Chromium finishes GPU initialization.
+ }
+
+ const cpuModel = os.cpus()[0]?.model?.replace(/\s+/g, " ").trim() || null;
+ return {
+ platform: process.platform,
+ release: os.release(),
+ arch: process.arch,
+ cpuModel,
+ logicalProcessors: os.cpus().length,
+ totalMemoryGb: Math.round((os.totalmem() / 1024 ** 3) * 10) / 10,
+ machineModel: sanitizedGpuInfo.machineModel,
+ gpus: sanitizedGpuInfo.gpus,
+ gpuFeatures: {
+ videoDecode: gpuFeatureStatus.video_decode ?? null,
+ videoEncode: gpuFeatureStatus.video_encode ?? null,
+ webgl: gpuFeatureStatus.webgl ?? null,
+ webgpu: gpuFeatureStatus.webgpu ?? null,
+ },
+ };
+}
+
async function hasNvidiaGpuForCudaExportCandidate() {
const hasNvidiaGpu = await probeNvidiaGpuForCudaExportCandidate();
return hasNvidiaGpu ?? true;
diff --git a/electron/ipc/register/export.ts b/electron/ipc/register/export.ts
index 2eabb978..82b523de 100644
--- a/electron/ipc/register/export.ts
+++ b/electron/ipc/register/export.ts
@@ -5,12 +5,6 @@ import path from "node:path";
import type { Readable, Writable } from "node:stream";
import type { SaveDialogOptions } from "electron";
import { app, BrowserWindow, dialog, ipcMain } from "electron";
-import {
- parseCaptionSidecarPayload,
- type CaptionSidecarPayload,
- withCaptionSidecarMessage,
- writeCaptionSidecarsBestEffort,
-} from "./exportCaptionSidecars";
import {
closeExportStream,
isOwnedExportPath,
@@ -24,6 +18,7 @@ import {
enqueueNativeVideoExportFrameWrites,
exportNativeStaticLayoutVideo,
flushNativeVideoExportPendingWriteRequests,
+ getExportHardwareInfo,
getNativeExportCapabilities,
getNativeVideoExportMaxQueuedWriteBytes,
getNativeVideoExportSessionError,
@@ -51,6 +46,12 @@ import {
} from "../nativeVideoExport";
import { isAllowedLocalReadPath, resolveApprovedLocalMediaPath } from "../project/manager";
import { approveUserPath } from "../utils";
+import {
+ type CaptionSidecarPayload,
+ parseCaptionSidecarPayload,
+ withCaptionSidecarMessage,
+ writeCaptionSidecarsBestEffort,
+} from "./exportCaptionSidecars";
function getPartialExportDestinationPath(destinationPath: string) {
const parsed = path.parse(destinationPath);
@@ -428,6 +429,21 @@ export function registerExportHandlers() {
}
});
+ ipcMain.handle("get-export-hardware-info", async () => {
+ try {
+ return {
+ success: true,
+ hardware: await getExportHardwareInfo(),
+ };
+ } catch (error) {
+ console.warn("[export-hardware-info] Failed:", error);
+ return {
+ success: false,
+ error: error instanceof Error ? error.message : String(error),
+ };
+ }
+ });
+
ipcMain.handle(
"native-static-layout-export",
async (event, options: NativeStaticLayoutExportOptions) => {
diff --git a/electron/preload.ts b/electron/preload.ts
index a3037231..768c3d40 100644
--- a/electron/preload.ts
+++ b/electron/preload.ts
@@ -102,6 +102,27 @@ type NativeExportCapabilities = {
userOptInRequired: boolean;
};
};
+type ExportHardwareInfo = {
+ platform: NodeJS.Platform;
+ release: string;
+ arch: string;
+ cpuModel: string | null;
+ logicalProcessors: number;
+ totalMemoryGb: number;
+ machineModel: string | null;
+ gpus: Array<{
+ name: string;
+ vendor: string | null;
+ active: boolean | null;
+ videoMemoryMb: number | null;
+ }>;
+ gpuFeatures: {
+ videoDecode: string | null;
+ videoEncode: string | null;
+ webgl: string | null;
+ webgpu: string | null;
+ };
+};
const nativeVideoExportWriteRequests = new Map<
number,
@@ -220,6 +241,13 @@ contextBridge.exposeInMainWorld("electronAPI", {
error?: string;
}>;
},
+ getExportHardwareInfo: () => {
+ return ipcRenderer.invoke("get-export-hardware-info") as Promise<{
+ success: boolean;
+ hardware?: ExportHardwareInfo;
+ error?: string;
+ }>;
+ },
nativeStaticLayoutExport: (options: {
sessionId?: string;
inputPath: string;
diff --git a/src/lib/exporter/modernVideoExporter.fallback.test.ts b/src/lib/exporter/modernVideoExporter.fallback.test.ts
index c781ca1d..6fe6c0b5 100644
--- a/src/lib/exporter/modernVideoExporter.fallback.test.ts
+++ b/src/lib/exporter/modernVideoExporter.fallback.test.ts
@@ -317,6 +317,7 @@ describe("ModernVideoExporter native fallback routing", () => {
userAgent: string;
logicalProcessors: number;
deviceMemoryGb: number;
+ hardware: RendererExportHardwareInfo;
};
backpressureProfile: {
name: string;
@@ -338,6 +339,29 @@ describe("ModernVideoExporter native fallback routing", () => {
userAgent: "RecordlyTest/1.0 Electron/43.1.0",
logicalProcessors: 12,
deviceMemoryGb: 8,
+ hardware: {
+ platform: "win32",
+ release: "10.0.26100",
+ arch: "x64",
+ cpuModel: "AMD Ryzen 9 7900X",
+ logicalProcessors: 24,
+ totalMemoryGb: 31.8,
+ machineModel: "Custom PC",
+ gpus: [
+ {
+ name: "NVIDIA GeForce RTX 4070",
+ vendor: "NVIDIA",
+ active: true,
+ videoMemoryMb: 12_288,
+ },
+ ],
+ gpuFeatures: {
+ videoDecode: "enabled",
+ videoEncode: "enabled",
+ webgl: "enabled",
+ webgpu: "enabled",
+ },
+ },
};
exporter.backpressureProfile = {
name: "webcodecs-balanced-plus",
@@ -357,7 +381,13 @@ describe("ModernVideoExporter native fallback routing", () => {
expect(report).toContain("Output: 1200x570 @ 60 FPS; 8.00 Mbps; mode=default");
expect(report).toContain("Recordly version: 1.4.0");
expect(report).toContain("Runtime: RecordlyTest/1.0 Electron/43.1.0");
- expect(report).toContain("Hardware capacity: 12 logical processors; 8 GB device memory");
+ expect(report).toContain("System: win32 10.0.26100 (x64); model=Custom PC");
+ expect(report).toContain("CPU: AMD Ryzen 9 7900X; 24 logical processors");
+ expect(report).toContain("Memory: 31.8 GB");
+ expect(report).toContain("GPU 1: NVIDIA GeForce RTX 4070; VRAM=12288 MB; active");
+ expect(report).toContain(
+ "GPU acceleration: video decode=enabled; video encode=enabled; WebGL=enabled; WebGPU=enabled",
+ );
expect(report).toContain("Source: h264 1920x1080 @ 30.000 FPS; 1.000s");
expect(report).toContain("Source audio: none");
expect(report).toContain("Progress at failure: 314/600 (52.3%) rendered frames after");
diff --git a/src/lib/exporter/modernVideoExporter.ts b/src/lib/exporter/modernVideoExporter.ts
index 1bedbb7b..d7490680 100644
--- a/src/lib/exporter/modernVideoExporter.ts
+++ b/src/lib/exporter/modernVideoExporter.ts
@@ -166,6 +166,7 @@ interface ExportRuntimeDiagnostics {
userAgent?: string;
logicalProcessors?: number;
deviceMemoryGb?: number;
+ hardware?: RendererExportHardwareInfo;
}
type NativeAudioPlan =
@@ -1007,6 +1008,20 @@ export class ModernVideoExporter {
// Environment diagnostics must never prevent an export attempt.
}
+ try {
+ if (
+ typeof window !== "undefined" &&
+ typeof window.electronAPI?.getExportHardwareInfo === "function"
+ ) {
+ const result = await window.electronAPI.getExportHardwareInfo();
+ if (result.success && result.hardware) {
+ diagnostics.hardware = result.hardware;
+ }
+ }
+ } catch {
+ // Environment diagnostics must never prevent an export attempt.
+ }
+
return diagnostics;
}
@@ -1097,16 +1112,52 @@ export class ModernVideoExporter {
if (this.runtimeDiagnostics.userAgent) {
lines.push(`Runtime: ${this.runtimeDiagnostics.userAgent}`);
}
- const hardwareParts = [
- this.runtimeDiagnostics.logicalProcessors
- ? `${this.runtimeDiagnostics.logicalProcessors} logical processors`
- : null,
- this.runtimeDiagnostics.deviceMemoryGb
- ? `${this.runtimeDiagnostics.deviceMemoryGb} GB device memory`
- : null,
- ].filter((value): value is string => Boolean(value));
- if (hardwareParts.length > 0) {
- lines.push(`Hardware capacity: ${hardwareParts.join("; ")}`);
+ const hardware = this.runtimeDiagnostics.hardware;
+ if (hardware) {
+ lines.push(
+ `System: ${hardware.platform} ${hardware.release} (${hardware.arch})${hardware.machineModel ? `; model=${hardware.machineModel}` : ""}`,
+ );
+ lines.push(
+ `CPU: ${hardware.cpuModel ?? "Unknown"}; ${hardware.logicalProcessors} logical processors`,
+ );
+ lines.push(`Memory: ${hardware.totalMemoryGb} GB`);
+ for (const [index, gpu] of hardware.gpus.entries()) {
+ const details = [
+ gpu.vendor && !gpu.name.toLowerCase().includes(gpu.vendor.toLowerCase())
+ ? `vendor=${gpu.vendor}`
+ : null,
+ gpu.videoMemoryMb ? `VRAM=${gpu.videoMemoryMb} MB` : null,
+ gpu.active === true ? "active" : gpu.active === false ? "inactive" : null,
+ ].filter((value): value is string => Boolean(value));
+ lines.push(
+ `GPU ${index + 1}: ${gpu.name}${details.length ? `; ${details.join("; ")}` : ""}`,
+ );
+ }
+ const gpuFeatures = [
+ hardware.gpuFeatures.videoDecode
+ ? `video decode=${hardware.gpuFeatures.videoDecode}`
+ : null,
+ hardware.gpuFeatures.videoEncode
+ ? `video encode=${hardware.gpuFeatures.videoEncode}`
+ : null,
+ hardware.gpuFeatures.webgl ? `WebGL=${hardware.gpuFeatures.webgl}` : null,
+ hardware.gpuFeatures.webgpu ? `WebGPU=${hardware.gpuFeatures.webgpu}` : null,
+ ].filter((value): value is string => Boolean(value));
+ if (gpuFeatures.length > 0) {
+ lines.push(`GPU acceleration: ${gpuFeatures.join("; ")}`);
+ }
+ } else {
+ const hardwareParts = [
+ this.runtimeDiagnostics.logicalProcessors
+ ? `${this.runtimeDiagnostics.logicalProcessors} logical processors`
+ : null,
+ this.runtimeDiagnostics.deviceMemoryGb
+ ? `${this.runtimeDiagnostics.deviceMemoryGb} GB device memory`
+ : null,
+ ].filter((value): value is string => Boolean(value));
+ if (hardwareParts.length > 0) {
+ lines.push(`Hardware capacity: ${hardwareParts.join("; ")}`);
+ }
}
if (this.sourceVideoInfo) {