Is there a command line tool for Windows to extract audio aac from mp4 ?
4 Answers
FFmpeg can do it. Here is a list of commands that might come useful for you. Go here for instructions.
Example:
ffmpeg -i INPUT.mp4 -c copy -map 0:a:0 Output.aac
-i: input file-c copy: copies the bitstreams without re-encoding-map 0:a:0: selects track from: 1st input file -> audio tracks -> first track (1st audio track from 1st input file)
Note that it would work similarly with avconv, which is a fork of ffmpeg.
mp4box can also do this.
To demux/extract aac from mp4 (assuming audio is the 2nd track):
mp4box -raw 2 video.mp4
This will automatically create output file "video_track2.aac"
(Use mp4box -info video.mp4 to get a list of the tracks in the MP4 file.)
If you wanted control over the output filename, you would do
mp4box -raw 2 video.mp4 -out audio.aac
If you wanted to remux back into mp4 container (i.e. for iTunes) you could do:
mp4box -single 2 video.mp4 -out audio.m4a
You could then put this in a batch script to operate over all the files in a directory:
for %%f in ("*.mp4") do (
mp4box -single 2 "%%f" -out "%%~nf.m4a"
)
(batch script inspired by videohelp and stackoverflow)
Download links:
Here’s the actual commands to use since all the provided links don’t actually give them, and anyway: links rot and die so should always be replaced with actual answers on stackexchange.
avconv -i input.mp4 -vn -c:a copy output.m4a
- 647
I first just use mkvtoolnix to convert the MP4 to MKV and use mkvextract gui to extract the needed track. Lot less complicated and full GUI. Absolutely zero change in any component whatsoever.
- 19