mirror of
https://github.com/KrumpetPirate/AAXtoMP3.git
synced 2024-11-18 03:08:57 +01:00
Added support for file tagging with FFMPEG
This commit is contained in:
parent
2e30e9f2a9
commit
b7383b2612
@ -64,11 +64,14 @@ do
|
|||||||
debug "Decoding ${path} with auth code ${auth_code}..."
|
debug "Decoding ${path} with auth code ${auth_code}..."
|
||||||
|
|
||||||
save_metadata "${path}"
|
save_metadata "${path}"
|
||||||
|
genre=$(get_metadata_value genre)
|
||||||
|
artist=$(get_metadata_value artist)
|
||||||
title=$(get_metadata_value title)
|
title=$(get_metadata_value title)
|
||||||
output_directory="$(dirname "${path}")/$(get_metadata_value genre)/$(get_metadata_value artist)/${title}"
|
output_directory="$(dirname "${path}")/${genre}/${artist}/${title}"
|
||||||
mkdir -p "${output_directory}"
|
mkdir -p "${output_directory}"
|
||||||
full_file_path="${output_directory}/${title}.${extension}"
|
full_file_path="${output_directory}/${title}.${extension}"
|
||||||
ffmpeg -loglevel error -stats -activation_bytes "${auth_code}" -i "${path}" -vn -codec:a "${codec}" -ab "$(get_bitrate)k" "${full_file_path}"
|
|
||||||
|
ffmpeg -loglevel error -stats -activation_bytes "${auth_code}" -i "${path}" -vn -codec:a "${codec}" -ab "$(get_bitrate)k" -map_metadata -1 -metadata title="${title}" -metadata artist="${artist}" -metadata album_artist="$(get_metadata_value album_artist)" -metadata album="$(get_metadata_value album)" -metadata date="$(get_metadata_value date)" -metadata track="1/1" -metadata genre="${genre}" -metadata copyright="$(get_metadata_value copyright)" "${full_file_path}"
|
||||||
|
|
||||||
debug "Created ${full_file_path}."
|
debug "Created ${full_file_path}."
|
||||||
|
|
||||||
@ -82,7 +85,7 @@ do
|
|||||||
read -r -u9 _
|
read -r -u9 _
|
||||||
read -r -u9 _ _ chapter
|
read -r -u9 _ _ chapter
|
||||||
chapter_file="${output_directory}/${title} - ${chapter}.${extension}"
|
chapter_file="${output_directory}/${title} - ${chapter}.${extension}"
|
||||||
ffmpeg -loglevel error -stats -i "${full_file_path}" -ss "${start%?}" -to "${end}" -codec:a copy "${chapter_file}"
|
ffmpeg -loglevel error -stats -i "${full_file_path}" -ss "${start%?}" -to "${end}" -codec:a copy -metadata track="${chapter}" "${chapter_file}"
|
||||||
fi
|
fi
|
||||||
done 9< "$metadata_file"
|
done 9< "$metadata_file"
|
||||||
rm "${full_file_path}"
|
rm "${full_file_path}"
|
||||||
|
Loading…
Reference in New Issue
Block a user