Ajouter la gestion des erreurs lors de l'exécution de la commande ffmpeg pour la création de vidéos
This commit is contained in:
@@ -64,8 +64,13 @@ async function createVideoWithList(projectId, pathList, duration) {
|
|||||||
// Commande ffmpeg pour créer la vidéo
|
// 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}`;
|
const ffmpegCommand = `ffmpeg -r ${frameRate} -f concat -safe 0 -i ${tempFile} -vsync vfr -pix_fmt yuv420p ${outputVideo}`;
|
||||||
console.log('Running ffmpeg command:', ffmpegCommand);
|
console.log('Running ffmpeg command:', ffmpegCommand);
|
||||||
execSync(ffmpegCommand, { stdio: 'ignore', detached: true });
|
try {
|
||||||
console.log('Video creation started in background:', outputVideo);
|
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;
|
return outputVideo;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error creating video:', error);
|
console.error('Error creating video:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user