While the above answers where useful in helping me arrive at an answer to the question, they did not work as perhaps because they do not work on Windows (10) or VLC has since been updated to accept different switches. In particular, I will expand upon joctee's answer
vlc -I dummy input.wav ":sout=#transcode{acodec=mpga,ab=192}:std{dst=output.mp3,access=file}" vlc://quit
Here -I dummy
runs vlc without showing the GUI and vlc://quit
closes vlc once the conversion is complete.
On Windows 10, running 3.0.12
I need to run the following command (simplified).
vlc input --sout="[TRANSCODECOMMAND"]
Where input is the input file name and output is sout capture from the debugger.
Full example, in my case to convert an MP3 to a WAVE file:
vlc _AI_NylStr_MonRibb_Sft-G2-0.mp3 --sout="#transcode{vcodec=none,acodec=s16l,ab=160,channels=2,samplerate=44100,scodec=none}:std{access=file,mux=wav,dst=_AI_NylStr_MonRibb_Sft-G2-0-44100k.wav}" vlc://quit
Additionally, to capture the "sout" command, in the VLC GUI go to Tools -> Messages and change Verbosity to 2 as descibed by chiliNUT and run the conversion in the GUI.
This gave the following debug output in the first 3 lines.
qt debug: MRL(s) passed to the Sout: 1
qt debug: MRL(s) passed to the Sout: file:///C:/Users/alexh/source/repos/WaveEditor/WaveEditor/bin/Debug/samples/_AI_NylStr_MonRibb_Sft-A2-0.mp3
qt debug: Transcode MRL: sout=#transcode{vcodec=none,acodec=s16l,ab=160,channels=2,samplerate=44100,scodec=none}:std{access=file{no-overwrite},mux=wav,dst='C:/Users/alexh/source/repos/WaveEditor/WaveEditor/bin/Debug/samples/_AI_NylStr_MonRibb_Sft-A2-0.wav'}
From that output copy everything from #transcode
to the end of the line and pass it as the parameter to --sout[TranscodeParameter]
.
From the above example [TranscoderPameter]
#transcode{vcodec=none,acodec=s16l,ab=160,channels=2,samplerate=44100,scodec=none}:std{access=file{no-overwrite},mux=wav,dst='C:/Users/alexh/source/repos/WaveEditor/WaveEditor/bin/Debug/samples/_AI_NylStr_MonRibb_Sft-A2-0.wav'
So the full argument is:
--sout="#transcode{vcodec=none,acodec=s16l,ab=160,channels=2,samplerate=44100,scodec=none}:std{access=file,mux=wav,dst=_AI_NylStr_MonRibb_Sft-G2-0-44100k.wav}"
Note you can use relative path names if working in a different directory and run vlc using the full path to the executable.
"C:\Program Files\VideoLAN\VLC\vlc.exe" _AI_NylStr_MonRibb_Sft-G2-0.mp3 --sout="#transcode{vcodec=none,acodec=s16l,ab=160,channels=2,samplerate=44100,scodec=none}:std{access=file,mux=wav,dst=_AI_NylStr_MonRibb_Sft-G2-0-44100k.wav}" vlc://quit