Skip to content

Commit

Permalink
Merge pull request #3394 from mikiher/webp-embed
Browse files Browse the repository at this point in the history
Convert webp images to jpeg during metadata embed
  • Loading branch information
advplyr authored Sep 9, 2024
2 parents 4ddd278 + 422bb8c commit 65d1e7b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/utils/ffmpegHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 65d1e7b

Please sign in to comment.