What is the easiest way to wrap a raw .aac file into a .m4a container
-
09-06-2019 - |
Question
This question is overflow from the following question:
How do I programmatically convert mp3 to an itunes-playable aac/m4a file?
Anyway, I learned how to create an aac file and then i found out that an aac is not just an m4a file with a different file extension. In fact, I need to somehow wrap the aac into an m4a container. Ideally I'd be able to simply make a call to the command line.
Solution
mp4box if you want a dedicated tool; its probably the easiest way to go. ffmpeg can do the job too.
OTHER TIPS
ffmpeg
is a general purpose (de)muxer/transcoder. MP4Box
is a (de)muxer/transcoder from GPAC, a package dedicated to MP4 related software tech. Right now it seems wiser to use MP4Box because it rights the moov atom at the beginning of the file, which is important for streaming and ipod playing.
Use ffmpeg like this:
ffmpeg -i input.aac -codec: copy output.m4a
Use MP4Box like this:
MP4Box -add input.aac#audio output.m4a
avconv -i input.aac -acodec copy output.m4a
In my case, without the explicit flag to copy, it re-encodes the audio for some odd reason.
Just use any mp4-Muxer like Yamb to create an mp4
-file with only the aac
audio track in it, then change the file extension to m4a
.