If I don’t add subtitles the code works fine, the problem is that when I add the subtitles what happens is that I get a 500 error my question is should I merged audio video the to this file add the subtitles or do it all in one line :
await new Promise((resolve, reject) => {
exec(`ffmpeg -i ${videoPath} -i ${audioPath} -i ${subtitleFilePath} -c:v copy -c:a aac -c:s mov_text -map 0:v:0 -map 1:a:0 -map 2 ${finalOutputPath}`, (error, stdout, stderr) => {
if (error) {
reject(error);
} else {
resolve(undefined);
}
});
});