Extracting audio from an .mp4 file

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
vlcstudent
New Cone
New Cone
Posts: 1
Joined: 17 May 2015 10:46

Extracting audio from an .mp4 file

Postby vlcstudent » 17 May 2015 10:51

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?

JSLover
Cone that earned his stripes
Cone that earned his stripes
Posts: 116
Joined: 20 Mar 2012 00:08
VLC version: 2.1.5
Operating System: Win7
Location: r.secsrv.net/youtube.lua

Re: Extracting audio from an .mp4 file

Postby JSLover » 20 May 2015 01:19

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}"
"why the f*** do i need a google+ account to comment on a video?" — jawed (2013) (about YouTube's new requirement of Google+)

youtube.lua — Play YouTube videos in VLC!
Updated: Thu, Jan 15, 2015 --- 1/15/15, 7:19:19pm EST

forum.videolan.org/viewtopic.php?f=29&t=111977&p=379147#p379147
Sigh, the above can't be a link: "You cannot use certain BBCodes: [url]."...so, I can't even link back to a post on this forum?
How about this: can long-term/trusted users be allowed links in sigs?


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 103 guests