/** * Video thumbnail generation */ import { ffmpeg } from "./ffmpeg" export async function generateThumbnail( input: string, output: string, time = "00:00:03" ): Promise { const result = await ffmpeg([ "-protocol_whitelist", "file,http,https,tcp,tls,crypto", "-i", input, "-ss", time, "-vframes", "1", "-vf", "scale=320:240", "-q:v", "3", "-y", output, ]) if (!result.success) { throw new Error(`Failed to generate thumbnail: ${result.stderr}`) } }