IPC Channels: Electron Renderer-to-Main Communication
Reference for all IPC channels exposed by WZRD Studio’s Electron preload. Covers media operations, clip studio, FFmpeg, YouTube, and QCut bridge channels.
Use this file to discover all available pages before exploring further.
WZRD Studio’s Electron preload (electron/preload.cjs) exposes two context-bridge globals — window.wzrdDesktop and window.wzrdQcut — each of which wraps a set of ipcRenderer.invoke calls and push-event subscriptions. This page documents every channel by group, including its request shape, response shape, and any progress events it emits. All channels use Electron’s ipcMain.handle / ipcRenderer.invoke pattern unless noted as a push-only event.
The TypeScript types shown here are extracted from src/lib/desktop.ts and electron/preload.cjs. Import WzrdDesktopBridge from @/lib/desktop in your renderer code — never reference window.wzrdDesktop directly.
These channels are exposed as methods on window.wzrdDesktop and handle media probing, thumbnail extraction, waveform analysis, proxy rendering, and full timeline export. They are implemented in electron/main.js using FFmpeg arg builders from electron/media-ffmpeg-commands.js.
Returns FFprobe metadata for a local media file: duration, streams, format, and codec details.
Request
Response
interface ProbeMediaParams { filePath: string; // Absolute local path to the media file ffmpegPath?: string; // Optional override for the ffmpeg binary location}
Extracts a single JPEG frame at a given timestamp from a local video file.
Request
Response
Progress Events
interface ExtractThumbnailParams { operationId: string; // Unique ID — also used to correlate progress events sourcePath: string; // Absolute local path to the source video outputPath: string; // Absolute local path where the .jpg will be written atMs: number; // Timestamp in milliseconds ffmpegPath?: string;}
interface ExtractThumbnailResult { outputPath: string; // Confirmed absolute path of the written JPEG}
Emits wzrd:media:progress twice: stage: "starting" at 0 % and stage: "completed" at 100 %. Subscribe with window.wzrdDesktop.onMediaProgress(cb).
Decodes an audio track to raw 32-bit float PCM via FFmpeg’s pipe:1 output and buckets it into peak amplitude values for waveform visualization.
Request
Response
Progress Events
interface ExtractWaveformPeaksParams { operationId: string; sourcePath: string; // Local audio or video file outputPath?: string; // If provided, peaks JSON is written here too resolution?: number; // Number of buckets — default 1024, clamped 64–16384 sampleRate?: number; // Decode sample rate — default 8000 Hz, clamped 100–48000 ffmpegPath?: string;}
Emits wzrd:media:progress with clipTitle: "audio.waveform". Stages: starting → running → completed | failed.The running stage fires on each stdout chunk from FFmpeg, so frequency depends on file length.
The raw PCM buffer is capped at 64 MB. Files requiring more samples should use a lower sampleRate or a shorter proxy clip.
Renders a full multi-track timeline to an MP4 file using a complex FFmpeg filter graph. This is WZRD Studio’s local export pipeline — it supports video tracks, audio tracks, text overlays, graphic elements, keyframe animation, and per-track effects and masks.
Request
Response
Validation Rules
interface RenderTimelineParams { operationId: string; outputPath: string; // Final output MP4 path timeline: LocalTimelineRenderPlan; // Full timeline data structure (see below) ffmpegPath?: string;}interface LocalTimelineRenderPlan { composition: { width: number; height: number; fps: number; durationMs: number; backgroundColor?: string; // Hex color, e.g. "#000000" }; visualTracks: VisualTrack[]; // Ordered by layer ascending audioTracks: AudioTrack[]; exportSettings: { outputPath: string; format?: 'mp4'; // Only MP4 supported for local export quality?: 'low' | 'medium' | 'high' | '4k'; includeAudio?: boolean; fastStart?: boolean; // Adds -movflags +faststart };}
Downloads a remote media URL and caches it locally so it can be used in FFmpeg export pipelines (which require local file paths).
Request
Response
interface CacheRemoteMediaParams { operationId: string; url: string; // Must be http:// or https:// name?: string; // Suggested filename stem}
interface CacheRemoteMediaResult { name: string; // Resolved filename in the cache directory path: string; // Absolute path: userData/media-cache/<name> size: number; // Bytes mimeType?: string; // Content-Type from the response headers mediaUrl: string; // wzrd://media/?file=<encoded-path> — ready for playback}
The file is saved to userData/media-cache/ with a SHA-256 hash suffix to avoid collisions. The path is automatically added to the media access allow-list. Emits wzrd:media:progress at starting and completed.
Validates and resolves a local file path into a wzrd://media/?file=… playback URL. Returns the URL string if the path is in the allow-list, or throws if it has not been explicitly permitted.
These channels serve the Clip Studio feature: video import, trimming, vertical export, thumbnail generation, and YouTube download. They are exposed on window.wzrdDesktop alongside the wzrd:media:* methods.
[0:v] scale+crop+subtitles → [base][1:v] split → intro logo (fade in/out) + watermark logo (fade out at end)overlay intro at center for logoIntroSecondsoverlay watermark at bottom after intro
Emits wzrd:clip-studio:ffmpeg-progress. Subscribe with onFfmpegProgress.
yt-dlp targets 1080p MP4 + M4A audio (bv*[height=1080][ext=mp4]+ba[ext=m4a]/b[height=1080][ext=mp4]). Subtitles are downloaded separately in a best-effort pass — failure does not abort the download.
Subtitle downloading is handled automatically as part of wzrd:clip-studio:download-youtube-video. After the main video download completes, the handler runs yt-dlp --write-auto-subs --write-subs --skip-download in a best-effort pass. Failure does not abort the overall download. The subtitlePath and subtitleText fields in the response contain the results when captions are found.
Opens a macOS native file picker filtered to video types (mp4, mov, m4v, webm, mkv, avi). The selected path is automatically added to the media access allow-list.
The QCut bridge is exposed on window.wzrdQcut. It serves WZRD’s AI editor engine with FFmpeg CLI sessions, PTY terminal management, project folder operations, and skill management.
Returns a health snapshot for the FFmpeg toolchain.
interface FfmpegHealthResult { ffmpegOk: boolean; ffprobeOk: boolean; ffmpegVersion: string; // e.g. "ffmpeg version 7.1" ffprobeVersion: string; ffmpegPath: string; ffprobePath: string; errors: string[]; // Non-empty only if not ok}const health = await window.wzrdQcut.ffmpeg.checkHealth();
wzrd:qcut:ffmpeg:create-export-session
Creates a scoped temp directory under app.getPath('temp')/wzrd-qcut/export/<sessionId>/ with frames/, output/, stickers/, and temp-media/ sub-directories. The session ID is used in subsequent calls.
Runs FFmpeg to composite frames, images, stickers, text overlays, and audio into a final MP4. The full options object maps to the internal buildFFmpegArgs function, which supports:
PTY sessions are backed by node-pty (native binary, excluded from asar). Each session is owned by the renderer that spawned it — the main process rejects write/resize/kill calls from other renderers by comparing event.sender.id.
Each project gets an isolated directory under userData/qcut-projects/<sanitized-projectId>/ with media/, skills/, and exports/ sub-directories created on first access.
wzrd:qcut:project-folder:get-root
Returns the absolute root path for a project, creating the directory structure if needed.
Skills are Markdown files (Skill.md) stored in qcut-projects/<id>/skills/<skill-folder>/. They carry YAML frontmatter with name, description, and optional dependencies fields. Bundled skills are copied on first access and can be synced to ~/.claude/skills/ for the Claude CLI.
wzrd:qcut:skills:list
Returns all installed skills for a project, installing bundled defaults on first call.
Syncs all project skills to ~/.claude/skills/ with a wzrd-qcut-<projectId>- prefix, making them available to the Claude CLI. Stale previously-synced skills are removed.
A bidirectional channel for agent API communication. The renderer registers itself as ready, then the main process (via the MCP server bridge) can dispatch editor commands that the renderer executes and responds to.
// Notify main process that the renderer is ready to receive commandswindow.wzrdQcut.agentCommand.notifyReady({ projectId: 'my-project' });// Listen for incoming agent commandsconst unsubscribe = window.wzrdQcut.agentCommand.onRequest((command) => { const result = executeEditorCommand(command); window.wzrdQcut.agentCommand.respond({ commandId: command.id, result });});
Agent commands originate from the MCP server running locally in the main process. They should be validated before execution — the onRequest callback is the permission gate between the agent API and the renderer’s editor state.