Convert m4a/mp4 to mp3

I stumbled across some m4a files a few days ago and I really wanted them in mp3 format. The conversion itself was not that complicated, since I based my script on the previous Convert flac to mp3 post and script. The tricky pars was figuring out what decoder I needed to use on Linux.

To make the search even more confusing, there are actually two file extensions for the same thing: m4a and mp4. Read more about the war between them here. I finally figured out I needed the package faad. Why not mp4dec or m4adec or even mp4 or m4a? We will never know.

Anyway, the following one-liner requires faad and lame installed. It keeps the filename and changes only the extension. It doesn’t keep any ID3 tags (btw, are they called id4 tags in case of mp4 files and i4d files in case of m4a !?).

Just run these in the directory where you keep the files:

  • for mp4 files:
  • for F in *.mp4; do faad -o - "$F" | lame -h --vbr-new -V 0 - "`basename "$F" mp4`"mp3; done

  • for m4a files:
  • for F in *.m4a; do faad -o - "$F" | lame -h --vbr-new -V 0 - "`basename "$F" m4a`"mp3; done

You will get a mp3 file for each of the mp4/m4a files.

Enjoy ;)

Image credit: Andrew Mason.

TwitterFacebookLinkedInGoogle ReaderYahoo MessengerEmailGoogle GmailYahoo MailPrintShare

Related posts:

  1. Convert flac to mp3
  2. Convert Xmail to Dovecot users

Leave a Reply

Your email address will not be published. Required fields are marked *

*


6 − = five

CommentLuv badge