How to encode while preserving tags?

Tags: #<Tag:0x00007f2a003c5fd8> #<Tag:0x00007f2a003c5d08> #<Tag:0x00007f2a003c5a88>


Hi everyone!

So this is in the realm of the incredibly geeky, and I realise I have an idiosyncratic system, but hopefully knowing how to do this will help more people than just me…

So I’ve got a specific Picard filenaming convention I use (separate outer directory for first letter of the artist to keep it manageable, noting the release comment to disambiguate having different versions of the same album, etc), which is absolutely fantastic.

Then I’ve got a script I use to transcode a copy of everything from FLAC to MP3, which again works with no problems, preserving all the metadata tags.

Then I import everything into iTunes, and it gets messy. So I’m trying to work out how to compensate for this. Which gives me two questions:

  1. Album Artist Sort Order: this is a wonderful tag, that iTunes ignores. I believe it’s expecting ALBUMARTISTSORT instead. Does anyone know of a way for me to tell ffmpeg (or any other encoder up to the task) to rename “Album Artist Sort Order” to “ALBUMARTISTSORT” as it’s transcoding?

  2. Release Comment: if you own multiple copies of one album, then using the Release Comment, when present, as part of the Album name becomes necessary. (Otherwise iTunes jumbles them all up together, playing all the track 1s, then all the track 2s, and so on.) Customising the filename to include it is really useful! But is it please possible to include the Release Comment in the saved metadata, or to optionally have it affect the Album?

And if it can be saved as a separate Release Comment tag, is there a way to get ffmpeg or any other encoder to merge that into the Album as appropriate?

That’s it, really… I absolutely love MusicBrainz and Picard, and I’m just trying to figure out a way to get them to play nicely with iTunes. :blush:

Files not renamed on external drive

Hmm, looking at some iTunes-encoded tracks for comparison, I think I was misreading that table and it does also use Album Artist Sort Order… in which case, I have no idea what I’m doing wrong there…

  1. The album artist sort tag is for MP3 files written to a ID3 tag called “TSO2”. This is supported in iTunes, it was actually even iTunes which introduced this tag. So if you tag with Picard this should work, if you have tagged your files with at least Picard 1.2 or later.

  2. Not sure I understand your second question, but you want to add the release comment to the album title? If so try adding the following script to Options > Scripting:

    $set(album,%album%$if(%_releasecomment%, \(%_releasecomment%\),))

  1. Yeah, I’m starting to think I might be doing something else wrong there, I’ll need to investigate more, thanks!

  2. This is exactly what I was after! I should have done this instead of changing the filenaming convention. Much better, thank you so much!


Could you try converting files then loading them in picard again.
ffmpeg should bemapping most of the tags but there may be some that map differently in mp3 than flac and ffmpeg may not be changing the tags correctly.


It’s curious, I can load an example iTunes-imported MP3 file into Picard and see exactly which tags it’s got, and the relevant ones look present and correct. Specifically, it has both Album Artist Sort Order and ARTISTSORT set.

Ah, OK… If I set the album artist sort tag in iTunes itself, save it again, and see what’s changed, then it’s added ALBUMARTISTSORT, so I guess that answers that one…

So, going into Picard’s scripting, I’ve added a new script, “Alphabetise in iTunes”, which does this:


It’s not ideal that it’s messing up the .flac originals rather than the .mp3 derivatives, but I’ll certainly take it. :blush: (I think my fundamental issue here is that no encoders have the level of scripting that Picard does!)

Thank you! Sorry for the train of thought rambling here… Hopefully the above script will help out some other people who had the same issue!

(I’ve just tried it out, and although I believe it should work now, I can’t actually test it yet as Picard won’t save the updated files with the new tag, presumably for the same reason it also won’t save other minor changes, whatever that is… But I’m pretty certain that once I fix that, this should all work!)


I am confused now, are we talking about FLAC or MP3 files?


Sorry, it’s a quirky setup of mine: I use Picard to tag .flac files (my music collection proper), then use ffmpeg to convert them to disposable .mp3 versions that I can chuck into iTunes. I only just tried examining those .mp3 files in Picard, as a diagnostics measure, to check that ffmpeg had preserved the tags properly (it had), and to see what iTunes was looking for (ALBUMARTISTSORT).

At any rate, I believe everything should be working now, besides some kind of bug that’s not really related to the topic of this thread.

Thank you for your help though, that releasecomment script really did the trick!