Extract audio from MP4 without re-encoding #
Several approaches distilled (and tested) from MacRumors:
- Simply changing the extension from MP4 to M4A "works", but the video track remains, taking up valuable space. For example, using the extraction methods below, a 760MB MP4 shrunk to a mere 42MB M4A with no loss of sound quality (and no time wasted transcoding).
- FFmpeg (free and open source)
- $ ffmpeg -i video.mp4 -vn -acodec copy audio.m4a
- MPEG Streamclip (free)
- Open MP4 in MPEG Streamclip
- "File" > "Save Track" > "Save Audio Track..." > "MP4" > "Save"
- Change file extension from MP4 to M4A
- Fission (shareware)
- Open MP4 in Fission
- "File" > "Save Audio..." > "Save AAC (Original Format, Lossless)" > "Save" (save with M4A extension)
- QuickTime Pro 7 (commercial)
- Open MP4 in QT Pro 7
- "Window" > "Show Movie Properties"
- "Sound Track" > "Extract" (another approach is simply to delete the video track from the MP4: "Video Track" > "Delete")
- "File" > "Save As..."
- "Save as a self-contained movie" > "Save"
- Change file extension from MOV to M4A
FFmpeg is also handy for losslessly extracting audio from other formats like FLV:
AAC/M4A:
$ ffmpeg -i Glenn_Gould_plays_Bach.flv
...
Stream #0:1: Audio: aac, 44100 Hz, stereo, s16, 84 kb/s
...
$ ffmpeg -i Glenn_Gould_plays_Bach.flv -vn -acodec copy audio.m4a
MP3:
$ ffmpeg -i バスごっこ.flv
...
Stream #0:1: Audio: mp3, 22050 Hz, mono, s16, 64 kb/s
...
$ ffmpeg -i バスごっこ.flv -vn -acodec copy audio.mp3
and for batch conversions, e.g.,
$ for f in *.mp4; do ffmpeg -i "$f" -vn -acodec copy "${f%.mp4}.m4a"; done
/mac | Nov 22, 2012
Subscribe or visit the archives.