Difference between revisions of "VLC HowTo/Extract audio from a file"

From VideoLAN Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
The following example under this show how to extract audio from a working video file like file.ts in command line.
+
{{Howto|extract audio from a video}}
 
+
The following example shows how to extract audio (<code>file.mp3</code>) from a working video file (<code>file.ts</code>) via [[command-line]]:
 
  vlc file.ts --no-sout-video --sout '#std{mux=raw,dst=file.mp3}'
 
  vlc file.ts --no-sout-video --sout '#std{mux=raw,dst=file.mp3}'
  
Line 7: Line 7:
 
  vlc -I dummy --sout "#transcode{acodec=s16l,channels=2}:std{access=file,mux=wav,dst=OUTFILE.wav}" INFILE.mp4 vlc://quit
 
  vlc -I dummy --sout "#transcode{acodec=s16l,channels=2}:std{access=file,mux=wav,dst=OUTFILE.wav}" INFILE.mp4 vlc://quit
  
With this, you can build scripts to mass-convert multiple files, for example in Bash (Linux, Mac OS X) to convert all files ending in lowercase "mp4" you would use:
+
With this, you can [[VLC HowTo/Transcode multiple videos|build scripts to mass-convert multiple files]], for example in Bash (Linux, Mac OS X) to convert all files ending in lowercase "mp4" you would use:
 +
 
 +
for i in *mp4; do vlc -I dummy --sout "#transcode{acodec=s16l,channels=2}:std{access=file,mux=wav,dst=$i.wav}" "$i" vlc://quit; done
  
for i in *mp4; do vlc -I dummy --sout "#transcode{acodec=s16l,channels=2}:std{access=file,mux=wav,dst=$i.wav}" $i vlc://quit; done
 
 
==See also==
 
==See also==
 
* article ''[[Extract audio]]''
 
* article ''[[Extract audio]]''
 
[[Category:How To]]
 

Latest revision as of 04:24, 9 June 2019

This page describes how to extract audio from a video. Other "how to" pages

The following example shows how to extract audio (file.mp3) from a working video file (file.ts) via command-line:

vlc file.ts --no-sout-video --sout '#std{mux=raw,dst=file.mp3}'

The following example will prevent the GUI from appearing and converts the audio to .wav:

vlc -I dummy --sout "#transcode{acodec=s16l,channels=2}:std{access=file,mux=wav,dst=OUTFILE.wav}" INFILE.mp4 vlc://quit

With this, you can build scripts to mass-convert multiple files, for example in Bash (Linux, Mac OS X) to convert all files ending in lowercase "mp4" you would use:

for i in *mp4; do vlc -I dummy --sout "#transcode{acodec=s16l,channels=2}:std{access=file,mux=wav,dst=$i.wav}" "$i" vlc://quit; done

See also