Merge pull request #3394 from mikiher/webp-embed

Convert webp images to jpeg during metadata embed
This commit is contained in:
advplyr 2024-09-09 16:02:17 -05:00 committed by GitHub
commit 65d1e7be56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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