diff --git a/server.mjs b/server.mjs index caeef9d..c5aac63 100644 --- a/server.mjs +++ b/server.mjs @@ -387,7 +387,12 @@ async function runSequentialEncodes(session, inputVideoPath, inputAudioPath, tar session.currentStatus = `Rendere ${i+1}/${targetFormats.length}: ${formatId.toUpperCase()}...`; saveHistory(); - const ffmpegArgs = ['-y', '-i', inputVideoPath]; + const ffmpegArgs = ['-y']; + if (inputVideoPath.toLowerCase().endsWith('.webm')) { + ffmpegArgs.push('-c:v', 'libvpx-vp9'); + } + ffmpegArgs.push('-i', inputVideoPath); + if (inputAudioPath) { ffmpegArgs.push('-i', inputAudioPath); }