[HOW TO] Migrate your iTunes library to Linux


Recommended Posts

Ok so you've encoded you're ENTIRE iTunes library in Apple's ACC, like me :). But now you want to play those files on you're new Linux box. Problem is .m4a support is sketchy, at least for me it was. I could get the files to play with KPlayer but not with XMMS or amarok, amarok being what I really wanted to use. So I decided I'd just convert them instead of re-encoding them from the discs.

WARNING!!: THE FOLLOWING SCRIPT CONVERTS .M4A'S TO .MP3'S. THE PROCESS CONVERTS .M4A'S TO .WAV'S FIRST, WHICH ARE QUITE LARGE(~400MB), SO BE SURE TO HAVE SOME EXTRA SPACE ON YOUR HARD DRIVE SO THE SCRIPT CAN COMPLETE. THE ORIGINAL FILES AS WELL AS THE .WAVS ARE DELETED AT THE END OF THE SCRIPT. IF YOU DON'T WANT THIS TO HAPPEN REMOVE THE APPROPRIATE LINES FROM THE BOTTOM. YOU HAVE BEEN WARNED!!!

WARNING!!: THE FOLLOWING CONVERSION PROCESS STRIPS THE FILES OF ANY META-DATA(i.e Artists,Albums) ASSOCIATED WITH THEM. YOU WILL HAVE TO RE-APPLY THE META-DATA WITH SOME OTHER APP. YOU HAVE BEEN WARNED!!

NOTE: This HOWTO assumes you have mplayer and lame installed.

1. First of of all make a file for the conversion script and call it whatever you please. Copy the following into that file. I named my allinone.sh


#!/bin/bash
#
# Dump m4a to wav (first step in conversion)

for i in *.m4a
do
mplayer -ao pcm "$i" -aofile "$i.wav"
done

#!/bin/bash
#
#Second step... use lame to convert into .mp3

for i in *.wav
do
lame -h -b 192 "$i" "$i.mp3"
done

#!/bin/bash
#
# Remove extrenuous extensions.

for i in *.mp3
do
x=`echo "$i"|sed -e 's/m4a.wav.mp3/mp3/'`
mv "$i" "$x"
done

rm *.wav
rm *.m4a

2. Now give the file execution access with chmod +x allinone.sh

3.Next get your .m4a files you want to convert organized. Mine are still in the directory structure that iTunes has, Artists as root directories with Albums as subdirectories. Or maybe you have all your music in one folder :). Whaterever your case may be cd to the directory that has the files that you want to convert. I recommend doing an album at a time because once an album is done thats when I re-apply my meta-data. Plus doing 1000 songs at once would take forever, not to mention the space taken up by the .wav files.

albert@albert-linux ~/albert-drive/music/metallica/black album $ ls
01 enter sandman.m4a     05 wherever i may roam.m4a   09 of wolf and man.m4a
02 sad but true.m4a      06 don't tread on me.m4a     10 the god that failed.m4a
03 holier than thou.m4a  07 through the never.m4a     11 my friend of misery.m4a
04 the unforgiven.m4a    08 nothing else matters.m4a  12 the struggle within.m4a

4. Run the script from the location you saved it with ./allinone.sh

5. Depending on the size/number of files in the directory you run the script on it may take some time to complete. But the result is .mp3's from .m4a's!!

6. Re-apply meta-data if you wish....rinse/repeate/enjoy

Is there ANY way possible to have it delete the m4a file after each conversion, I say this because I tried this script earlier from linuxquestions.org (or a very similar script), and my hdd was filled up in no time.

Thanks.

edit: maybe i SHOULD just do one album at a time, but I have 3600 songs to convert from m4a :cry: :cry: :cry:

A little bit of judicious editing of the above script should suffice?

#!/bin/bash
#
# Dump m4a to wav (first step in conversion)

for i in *.m4a
do
	mplayer -ao pcm "$i" -aofile "$i.wav"
	rm "$i"
done

#!/bin/bash
#
#Second step... use lame to convert into .mp3

for i in *.wav
do
	lame -h -b 192 "$i" "$i.mp3"
	rm $i
done

#!/bin/bash
#
# Remove extrenuous extensions.

for i in *.mp3
do
	x=`echo "$i"|sed -e 's/m4a.wav.mp3/mp3/'`
	mv "$i" "$x"
done

A side note, I recommed easytag for reapplying tags and changing file names. The interface and the options may seem overwelming at first but just give it a chance. Its a really robust program that allows you to modify a large number of files at once. It also can connect to CDDB to look up tags.

