From dabae19cf276a04458f7a6ee3bb9fdf4fcb07702 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 29 Apr 2025 16:37:27 +0530 Subject: [PATCH] ffprobe returns -1 on success --- web/packages/gallery/services/ffmpeg/web.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/packages/gallery/services/ffmpeg/web.ts b/web/packages/gallery/services/ffmpeg/web.ts index aaa7b3bebf..f5065c2f61 100644 --- a/web/packages/gallery/services/ffmpeg/web.ts +++ b/web/packages/gallery/services/ffmpeg/web.ts @@ -204,7 +204,9 @@ const ffprobeOutput = async ( try { status = await ffmpeg.ffprobe(cmd); - if (status !== 0) { + // Currently, ffprobe incorrectly returns status -1 on success. + // https://github.com/ffmpegwasm/ffmpeg.wasm/issues/817 + if (status !== 0 && status != -1) { log.info( `[wasm] ffprobe command failed with exit code ${status}: ${cmd.join(" ")}`, ); @@ -221,7 +223,7 @@ const ffprobeOutput = async ( } catch (e) { // Output file might not even exist if the command did not succeed, // so only log on success. - if (status === 0) { + if (status !== 0 && status != -1) { log.error(`Failed to remove output ${outputPath}`, e); } }