Page 1 of 1

scripting question

Posted: 26 Aug 2014 06:46
by strangelove
I'm trying to write a script to do something that I'm able to do with the gui.

(I hope that I'm posting to the correct area, if not I apologize.)

(macbook OS X 10.9.4)

I'm able to do this by going to "Convert & Stream" - "Choose Profile = Audio MP3" -> Save as file (Open Media and open my mp4 video file before hand)

I'd like to do this with a script.

I tried:

/Applications/VLC.app/Contents/MacOS/VLC -I rc video.mp4 --no-sout-video --sout '#std{mux=raw,dst=file.mp3}'

but the created file did not show any duration in vlc...

Not really sure what I'm doing. Any help would be appreciated. :)

(BTW, does vlc happen to write what it does in scripting languge?)

(Also, where does vlc.msg.dbg write to? And why does "dialog" not seem to work in my lua scripts?)

Thank you!!!

Re: scripting question

Posted: 03 Sep 2014 13:32
by L5730
If you go through the GUI as if you were going to Stream to File, select your transcode settings etc, then the final page should show the generated output string.
Something like:
:sout=#transcode{vcodec=none,acodec=mp3,ab=320,channels=2,samplerate=44100}:file{dst=d:/desktop/afile.ts,no-overwrite} :sout-keep

For converting to .mp3 audio only.

So your syntax would be something like:
VLC file:///<input file> :sout=#transcode{vcodec=none,acodec=mp3,ab=320}:file{dst=d:/desktop/a_file.mp3,no-overwrite} :sout-keep

It'd take the sample rate and channels from the original file, and spit out a 320 kbs MP3 at the destination file.
I'm on Windows so it may be a little different, but the VLC syntax will be very similar.

Re: scripting question

Posted: 06 Sep 2014 07:30
by strangelove
Thank you L5730!!!

I have discovered (with your help) that the following works:

/Applications/VLC.app/Contents/MacOS/VLC -I rc video-and-audio.mp4 --no-sout-video --sout-audio --sout "#transcode{acodec=mp3,ab=128}:std{access=file,mux=raw,dst=just-the audio.mp3}"