Page 1 of 1

Transcoding audio via command line

Posted: 10 Apr 2013 19:31
by SciFry
Hello,
I am looking into writing some scripts to convert audio files from one format to another (such as WAVE to MP3 and MP3 to WAVE)

I found this link online and tried to run the sample script on a sample song (within that directory), but it no longer seems like it's a valid syntax.

Code: Select all

PS C:\Users\bla\Documents> vlc -I dummy -vvv "06 Twisted Transistor.mp3" --sout=#transcode{acodec=fl32,channels=2,ab =128,samplerate=44100}:standard{access=file,mux=wav,dst="output.wav"} vlc://quit At line:1 char:77 + vlc -I dummy -vvv "06 Twisted Transistor.mp3" --sout=#transcode{acodec=fl32,cha ... + ~ Missing argument in parameter list. At line:1 char:134 + ... ard{access=file,mux=wav,dst="output.wav"} vlc://quit + ~ Missing argument in parameter list. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MissingArgument
I looked at the docs and found the transcoding documentation, but it didn't come with examples and I am not sure how to get it up and running. Could someone point me in the right direction and maybe give me some sample code on how the docs work for transcoding audio. Thank you!

The docs that I believe are relevant:

Code: Select all

Audio: --sout-transcode-aenc=<string> Audio encoder This is the audio encoder module that will be used (and its associated options). --sout-transcode-acodec=<string> Destination audio codec This is the audio codec that will be used. --sout-transcode-ab=<integer [-2147483648 .. 2147483647]> Audio bitrate Target bitrate of the transcoded audio stream. --sout-transcode-alang=<string> Audio Language This is the language of the audio stream. --sout-transcode-channels=<integer [-2147483648 .. 2147483647]> Audio channels Number of audio channels in the transcoded streams. --sout-transcode-samplerate=<integer [-2147483648 .. 2147483647]> Audio sample rate Sample rate of the transcoded audio stream (11250, 22500, 44100 or 48000). --sout-transcode-audio-sync, --no-sout-transcode-audio-sync Synchronise on audio track (default disabled) This option will drop/duplicate video frames to synchronise the video track on the audio track. (default disabled) --sout-transcode-afilter=<string> Audio filter Audio filters will be applied to the audio streams (after conversion filters are applied). You can enter a colon-separated list of filters.

Re: Transcoding audio via command line

Posted: 10 Apr 2013 19:51
by Jean-Baptiste Kempf
Put the "" around your sout argument.

Re: Transcoding audio via command line

Posted: 11 Apr 2013 00:11
by SciFry
Put the "" around your sout argument.

Code: Select all

PS C:\Users\bla\Documents> vlc -I dummy -vvv "06 Twisted Transistor.mp3" "--sout=#transcode{acodec=s16l,channels=2,a b=128,samplerate=44100}:standard{access=file,mux=wav,dst="output.wav"}" vlc://quit
That made it run, but I did not get the output.wav file.

Re: Transcoding audio via command line

Posted: 11 Apr 2013 00:30
by Jean-Baptiste Kempf
because it should be after the = and not aroudn the dst

Re: Transcoding audio via command line

Posted: 11 Apr 2013 02:21
by SciFry
because it should be after the = and not aroudn the dst
Fixed, You sir are a beautiful human being, thank you for your patience and time! :D

Re: Transcoding audio via command line

Posted: 11 Apr 2013 15:14
by Jean-Baptiste Kempf
Cool ;D