import { spawn } from "node:child_process"; import { defineCommand } from "citty"; import { existsSync, mkdtempSync, readFileSync, mkdirSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; import { resolve, join, dirname, relative, isAbsolute } from "node:path"; import { fileURLToPath } from "node:url"; import { resolveProject } from "../utils/project.js"; import { c } from "../ui/colors.js"; import type { Example } from "./_examples.js"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); /** * Extract a single frame from a video file at `timeSeconds` via FFmpeg. * Used to work around Chrome-headless's inability to reliably seek *