mirror of
https://github.com/KrumpetPirate/AAXtoMP3.git
synced 2024-11-18 03:08:57 +01:00
Merge pull request #38 from dloeckx/master
Add cover art + improve track metadata
This commit is contained in:
commit
de01589b94
14
AAXtoMP3
14
AAXtoMP3
@ -83,6 +83,10 @@ do
|
|||||||
|
|
||||||
debug "Created ${full_file_path}."
|
debug "Created ${full_file_path}."
|
||||||
|
|
||||||
|
cover_path="${output_directory}/cover.jpg"
|
||||||
|
debug "Extracting cover into ${cover_path}..."
|
||||||
|
</dev/null ffmpeg -loglevel error -activation_bytes "${auth_code}" -i "${path}" -an -codec:v copy "${cover_path}"
|
||||||
|
|
||||||
if [ "${mode}" == "chaptered" ]; then
|
if [ "${mode}" == "chaptered" ]; then
|
||||||
chaptercount=$($GREP -Pc "Chapter.*start.*end" $metadata_file)
|
chaptercount=$($GREP -Pc "Chapter.*start.*end" $metadata_file)
|
||||||
debug "Extracting ${chaptercount} chapter files from ${full_file_path}..."
|
debug "Extracting ${chaptercount} chapter files from ${full_file_path}..."
|
||||||
@ -94,8 +98,11 @@ do
|
|||||||
then
|
then
|
||||||
read -r -u9 _
|
read -r -u9 _
|
||||||
read -r -u9 _ _ chapter
|
read -r -u9 _ _ chapter
|
||||||
chapter_file="${output_directory}/${title} - $(printf %0${#chaptercount}d $chapternum) ${chapter}.${extension}"
|
chapter_title="${title} - $(printf %0${#chaptercount}d $chapternum) ${chapter}"
|
||||||
</dev/null ffmpeg -loglevel error -stats -i "${full_file_path}" -ss "${start%?}" -to "${end}" -codec:a copy -metadata track="${chapter}" "${chapter_file}"
|
chapter_file="${output_directory}/${chapter_title}.${extension}"
|
||||||
|
</dev/null ffmpeg -loglevel error -stats -i "${full_file_path}" -i "${cover_path}" -ss "${start%?}" -to "${end}" -c copy -map 0:0 -map 1:0 -id3v2_version 3 \
|
||||||
|
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" -metadata track="${chapternum}" -metadata title="${chapter_title}" \
|
||||||
|
"${chapter_file}"
|
||||||
chapternum=$((chapternum + 1 ))
|
chapternum=$((chapternum + 1 ))
|
||||||
fi
|
fi
|
||||||
done 9< "$metadata_file"
|
done 9< "$metadata_file"
|
||||||
@ -103,9 +110,6 @@ do
|
|||||||
debug "Done creating chapters. Chaptered files contained in ${output_directory}."
|
debug "Done creating chapters. Chaptered files contained in ${output_directory}."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cover_path="${output_directory}/cover.jpg"
|
|
||||||
debug "Extracting cover into ${cover_path}..."
|
|
||||||
</dev/null ffmpeg -loglevel error -activation_bytes "${auth_code}" -i "${path}" -an -codec:v copy "${cover_path}"
|
|
||||||
debug "Done."
|
debug "Done."
|
||||||
rm "${metadata_file}"
|
rm "${metadata_file}"
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user