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:
@@ -415,7 +415,7 @@ export function clipThumbPath(owner: string, id: string) {
|
|||||||
|
|
||||||
function extractVideoThumb(videoPath: string, destPath: string) {
|
function extractVideoThumb(videoPath: string, destPath: string) {
|
||||||
return new Promise<boolean>((resolve) => {
|
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(() => {
|
const timer = setTimeout(() => {
|
||||||
try { proc.kill('SIGKILL') } catch { /* ignore */ }
|
try { proc.kill('SIGKILL') } catch { /* ignore */ }
|
||||||
resolve(false)
|
resolve(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user