feat: Use ffmpeg to cover add instead of mp4art from deprecated mp4v2-utils package

closes: https://github.com/KrumpetPirate/AAXtoMP3/issues/198
This commit is contained in:
jcat
2022-02-05 23:30:14 +00:00
parent c9bcf2326b
commit 72794b6785
2 changed files with 17 additions and 20 deletions

View File

@ -962,7 +962,23 @@ do
if [ -f "${cover_file}" ]; then
log "Adding cover art"
mp4art --add "${cover_file}" "${output_file}"
# Create temporary output file name - ensure extention matches previous appropriate output file to keep ffmpeg happy
cover_output_file="${output_file%.*}.cover.${output_file##*.}"
# Copy audio stream from current output, and video stream from cover file, setting appropriate metadata
</dev/null "$FFMPEG" -loglevel quiet \
-nostats \
-i "${output_file}" \
-i "${cover_file}" \
-map 0:a:0 \
-map 1:v:0 \
-acodec copy \
-vcodec copy \
-id3v2_version 3 \
-metadata:s:v title="Album cover" \
-metadata:s:v comment="Cover (front)" \
"${cover_output_file}"
# Replace original output file with version including cover
mv "${cover_output_file}" "${output_file}"
fi
# -----