1

I'd like to extract the audio out of any video file (not dvds).

I have easy access to OS X and Bash and I'm very comfortable with both.

Thoughts?

2 Answers 2

4

The command-line tool ffmpeg can do this.

ffmpeg -i input.mp4 -map 0:a -c copy output.m4a

The above will work for MPEG audio (MP3, AAC), and AC3 and ALAC audio. If it is MP3 audio, you'd be better off using output.mp3; if it's FLAC or Vorbis, use output.ogg.

If you want to extract any audio to a fairly high-quality MP3, use

ffmpeg -i input.mp4 -map 0:a -c libmp3lame -q:a 2 output.mp3

If your video uses more than one audio track (different languages, for example) you can select a single audio track with: -map 0:a:0to select the first audio only, -map 0:a:1 to select the second audio track, and so on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .