Convert Audio Tracks From Video Files

Overview | Extract | Convert

You can convert audio tracks (m4a/m4b, mp3, wav, ...) from video files (mp4, mov, flv, avi, ...) to virtually any audio format by installing Audacity software and following some easy steps.

The steps boil down to

  1. Open the file (File -> Open...).
  2. Optionally edit the track.
  3. Export the audio file (File -> Export..).
Note: If what you want is and exact copy of the audio track with no resampling loss or any other modification you can directly extract audio tracks from video files with FFmpeg.

If you only want to transcode the audio (convert it to another audio format or compress to reduce file size) you can simply open the video file and export an audio file.

You can also use Audacity to improve the audio in various ways before you export. There are countless possibilities; here are just a few:

  • Trim out unwanted portions.
  • Improve the balance of a stereo track that needs it.
  • Convert stereophonic audio to monaural audio.
  • Normalize to a desired playback volume.

The example on this page explains how to extract an audio track from an MPEG-4 video file and export it as a high-quality—somewhere between FM radio and CD quality—Ogg Vorbis audio file. The result is a file that's perfect for listening on a smartphone as an audiobook with Smart Audiobook Player, an excellent $2.00 Android audiobook player app.

You can easily adapt these instructions to other audio formats and quality levels to suit your needs.

Why Ogg Vorbis? Because my Android device has limited space compared to devices I've had in the past. I spent an afternoon doing some rigorous experimentation and determined Ogg Vorbis files have high quality and small file sizes compared to m4a (AAC) and MP3 files. YMMV.

Install Audacity

Audacity runs on Windows, macOS, and Linux. It's excellent software.

Follow the instructions on the Audacity Download page. For Windows and macOS, install these:

  • Audacity
  • FFmpeg for Audacity
  • LAME for Audacity

I always install the LADSPA plugins too.

On Linux install Audacity, FFmpeg, and LAME. Older Linux distributions may require special steps because the project forked and libav packages replaced ffmpeg packages for a while. For example, on Ubuntu 14.04 and Mint 17 you'll need to install FFmpeg via PPA.

Steps to Extract, Edit, and Convert Audio

These steps create an optimized Ogg Vorbis (.ogg) file from the audio track of an MPEG-4 (.mp4) video file. The steps were arrived upon after several iterations of testing and refinement.

There are five steps, three of which are optional.

Step 1: Open the video file in Audacity using File -> Open.... Audacity will automagically pull the audio track out of the file using FFmpeg for Audacity.

Step 2 (optional): If the audio is stereo that could be mono (Q&A), convert it to mono.

Method 1 (original audio was mono, both tracks are the same):

  1. Split the stereo track to mono (Track Dropdown Menu -> Split Stereo to Mono). (more info)
  2. Delete one track. (Click the X next to the Track Dropdown Menu .)

Method 2 (original audio was stereo):

Use Tracks -> Stereo Track to Mono.

Step 3 (optional): Trim away portions of the track if appropriate.

Step 4 (optional): Normalize the track if appropriate. (Q&A)

  1. Use Effect -> Normalize.... (more info)
  2. Check all three boxes.
  3. Normalize to -0.2dB [sometimes 0dB, sometimes -0.5dB]

Step 5: Export the audio .

  1. Use File -> Export Audio....
  2. Export it as Ogg Vorbis, quality level 4.
  3. Add the Artist Name and Album Title metadata.
  4. For multi-part volumes, add a Track Number too.

Exporting From Audacity

Exporting your audio track from Audacity encodes it into your chosen audio format (AAC, MP3, Ogg Vorbis,...) and writes it to a file with the appropriate extension (.m4a, mp3, .ogg,...).

Most people will probably prefer to export MP3 files because they're familiar with MP3. If you're adventurous, give Ogg Vorbis a try. My Android device plays .ogg files just fine and they sound great. File sizes are small compared to MP3 and AAC (.m4a). Your mileage may vary.

When you choose "lossy" format like MP3, AAC, and Ogg your main sub-choice will be the compression level. Compression level affects sound quality and file size as trade-offs. Audacity's default compression level for your chose format will likely give you audio files with good quality and reasonable file sizes for music.

Entering metadata during export

You'll have an opportunity to add metadata when you export. Metadata embedded within your files describes the audio content and can be displayed by your player during playback. It's also used when you are searching for tracks.

The default metadata fields—Artist Name, Track Title, Album Title, Track Number, Year, Genre, and Comments—match the standard MP3 ID3 tags. You you can add your own custom tags if you wish.

Questions and Answers

Why would I convert to mono?

Sometimes the stereophonic audio in a video file was monaural audio originally. Mono audio gets converted to stereo as a by-product when the video file is created. Converting it back to mono creates smaller audio file with perfect balance during playback.

How can I determine whether the original audio was stereo or mono?

You can determine whether the original audio was stereo or mono by listening in Audacity and watching the Playback Meter, or sometimes by looking at the waveforms, which will match if the source audio was mono.

Why delete one track rather than using Tracks -> Split Stereo to mono?

The delete-one-track method avoids introducing audio artifacts.

What if a track is stereo and I want mono for a smaller file size and perfect balance.

If the original material was stereo you may want to convert it to mono anyway. That would be properly done by using Tracks -> Split Stereo to mono.

When is it appropriate to normalize a track?

If the waveform looks like it has too much or (more typically) too little gain, you can normalize the track. Normalizing your collection of audio files will cause them to play back at similar volume to one another. Normalizing can also help quiet tracks play back loudly enough on a small (e.g. mobile phone) speaker.

I don't want to lose any audio quality by re-encoding. Is that possible?

Yes, certainly. You can export using a lossless audio format such as WAV or FLAC. Beware that file sizes will be larger.

Page last modified on September 11, 2016
Powered by PmWiki