Bulk change library files from mp3 to m4a

Let's say I want to substitute all the songs in 4 of my total 5 playlists (old 128kbps mp3 at the moment) with better, newer versions (q0.55 aac).
I wouldn't like to loose all the datas such as stars, number of listened times, last played data and so on.
How could I substitute the files other than manually editing the xml iTunes library by hand (and that sounds bad) for over than a thousand file?

Ibook 12'' 1.33ghz and MBP 15'' 2.2ghz, Mac OS X (10.4.11), Waiting for Nehalem...

Posted on Jan 5, 2010 9:27 AM

Reply
28 replies

Jan 6, 2010 11:35 AM in response to flapane

Have a look at these...
-> iTunes Track CPR v1.3
"This script attempts to locate the files of so-called "dead tracks"--iTunes tracks designated with (!)--that you assume are not actually missing but are still located in the iTunes Music folder in their "iTunes File Order" (Music -> Artist -> Album -> file.xxx). Any correct files found will be added to iTunes and will replace the "dead track" in each playlist it appears in (except Smart Playlists). Most tag data will also be rescued."

-> Bring Out Yer Dead v1.1
"This script applet will allow you to select a "dead" file track in iTunes (designated with the (!)) and attempt to locate a file using Spotlight that corresponds to the selected track's Song Name, Artist, and Album, and then allow you to replace the "dead track" with a file from the search results. All tag data is preserved from the original track selected and copied to the newly added track."

