Page 1 of 1

Command line transcoding YouTube to mp3 audio

Posted: 30 Jul 2017 01:56
by Daddy-o
Through the GUI I often transcode YouTube lectures to local mp3 for podcasts and I wish to automate the process on the command line.

This command started from a successful GUI-based effort, a modification from level 2 messages output and using the help examples as a template.

Windows 10, up to date OS and VLC Media Player 2.2.6 Umbrella.

Instead of writing an mp3 to disk, this command spawns a YouTube stream and creates a second entry in the playlist to a non-existent file.
It displays the YouTube title correctly in the first entry, shows the art and completes.
The second entry is apparently the local file, I don't recognize the icon but it looks like piece of paper.
The intended name of the second playlist entry appears as BillBurrontheBan.mp3}
It immediately errors (below.)
I can't get rid of the closing brace after the mp3 in the file name.

This is the command:
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -vvv https://www.youtube.com/watch?v=OcrMFbcyJ8A sout="#transcode{vcodec=none,acodec=mp3,ab=192,channels=2,samplerate=44100}:#std{access=file{no-overwrite},mux=mp3,dst=C:\Drive_D\MP3s\Podcasts\20170729-Test\BillBurrontheBan.mp3}"

I've put a second example below the first error output. It's the same, minus the transcode{-to-}: section.

I'll provide any errors or output you require.

I really like VLC, it's the best.

Result from command above:
From Errors dialog (not messages output:)
File reading failed:
VLC could not open the file "C:\Drive_D\Documents and Settings\Regular Reed\Computer\sout=#transcode{vcodec=none,acodec=mp3,ab=192,channels=2,samplerate=44100}:#std{access=file{no-overwrite},mux=mp3,dst=C:\Drive_D\MP3s\Podcasts\20170729-Test\BillBurrontheBan.mp3}" (Bad file descriptor).
Your input can't be opened:
VLC is unable to open the MRL 'file:///C:/Drive_D/Documents%20and%20Settings/Regular%20Reed/Computer/sout%3D%23transcode%7Bvcodec%3Dnone%2Cacodec%3Dmp3%2Cab%3D192%2Cchannels%3D2%2Csamplerate%3D44100%7D%3A%23std%7Baccess%3Dfile%7Bno-overwrite%7D%2Cmux%3Dmp3%2Cdst%3DC%3A/Drive_D/MP3s/Podcasts/20170729-Test/BillBurrontheBan.mp3%7D'. Check the log for details.

Another example:
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -vvv https://www.youtube.com/watch?v=OcrMFbcyJ8A sout="#std{access=file{no-overwrite},mux=mp3,dst=C:\Drive_D\MP3s\Podcasts\20170729-Test\BillBurrontheBan.mp3}"

File reading failed:
VLC could not open the file "C:\Drive_D\Documents and Settings\Regular Reed\Computer\sout=#std{access=file{no-overwrite},mux=mp3,dst=C:\Drive_D\MP3s\Podcasts\20170729-Test\BillBurrontheBan.mp3}" (Bad file descriptor).
Your input can't be opened:
VLC is unable to open the MRL 'file:///C:/Drive_D/Documents%20and%20Settings/Regular%20Reed/Computer/sout%3D%23std%7Baccess%3Dfile%7Bno-overwrite%7D%2Cmux%3Dmp3%2Cdst%3DC%3A/Drive_D/MP3s/Podcasts/20170729-Test/BillBurrontheBan.mp3%7D'. Check the log for details.

TIA,
Daddy-o

Re: Command line transcoding YouTube to mp3 audio

Posted: 30 Jul 2017 14:44
by RĂ©mi Denis-Courmont
Missing some dashes or colon there. You probably did not quite copy the whole string from the wizard.

Re: Command line transcoding YouTube to mp3 audio

Posted: 31 Jul 2017 14:55
by Daddy-o
Thanks for the feedback. I used a simple mouse-drag highlight to copy the string from debug output and had to modify it to get it to display the YouTube title, so I agree it's probably a punctuation tweak.

Do you have a favorite place to look up how VLC parses command lines? I'm betting there is some more manual linux-to-windows conversion of the strings to make it work.

When I succeed I intend to post a concise issue/answer pair. TIA