Categories Multimedia

Extract audio from MKV, MPEG-4 files with Audacity and FFDMpeg


Would you like to enjoy the music on a DVD and transfer it to your PC? Use Audacity, the free, open-source, and multi-platform audio editor capable of decoding a wide range of formats with FFMpeg and LAME MP3 libraries.

Prerequisites

Download and install Audacity first from the following link:

Audacity (2.0) MiB, 7,482 downloads)

To benefit from export and import features, we need to install the MP3 Blade codec and the FFMpeg library specially designed for Audacity:

Ffmpeg Library (2.4) MiB, 11,672 downloads)

Codec MP3 blade (401.4) KiB, 6,154 downloads)

You now have all the tools to decode your audio streams.

N.B. : Don't forget to choose each of the above libraries based on your operating system.

Import the audio stream of a MKV file

MKV files contain both audio and video streams. It is possible to import a 5.1 stream and then export it in stereo by merging the tracks. However, note that it is unnecessary to try to keep data in 5.1 if you do not have the right equipment (sound card and 5.1 speakers).

Start Audacity and open the menu File. Do then Import then select Audio...

Capture d'écran - Audacity, importation du fichier vidéo contenant la piste sonore
Screenshot — Audacity, import of the video file containing the soundtrack

Then locate your video — a MKV file in our example, from which you want to extract the sound. Wait a few moments, time for Audacity to plot the flow curve.

Capture d'écran - Audacity, courbe audio du fichier importé
Screenshot — Audacity, audio curve of imported file

It’s very likely that you don't want to export the entire soundtrack. Make a selection directly on the track or use the digital tools at the bottom of the window.

By entering the start and end values, you will gain in precision.

Export audio to MP3 or other

The selection made, make File then Export selection... Enter a file name and select MP3 Files from the audio drop-down list. To adjust the quality of the final file, click on Options... then increase the quality to 320 kps.

Capture d'écran - Audacity, exportation stéréo du fichier en haute qualité
Screenshot of screen — Audacity, stereo file export in high quality

Make OK to validate and then Save to start the export process.

Fans of sound editing will not be content with an MP3 file and will prefer loss-free formats such as Apple AIFF or FLAC.

Capture d'écran - Audacity, réglages de la qualité d'exportation sonore
Screen capture — Audacity, sound export quality settings

Audacity is definitely a Swiss knife essential to edit its audio files. The richness of this software would require the creation of a section on its own!

6 comments

Leave a Reply

  • fred02840

    Good morning,
    With a MacIntel (but I think the method is valid with other OS), it is possible to extract the sound part of an mpg video file. To do this, it is necessary to install the two libraries mentioned above (FFMpeg and Lame mp3), locate them in the “Preferences”. Then, file->importer->audio to locate the mpg file. A window appears that shows the import of sound.
    For export in mp3, follow the above instructions.
    That’s all...

  • Sigmund

    Glad to see a new tutorial that doesn't talk about Windows Vista/7 this time. This manipulation can be useful, thank you very much!

  • Middle.Man

    Good morning.

    First of all, congratulations for the excellent quality of your tutorials that saved me a lot of time!

    If I may, I also found software from the FreeTime editor that automatically converts all videos to batch on the fly into audio format (MP3, WAV, FLAC...).
    This software is called Format Factory, I‘ve been using it for a while and I can’t part with it anymore. It also converts to all image formats, and to many other formats.
    I didn't find better personally, so I strongly recommend it for anyone looking for a simple converter for use, and in French!

    http://www.pcfreetime.com/

    I hope to have made a modest contribution.

    Good continuation to you!

  • De la Martinière

    Good morning,

    I'm trying to import an MKV file into the “Swiss Knife” Audacity. In vain.
    I get a popup with this: Without the optional FFmpeg library, you cannot...”
    I downloaded this bookshop. And watched a video in English where everything is going wonderfully.
    But I also found a lot of comments where people expose the same problem as mine.
    Would you have a solution?
    A big thank you in advance.
    De la Martinière