Start off with just one album first and see if these will do the job.
Move the files from one album in the iTunes music folder to a folder on the desktop (don't delete them).
Put your AAC songs in there.
Select the songs in iTunes then run one of the scripts above.

Jan 5, 2010 12:22 PM in response to flapane

flapane,
You're making this too difficult.
Just re-rip the files and when you go to do that, itunes will ask whether you want to replace the existing file.
If you answer yes, all the metadata such as Date Added, Last Played, etc will stay intact.



Also, there is a lot of confusion on the internet about that XML file. Merely editing the XML file will not change anything in itunes.
The itunes database file that _itunes uses_ is named
iTunes Library.itl




The XML file is for _other software to use_, like MSN messenger "what's playing now" or lastfm.



itunes updates the ITL and XML files every time it plays a song. So if you edit the XML, open itunes and itunes uses the unedited ITL file, itunes will overwrite the XMl edits you just made.
There is no tool available to edit the ITL file directly, without using itunes.

Message was edited by: Katrina S.

Jan 5, 2010 10:18 AM in response to flapane

Converting from MP3 to AAC won't improve the quality of your files. Both of these formats lose information when they are created from the original uncompressed master files (CDs for example) and that information can added back. It's always preferable to re-rip from the original uncompressed format rather than converting from one lossy format to another. In fact converting from one lossy format to another can result in even more quality loss. It's a bit like photocopying a photocopy, the farther you get away from the original the lower the quality.

Jan 5, 2010 12:18 PM in response to flapane

Editing by hand the xml itunes library (and changing the extension from mp3 to m4a) should work to me, but it would be a pain...

It would actually be vers simple.
In your text editor, search for .mp3.
Select *Replace All* and use .mp4.

Simplt reRIP the CDs using iTunes and select *Replace existing songs* to amintain everything as is.

As Katrina noted, the .xml file is not used by iTunes.
You could import it but not everything in the .xml file will get changed in iTunes. Date Added, Date Modified, Bit Rate and plenty of other info will not get change din iTunes if you edit and import the .xml.
All info is maintained in the iTunes library.itl file, which is the database used by (and only by) iTunes.

Jan 6, 2010 2:53 AM in response to Katrina S.

Sorry, but I don't understand why:
The library has this kind of entries:
<key>Play Count</key><integer>4</integer>

Why shouldn't be imported? That would be nonsense to me.

I'm not sure if you understood well what I'm trying to say.
Let's make an example:
<key>1149</key>
<dict>
<key>Track ID</key><integer>1149</integer>
<key>Name</key><string>Esquadros</string>
<key>Artist</key><string>Adriana Calcanhotto</string>
<key>Album Artist</key><string>Adriana Calcanhoto</string>
<key>Composer</key><string>Adriana Calcanhotto</string>
<key>Album</key><string>Perfil Serie</string>
<key>Genre</key><string>Brazilian Music</string>
<key>Kind</key><string>File audio MPEG</string>
<key>Size</key><integer>3039848</integer>
<key>Total Time</key><integer>188342</integer>
<key>Track Number</key><integer>5</integer>
<key>Year</key><integer>2003</integer>
<key>Date Modified</key><date>2007-01-11T14:23:02Z</date>
<key>Date Added</key><date>2006-09-18T20:31:18Z</date>
<key>Bit Rate</key><integer>128</integer>
<key>Sample Rate</key><integer>44100</integer>
<key>Play Count</key><integer>4</integer>
<key>Play Date</key><integer>3307048306</integer>
<key>Play Date UTC</key><date>2008-10-16T23:31:46Z</date>
<key>Skip Count</key><integer>6</integer>
<key>Skip Date</key><date>2009-07-03T00:19:28Z</date>
<key>Artwork Count</key><integer>1</integer>
<key>Persistent ID</key><string>E8896D4F7802E1CA</string>
<key>Track Type</key><string>File</string>
<key>Location</key><string> file://localhost/D:/Altro/MP3/Canzoni%20Brasiliane%20e%20%20Animazione%20Estate/ Adriana%20Calcanhotto%20-%20Esquadros.mp3</string>
<key>File Folder Count</key><integer>3</integer>
<key>Library Folder Count</key><integer>1</integer>
</dict>

becomes:

<key>1149</key>
<dict>
<key>Track ID</key><integer>1149</integer>
<key>Name</key><string>Esquadros</string>
<key>Artist</key><string>Adriana Calcanhotto</string>
<key>Album Artist</key><string>Adriana Calcanhoto</string>
<key>Composer</key><string>Adriana Calcanhotto</string>
<key>Album</key><string>Perfil Serie</string>
<key>Genre</key><string>Brazilian Music</string>
<key>Kind</key><string>File audio MPEG</string>
<key>Size</key><integer>3039848</integer>
<key>Total Time</key><integer>188342</integer>
<key>Track Number</key><integer>5</integer>
<key>Year</key><integer>2003</integer>
<key>Date Modified</key><date>2007-01-11T14:23:02Z</date>
<key>Date Added</key><date>2006-09-18T20:31:18Z</date>
<key>Bit Rate</key><integer>128</integer>
<key>Sample Rate</key><integer>44100</integer>
<key>Play Count</key><integer>4</integer>
<key>Play Date</key><integer>3307048306</integer>
<key>Play Date UTC</key><date>2008-10-16T23:31:46Z</date>
<key>Skip Count</key><integer>6</integer>
<key>Skip Date</key><date>2009-07-03T00:19:28Z</date>
<key>Artwork Count</key><integer>1</integer>
<key>Persistent ID</key><string>E8896D4F7802E1CA</string>
<key>Track Type</key><string>File</string>
<key>Location</key><string> file://localhost/D:/Altro/MP3/Canzoni%20Brasiliane%20e%20%20Animazione%20Estate/ Adriana%20Calcanhotto%20-%20Esquadros.m4a</string>
<key>File Folder Count</key><integer>3</integer>
<key>Library Folder Count</key><integer>1</integer>
</dict>

Unless every file has a md5 hash (omg, it's only music 🙂 ), I don't see why it shouldn't work.

Jan 6, 2010 3:10 AM in response to flapane

OK, go ahead and edit the XML file and import it, and you'll see what I mean about getting duplicates.


iTunes uses the ITL file as its database. You cannot directly edit the ITL file.
So be sure to make a backup copy of your ITL file before you start fiddling around, so you can get things back.
Anyway, as soon as you open itunes, it will overwrite your edits unless you get rid of the ITL file by damaging it somehow - like renaming it.



You can close itunes, edit the XML, damage the ITL file, and see if that does what you want.
I think itunes might crash due to bad data in the kind, size, & bit rate fields, but go ahead!

Jan 5, 2010 10:27 AM in response to Zevoneer

Editing by hand the xml itunes library (and changing the extension from mp3 to m4a) should work to me, but it would be a pain...
Note that addition/last played and so on AREN'T stored in the files, but in the xml library.

<key>1153</key>
<dict>
<key>Track ID</key><integer>1153</integer>
<key>Name</key><string>Festa </string>
<key>Artist</key><string>Ivete Sangalo</string>
<key>Album Artist</key><string>Ivete Sangalo</string>
<key>Composer</key><string>Anderson "Festa" Cunha</string>
<key>Album</key><string>MTV Ao Vivo</string>
<key>Genre</key><string>Brazilian Music</string>
<key>Kind</key><string>File audio MPEG</string>
<key>Size</key><integer>3323870</integer>
<key>Total Time</key><integer>206367</integer>
<key>Track Number</key><integer>11</integer>
<key>Year</key><integer>2004</integer>
<key>Date Modified</key><date>2009-11-06T17:37:43Z</date>
<key>Date Added</key><date>2006-09-18T20:31:18Z</date>
<key>Bit Rate</key><integer>128</integer>
<key>Sample Rate</key><integer>44100</integer>
<key>Play Count</key><integer>1</integer>
<key>Play Date</key><integer>3273771526</integer>
<key>Play Date UTC</key><date>2007-09-27T19:58:46Z</date>
<key>Skip Count</key><integer>5</integer>
<key>Skip Date</key><date>2009-06-27T01:18:54Z</date>
<key>Artwork Count</key><integer>1</integer>
<key>Persistent ID</key><string>E8896D4F7802E1D7</string>
<key>Track Type</key><string>File</string>
<key>Location</key><string> file://localhost/D:/Altro/MP3/Canzoni%20Brasiliane%20e%20%20Animazione%20Estate/ Ivete%20Sangalo%20-%20Festa.mp3</string>
<key>File Folder Count</key><integer>-1</integer>
<key>Library Folder Count</key><integer>-1</integer>
</dict>

Jan 5, 2010 3:55 PM in response to flapane

flapane wrote:
Of course, but I am trying to understand if this could solve my problem (ie. import ALAC files in iTunes, and then use REPLACE SONGS ripping those files)


Katrina answered that. Yes, if you rerip to ALAC you can use the REPLACE option.

I was answering your FLAC question. You said you already have FLAC files. iTunes, which is the thing with the REPLACE option, cannot handle FLAC files. You will have to use a conversion tool such as DBPoweramp, which does not have a REPLACE option.

If you want to work with your FLAC files, convert them and then do the replacement manually.

Jan 5, 2010 10:21 PM in response to flapane

Yes, what ed2345 wrote. iTunes doesn't support FLAC, so you can't import it to itunes.
Changing the file extension won't fake itunes out, either. iTunes doesn't support FLAC. Pasting an mp3 file extension on a FLAC file doesn't make it an mp3 file, in other words. When you drag it into itunes, absolutely nothing will happen. Try it and see!



If you import a new ALAC file (that you got from your other encoder) into itunes, it gets a fresh entry into the itunes ITL library database with its new Date Added, blank rating and blank play count. Sure, you can then convert that ALAC file to some other format using itunes (which you don't like), but it's not going to replace your old 128kbps file.



In short, since you don't like the itunes encoder, you are in for extra work if you want to keep the itunes metadata such as rating, play count, etc.

Jan 6, 2010 1:48 AM in response to flapane

How sad...
Well, the fact that I prefer another encoder could be left out, but the most important issue is that I had to rip everything in lossless because I couldn't bring all the cd's with me.
If importing the ALAC versions won't work with REPLACE SONGS as inserting a physical cd would do, I think that I'll have to manually substitute every song (weird, boring, tiring, but it seems like there won't any other way).
I tried importing an ALAC with the same ARTIST, ALBUM and TITLE tags of the mp3 version.
Then I created an AAC copy. iTunes didn't ask me if I wanted to replace the old (mp3 version), it simply created the aac file.
Screenshot (mp3,alac,aac): http://img685.imageshack.us/img685/2492/catturad.jpg

Jan 5, 2010 12:44 PM in response to flapane

Thanks for your replies, but I am worried...
I already ripped everything in FLAC because I was home (where I have my phisical stuff) 'till yesterday only. In this way I can start doing the aac rips without any rush.
I am afraid that this could vanish the solution you proposed (furthermore, I tend to prefer another aac encoder than iTunes one), because I'd need to manually insert all the cd's (or at least have the iso images on an hard disk)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Bulk change library files from mp3 to m4a

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.