The open source tool
ffmpeg is something of a swiss army knife of multi-media manipulation, you can do nearly everything with it. It also has one of most confusing collection of command-line switches I have encountered. Where as in traditional Unix tools you can specify the input without switches, ffmpeg works the other way around. The error report is also quite obscure. This means that when I want to something with it, I typically have to read the manual again to get anything done, or hope somebody has written down the exact instruction for what I want to do.
If you just want to extract the audio track of a video file
B.m4a, the command is the following:
ffmpeg -i A.mp4 -acodec copy -vn B.m4a
This will not do any transcoding, but just change the containers (i.e. no conversion loss), the
-acodec copy switch tells ffmpeg to just copy the audio stream, and the
-vn switch tells ffmpeg to drop the video stream. Quite clear when you know it…