Something went wrong. Try again.
An entry for the streamplace vod showcase
Something went wrong. Try again.
123456789101112131415161718192021222324252627/** * Video thumbnail generation */
import { ffmpeg } from "./ffmpeg"
export async function generateThumbnail( input: string, output: string, time = "00:00:03"): Promise<void> { 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}`) }}