From 848c50bf337058402bd60f4c20d7100f0979146b Mon Sep 17 00:00:00 2001 From: dakerboul Date: Mon, 10 Mar 2025 17:25:59 +0100 Subject: [PATCH] =?UTF-8?q?Ajouter=20la=20gestion=20des=20erreurs=20lors?= =?UTF-8?q?=20de=20l'ex=C3=A9cution=20de=20la=20commande=20ffmpeg=20pour?= =?UTF-8?q?=20la=20cr=C3=A9ation=20de=20vid=C3=A9os?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/video/videoManager.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/video/videoManager.js b/src/video/videoManager.js index f098dfc..4a75ba5 100644 --- a/src/video/videoManager.js +++ b/src/video/videoManager.js @@ -64,8 +64,13 @@ async function createVideoWithList(projectId, pathList, duration) { // Commande ffmpeg pour créer la vidéo const ffmpegCommand = `ffmpeg -r ${frameRate} -f concat -safe 0 -i ${tempFile} -vsync vfr -pix_fmt yuv420p ${outputVideo}`; console.log('Running ffmpeg command:', ffmpegCommand); - execSync(ffmpegCommand, { stdio: 'ignore', detached: true }); - console.log('Video creation started in background:', outputVideo); + try { + execSync(ffmpegCommand, { stdio: 'ignore', detached: true }); + console.log('Video creation started in background:', outputVideo); + } catch (error) { + console.error('ffmpeg command failed:', error); + serverError.sendError(error); + } return outputVideo; } catch (error) { console.error('Error creating video:', error);