Extracting the audio track from videos, and downmixing

On Ubuntu/Debian, you can use ffmpeg (in the package of the same name) to extract the audio only from video files:

$ ffmpeg -i input.ogm -ab 128k -vn output.ogg

ffmpeg detects the input and output formats automatically, so you can also convert to an MP3 (for example) just by specifying an output filename of the appropriate extension.

When converting audio for listening while working out or while traveling, it's also useful to downmix stereo to mono so you can listen with just one earbud without missing anything:

$ ffmpeg -i input.ogm -ab 128k -ac 1 -vn output.ogg

(Thanks to Rene Moser for the pointer. Also check out sox if you are looking to apply more sophisticated audio transformations.)

Further reading: ffmpeg command-line tool documentation


  1. Also check out
    if you want to see the terrifying effects of more sophisticated audio transformations.

  2. Wow. Terrifying, indeed!