22
12
I can issue this command:
ffmpeg -i input.mp3 -acodec alac -ab 128k -ar 48000 -ac 2 -y output.m4a
to create a m4a file.
But when I issue this command
ffmpeg -i input.mp3 -acodec alac -ab 128k -ar 48000 -ac 2 -y output.aac
ffmpeg is throwing an error saying
Could not write header for output file #0 (incorrect codec parameters ?).
Also, the size of the m4a file is really almost 5.8 times larger than the original file, which is absolutely not what I wanted and why I wanted to convert to AAC.
1@tripleee Actually no, .m4a files are identical to .mp4 (it's just a convention naming for mp4 files with audio only), but have a different format than .aac (which is known as an ADTS stream). You can also force FFmpeg to output in ADTS format by adding
-f adts
. – Bigue Nique – 2016-03-22T03:32:55.560On Ubuntu 12.04 I was unable to use an option
-c:a
, does this have any synonym? I guess it might mean-acodec:a
but in the end I just dropped it, andffmpeg
was able to deduce a codec based on the desired output file name. (Need-strict experimental
though; and threw in-map_metadata 0:0
for good measure, to preserve ID3 tags.) – tripleee – 2013-10-03T07:47:44.033Also worth noting: I wanted M4B files (audiobooks), which
ffmpeg
does not appear to support, but converting into M4A and then just renaming seems to work. – tripleee – 2013-10-03T07:53:36.770@tripleee That means you're using an outdated program called
– slhck – 2013-10-03T07:57:31.257ffmpeg
, but it's really not from FFmpeg, but the Libav fork. Ubuntu unfortunately bundled it instead of the "real" ffmpeg. See: Who can tell me the difference and relation between ffmpeg, libav, and avconv@slhck: Thanks for the quick update and the link! – tripleee – 2013-10-03T08:00:50.173