1

I am using VLC for extracting/converting audio from a .mp4 video to a .mp3.
The screenshot below shows the menu option I am choosing enter image description here and then enter image description here

My question is, how do I do this using the command line?

2

This works:

cvlc INFILE --no-sout-video --sout-audio --sout="#transcode{acodec=mp3,ab=320,channels=2,samplerate=48000}:std{access=file,mux=raw,dst=OUTFILE.mp3}"

with

  • acodec - audio codec
  • ab - audio bitrate

The only problem when I try it is that cvlc does not exit after finishing the transcode. I don't know why. I have to use CTRL+C when the size of the output file does not change anymore.

References:

https://wiki.videolan.org/VLC_command-line_help/

https://wiki.videolan.org/VLC_HowTo/Extract_audio/

  • Will this work on MacOS? – A j Jul 27 '19 at 11:24
  • Good question. I admit I tested it only on Linux, but the syntax should be the same. Why don't you just give it a try? Have a look at the macOS section here: wiki.videolan.org/Command-line_interface – synouser Jul 27 '19 at 11:47
  • 1
    I tried it and it works, MasOS does not seem to have cvlc, I tried VLC and kept the rest of the line as you provided. I got the following message 'VLC[6306:1015241] Can't find app with identifier com.spotify.client', but the mp3 is created and works fine. – A j Jul 27 '19 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.