Write ffmpeg poster frames as a single image on Alpine.

FFmpeg 8 refuses a plain thumb.jpg output unless -update 1 is set.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-25 18:52:46 -05:00
co-authored by Cursor
parent 2913909199
commit e2db183a8e
+1 -1
View File
@@ -415,7 +415,7 @@ export function clipThumbPath(owner: string, id: string) {
function extractVideoThumb(videoPath: string, destPath: string) {
return new Promise<boolean>((resolve) => {
const proc = spawn('ffmpeg', ['-y', '-ss', '0.2', '-i', videoPath, '-frames:v', '1', '-q:v', '4', destPath], { stdio: 'ignore' })
const proc = spawn('ffmpeg', ['-y', '-ss', '0.2', '-i', videoPath, '-frames:v', '1', '-update', '1', '-q:v', '4', destPath], { stdio: 'ignore' })
const timer = setTimeout(() => {
try { proc.kill('SIGKILL') } catch { /* ignore */ }
resolve(false)