From 422bb8c31c4031a4b42ef39ecaeab74ece5f87e8 Mon Sep 17 00:00:00 2001 From: mikiher Date: Mon, 9 Sep 2024 15:28:53 +0300 Subject: [PATCH] Convert webp images to jpeg during metadata embed --- server/utils/ffmpegHelpers.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/utils/ffmpegHelpers.js b/server/utils/ffmpegHelpers.js index e0f5c7da..3fa9f63c 100644 --- a/server/utils/ffmpegHelpers.js +++ b/server/utils/ffmpegHelpers.js @@ -299,6 +299,12 @@ async function addCoverAndMetadataToFile(audioFilePath, coverFilePath, metadataF '-metadata:s:v', 'comment=Cover' // add comment metadata to cover image stream ]) + const ext = Path.extname(coverFilePath).toLowerCase() + if (ext === '.webp') { + ffmpeg.outputOptions([ + '-c:v mjpeg' // convert webp images to jpeg + ]) + } } else { ffmpeg.outputOptions([ '-map 0:v?' // retain video stream from input file if exists