Skip to content

Commit

Permalink
Convert webp images to jpeg during metadata embed
Browse files Browse the repository at this point in the history
  • Loading branch information
mikiher committed Sep 9, 2024
1 parent 0344a63 commit 422bb8c
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 422bb8c

Please sign in to comment.