1

I use this loop to convert flac to alac :

for i in *.flac; do ffmpeg -i "$i" -y -vn -c:a alac "${i%.flac}".m4a; done

But some tags are not exported. I tried to use the -map_metadata 0 -id3v2_version 2 flag but it does not change anything.

Here you can find the tags that are copied (with or without the -map_metadata) :

When I use XLD Mac software it works perfectly but for some reasons I'd like to use CLI to convert flac files.

3
  • 1
    Different file formats support different metadata fields. I'm not familiar with MP4 containers' capabilities though.
    – Daniel B
    Commented May 26 at 14:27
  • @DanielB is absolutely right. The MP4 tags are different than ID3 tags, and there isn't always a direct translation between the two.
    – StarGeek
    Commented May 26 at 14:45
  • The relevant info is usually in the cuesheet. Do you have the .cue file or only the files? Run exiftool on a track and show the output.
    – JayCravens
    Commented Jun 5 at 19:20

1 Answer 1

0

Something you can do, to help ensure proper tagging, is the conversion separate from the tagging.

#!/bin/bash

for i in *.flac; do
    filename="${i%.*}"
    ffmpeg -i "$i" -an -f ffmetadata "$filename".id3
    ffmpeg -i "$i" -y -c:a alac -map_metadata -1 no_tag_"$filename".m4a
    ffmpeg -i no_tag_"$filename".m4a -c:a copy -i "$filename".id3 -map_metadata 1 -id3v2_version 3 "$filename".m4a
done

rm *.id3 no_tag_*

exit 0

Save: manual_tags.sh
Make executable: chmod +x manual_tags.sh
Usage: ./manual_tags.sh

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .