Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tried to convert a file with pacpl, but I get the well-known "256" error. With the -v flag, the FAQ of pacpl tells me:

"The file you are trying to convert is a lossless .m4a file. The format is not yet supported by FAAC/FAAD."

Since faac/faad seems to be used in every other converting tool on Ubuntu, how can I successfully convert formats?

share|improve this question
    
How is the lossless m4a a 24 bit sample? CD's are 16 bit, and SACD's are not rippable by any means, which means it was pointlessly "upconverted" to 24 bit, which is stupid. –  user126919 Jan 29 '13 at 3:25

3 Answers 3

up vote 9 down vote accepted

You can convert an m4a file to flac with the ffmpeg command-line tool:

To install ffmpeg:

sudo apt-get install ffmpeg

To convert:

ffmpeg -i filein.m4a -f flac fileout.flac

share|improve this answer
    
works for me:) Hopefully the pacpl devs will fix the problem –  Graslandpinguin Jan 15 '12 at 22:38
    
`` for file in *.m4a; do echo $file; ffmpeg -i "$file" -f flac "basename "$file" .m4a.flac"; done `` To do a batch conversion of all *.m4a files in directory. –  zetdotpi Jun 13 '13 at 0:04
sudo aptitude install libav-tools

for file in *.m4a; do avconv -i "$file" -f flac "`basename "$file" .m4a`.flac"; done
share|improve this answer

While both the answers involving ffmpeg/avconv (which I think are essentially the same tool) both work, they currently have a flaw. Namely that lossless m4a is often 24 bit sample, and currently ffmpeg/avconv will generally force the conversion to end up in 16 bit sample.

I believe using sndfile-convert (libsndfile) does not have this problem. Likewise, I believe it can be avoided by using mplayer to decode the m4a before encoding it with ffmpeg or flac. I think soundKonverter on KDE may do this for you.

In any case, whatever you do, I suggest checking whether the original and the converted file have the same bit depth of samples.

share|improve this answer
1  
But sndfile-convert can not read iTunes AAC-LC. –  Martin Schröder Nov 30 '12 at 18:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.