Page 1 of 1

Extracting audio from an .mp4 file

Posted: 17 May 2015 10:51
by vlcstudent
There’s an option to “convert” the audio from a video file:

Media / Open multiple files / Add / Play / Convert

and then one can select the file type one wants the audio in. What bugs me is the word “convert.” My file is in an .mp4 format, which is described as “Video H.264 + mp3” in the list one can select from. This means the .mp3 file is already there and the only thing we need is to cut the video out of it. Will the program do it that way, or will it convert the sound to something else, let’s say .wav and then convert it to .mp3 again? The .mp3 file has an already reduced quality. Will the program keep the same file or will it “convert” it, as it’s called, reducing the sound quality even further?

Re: Extracting audio from an .mp4 file

Posted: 20 May 2015 01:19
by JSLover
My file is in an .mp4 format, which is described as “Video H.264 + mp3” in the list one can select from.
...the option "Video - H.264 + MP3 (MP4)" is NOT saying that that is the current format your file is in, it is simply the 1st conversion option in the list. Selecting it will convert any input into the format specified, which is not what you want. Those are simply "conversion profiles", all of the default ones will actually "convert" & not preserve the original. You can create your own & call it "Extract Audio", for example, but the name does not make it do what it says. I could try to explain the UI method, but...

Yes, you can "extract" the audio from a video without converting it...please see my in-depth research here...
...but the short answer is: use the VLC command line...it may be possible in the UI, but the command line is so much easier for this.

To Extract an Audio Track from a Video file using the VLC Command Line...
  • Syntax for Extracting the 1st (or only) Audio Track from a Video...
    • "<path-to-vlc.exe>" "<input-filename>" --no-sout-video ":sout=#file{dst=<output-filename>}"

      <path-to-vlc.exe> should be the full path to vlc.exe, for example...
      • C:\Program Files\VLC\vlc.exe
      • C:\Program Files\VideoLAN\VLC\vlc.exe
      • C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
      <input-filename> should be the full path to the file you wanna extract the audio from

      <output-filename> should be the full path to the file you wanna save the audio-only version to
    Code for Extracting Audio Track 1...
    • Code: Select all

      "vlc.exe" "FILENAME.mkv" --no-sout-video ":sout=#file{dst=FILENAME.audio-only.vlc-out.mkv}"
    Real Example for Extracting Audio Track 1...
    • Code: Select all

      "C:\Program Files\VLC\vlc.exe" "C:\Path\to\FILENAME.mkv" --no-sout-video ":sout=#file{dst=C:\Path\to\FILENAME.audio-only.vlc-out.mkv}"
To Extract the 2nd (or 3rd, 4th, etc) Audio Track from a Video file using the VLC Command Line...
  • Syntax for Extracting the 2nd (or 3rd, 4th, etc) Audio Track from a Video...
    • "<path-to-vlc.exe>" "<input-filename>" --no-sout-video :audio-track=<audio-track-num-minus-1> ":sout=#file{dst=<output-filename>}"
      • Note: <audio-track-num-minus-1> should be the 0-based track number...
        • 0 for Track 1
          1 for Track 2
          2 for Track 3
          ...etc...
    Code for Extracting Audio Track 2...
    • Code: Select all

      "vlc.exe" "FILENAME.mkv" --no-sout-video :audio-track=1 ":sout=#file{dst=FILENAME.audio-track-2.vlc-out.mkv}"
    Real Example for Extracting Audio Track 2...
    • Code: Select all

      "C:\Program Files\VLC\vlc.exe" "C:\Path\to\FILENAME.mkv" --no-sout-video :audio-track=1 ":sout=#file{dst=C:\Path\to\FILENAME.audio-track-2.vlc-out.mkv}"