A side note, I recommed easytag for reapplying tags and changing file names. The interface and the options may seem overwelming at first but just give it a chance. Its a really robust program that allows you to modify a large number of files at once. It also can connect to CDDB to look up tags.

586268480[/snapback]

I installed it yesterday just for changing all my id3 tags, very cool program. :D

I installed it yesterday just for changing all my id3 tags, very cool program.  :D

586268738[/snapback]

Yes it is. Though it took me at least 30-45 minutes to figure out how to use it :). Before that I was ready to rip out my hair getting it to do what I wanted. But once I figured it out it made the conversion process move quite quickly.

  • 4 weeks later...
  • 1 month later...
  • 3 weeks later...
  • 2 months later...
  • 4 weeks later...

This is possibly the worst solution for this problem. It's time consuming, lowers the quality of your music files (transcoding of any type will always lower the quality), and it's completely unneccessary. I've been playing aac files in linux (using xmms) for years now (i.e. pre iTunes) using faad2 and libmp4. They are easily obtained in many distributions using the package management tools - whether it be rpm or deb based (I don't know if other packaging systems have them available). Other sources such as the rarewares website or the penguin liberation front (plf) may be of use.

Of course, nothing in this post (or parent's) addreses DRM'ed music bought from the iTunes store.

  • 1 month later...

iTunes in Wine/Crossover Office is very slow, I wouldn't recommend it.

Does anyone know a program that can organize the music library the way iTunes does in Linux?

I find JUK to be very much like itunes, and Amarok similar to Musicmatch.

I find JUK to be very much like itunes, and Amarok similar to Musicmatch.

GTKPod has all of those beat, hands down. heck, if you even use the .99.x builds.. it even has video support to sync up with your ipod video.

and its rock solid. ..suprisingly. lol.

  • 4 weeks later...

I had this problem recently and went through various converters trying to convert from m4a to mp3, until I found the perfect one, which also keeps all tags right.

http://www.dbpoweramp.com/

It's a freeware. You need to download it, then install the mp3 codec or plugin whatever it is. I converted about 2000 m4a's using this.

Honestly, i wouldn't convert AAC files to MP3, you loose quality.

there is nothing wrong with AAC files, they are better quality than MP3 files are (designed to replace MP3), and they are also a open specification (AAC is MPEG-2 Part 7 and the newer version is MPEG-4 Part 3), same as MP3 (MPEG-1 Audio Layer 3), so it's not like they are a closed spec controlled by one company.

  • 1 year later...

dbpoweramp is definitely a great program. I've used it before to do some big conversions. The only problem is that it's Windows only. For future reference, if you don't have a Windows box available, I wrote a little program to convert M4A files to MP3 files, keeping the artist, album, song name and track number tags. It's available here.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Frankly, I blame whoever is writing such articles. "A big improvement/update and/or new feature is now available to everyone! Also, use this unofficial tweak tool to enable it because it actually isn't available to you yet officially and might not in fact even be entirely ready or whatever, hence why it is perhaps not enabled for you*. But it's great and you should enable it!" I mean there's nothing wrong with sharing info about some feature you might need to enable via unofficial means, of course. It's just that these articles tend to essentially end up being two news pieces in one, and one of them tends to be a bit misleading. (*Yes, yes, the "it's a controlled rollout!" thing. Not a fan of that one either. The argument, not the actual rollout.)
    • Thank you. Will do. I read in the release notes that editor config might be at play here.
    • Actually, I think even Microsoft doesn't know how to control it
    • OpenAI is making Codex more useful in Chrome and the cloud by Pradeep Viswanathan OpenAI's Codex now has more than 5 million users, up nearly 4x from earlier this year. To further accelerate Codex's growth among developers, OpenAI today announced that it has agreed to acquire Ona, a company that builds secure cloud execution and orchestration technology for developers. Ona will enable developers to run Codex with persistent and controlled cloud infrastructure for long-running agentic workflows. Right now, most Codex execution happens locally on developers' laptops and PCs, and the agents work continuously for hours. Through Ona, OpenAI aims to make Codex agents keep working for days without being tied to a user’s local machine or an active session. This will be an important capability for enterprises that want to deploy AI agents in production while maintaining control over infrastructure, data, security boundaries, credential scope, logging, and review workflows. Like any acquisition, the deal is still subject to customary closing conditions, including regulatory approvals. Until the deal closes, OpenAI and Ona will continue to operate as separate companies. After closing, Ona’s team will join the Codex team to improve developer workflows. Alongside the Ona acquisition announcement, OpenAI today introduced a few Codex updates. Developers can now save Codex rate limit resets and use them later instead of losing them when they are not needed immediately. OpenAI is also adding a referral option where users can invite a friend to Codex and get a saved rate limit reset. OpenAI today also announced a developer mode for browser use in Chrome and the Codex in-app browser. With this mode, Codex can use the Chrome DevTools Protocol to debug web apps, inspect pages, and work more directly with browser-based development workflows. Developers can use this when they want Codex to profile JavaScript, inspect console output and network traffic, examine web page states including the DOM and applied styles, and more.
    • Camtasia 2026.1.3 by Razvan Serea TechSmith Camtasia is the complete professional solution for high-quality screen recording, video editing and sharing. Camtasia 2026 makes editing your videos easier, and faster than ever. The new editor is packed with enhanced video processing, all-new production technology, an innovative library, and stock videos and other creative assets to help you create more polished, professional videos. No video experience needed. Anyone can create informative, engaging videos. Create professional, eye-catching videos: Add special video effects - Apply Behaviors that are perfectly designed to animate your text, images, or icons. Get a crisp, polished look without being a professional video editor. Drag-and-drop your edits - What you see is what you get. Every effect and element in your video can be dropped and edited directly in the preview window. And you can edit at resolutions up to beautiful 4K, for clear video at any size. Get exceptional performance - Camtasia takes full advantage of your computer’s processor with 64-bit performance. You’ll get fast rendering times and enhanced stability—even on your most complex projects. Camtasia 2026.1.3 changelog: Feature Updates Improved keyboard navigability in tool panels. Improved screen reader accessibility of headings in Preferences. Tool panels can now be resized using a keyboard-navigable control. Updated color of folder icon in User Library tab for better visibility. Grouped media now render a composite waveform considering all audio media within that group. Added Long Path Aware to the manifest of Editor and Recorder. Performance Improvements Improved performance for editing groups on the timeline. Improved the project loading performance when timeline has lots of trec media with cursor data. Updates for IT Administrators Updated cpp-httplib from 0.38.0 to 0.43.3. Updated expat from 2.7.4 to 2.8.0. Updated freetype from 2.13.3 to 2.14.3. Updated harfbuzz from 13.0.1 to 14.2.0. Updated libpng16 from 1.6.55 to 1.6.58. Updated pango from 1.57.0 to 1.57.1. Updated girepository from 2.86.3 to 2.88.0. Updated pcre2-posix from 10.47.0 to 12.0.2. Added new harfbuzz-gpu.dll. Updated FFmpeg from 7.1.1 to 7.1.2. Updated aom from 3.11.0 to 3.13.1. Updated dav1d from 1.5.0 to 1.5.1. Updated ogg from 1.3.5 to 1.3.6. Updated SDL2 from 2.32.4 to 2.32.10. Updated zlib from 1.3.1 to 1.3.2. Updated Nalpeiron binaries to version 4.4.69.3. Bug Fixes Fixed an issue which prevented some user submitted crash reports from being sent. Fixed a potential memory leak when decoding HEVC or VP9 video. Fixed a potential crash when trying to delete a range selection on a magnetic track. Fixed a bug with the Properties Panel showing stale properties when only a caption is selected on the timeline. Fixed an issue that could prevent the Opacity and Blur properties from being changed in the Background Removal effect. Fixed an issue where larger Camtasia online projects may fail to open in Camtasia Editor. Table of contents thumbnails are no longer created for Smart Player exports with no table of contents. Fix resetting skew revert to revert just skew and not scale as well. Fixed editing in Snagit with snagX file with Unicode characters. Fixed a bug where grouped visual media could be cropped in some cases. Fixed importing SnagX files with Unicode characters. Localization fixes. Download: Camtasia 2026.1.3 | 309.0 MB (Shareware) View: Camtasia Homepage | Tutorials | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      Jamswaz earned a badge
      One Month Later
    • Week One Done
      Jamswaz earned a badge
      Week One Done
    • Rookie
      Marzoid went up a rank
      Rookie
    • Community Regular
      coch went up a rank
      Community Regular
    • One Year In
      slackerzz earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      511
    2. 2
      PsYcHoKiLLa
      188
    3. 3
      +Edouard
      157
    4. 4
      Steven P.
      83
    5. 5
      ATLien_0
      75
  • Tell a friend

    Love Neowin? Tell a friend!