Extract audio from MP4 without re-encoding #

Several approaches distilled (and tested) from MacRumors:

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.