Use the .oga extension instead and make sure to include metadata

This commit is contained in:
caem 2024-05-14 14:52:55 +02:00
parent a08ffe34ce
commit a69ca3a87d
No known key found for this signature in database
GPG key ID: 3BCEDBB0C38805DA

View file

@ -125,7 +125,7 @@ get_total_count() {
for item in "$dir"/*; do
if [ -f "$item" ]; then
new_file="${item/"$INPUT_DIR"/"$OUTPUT_DIR"}"
new_file="${new_file/".flac"/".ogg"}"
new_file="${new_file/".flac"/".oga"}"
if [ ! -f "$new_file" ] && [[ "$item" == *".flac" ]]; then
((total_count+=1))
elif [[ "$item" == *".flac" ]]; then
@ -159,9 +159,10 @@ iterate_dirs() {
if [ ! -f "$new_file" ]; then
if [[ "$item" == *".flac" ]]; then
((count+=1))
new_file="${new_file/".flac"/".ogg"}"
conversions+=("printf '[%s/%s] \e[92m%s\e[0m -> \e[93m%s\e[0m\n' $count $total_count \
'$item' '$new_file' && ffmpeg -hide_banner -loglevel error -i '$item' -c:a libopus -vbr \"$VBR\" -b:a \"$BITRATE\" '$new_file' > /dev/null")
new_file="${new_file/".flac"/".oga"}"
conversions+=("printf '[%s/%s] \e[92m%s\e[0m -> \e[93m%s\e[0m\n' $count $total_count '$item' '$new_file' && \
ffmpeg -hide_banner -loglevel error -i '$item' -map_metadata 0 -map_metadata 0:s:0 -id3v2_version 3 -c:a libopus \
-vbr \"$VBR\" -b:a \"$BITRATE\" '$new_file' > /dev/null")
else
new_dir=$(dirname "${item/"$INPUT_DIR"/"$OUTPUT_DIR"}")
if [ ! -d "$new_dir" ]; then
@ -194,6 +195,5 @@ main () {
iterate_dirs "$INPUT_DIR" "count" "$total_count"
}
# set -e
main "$@"