How to save video stream using VLC in commandline?

Nawaz picture Nawaz · May 19, 2013 · Viewed 19.7k times · Source

I'm trying to save online video using VLC in command line on Window 7 Basic.

Here are few things I tried and worked partially:

I:\movies> vlc http://media.ch9.ms/ch9/7492/a92ae0a6-7b81-4114-b102aa055d147492/E2EMeijerBrachaDartMonadsContinuations.wmv --sout="#duplicate{dst=std{access=file,mux=wmv,dst='file.wmv'}, dst=display}"

It plays the video while streaming, and it also saves the stream to file.wmv. But the saved video doesn't have audio! The command worked partially.

Another try for youtube:

I:\movies> vlc http://www.youtube.com/watch?v=TFr6G5zveS8 --sout="#duplicate{dst=std{access=file,mux=wmv,dst='file.wmv'}, dst=display}"

Same result: saved video without audio. I changed mux=wmv,dst='file.wmv' to mux=webm,dst='file.webm' in the command line, and ran again:

I:\movies> vlc http://www.youtube.com/watch?v=TFr6G5zveS8 --sout="#duplicate{dst=std{access=file,mux=webm,dst='file.webm'}, dst=display}"

It only created the file, but neither video nor audio. Again I tried mux=mp4,dst='file.mp4'. Same result : neither video nor audio, but it created the file.

Any idea how to fix this problem? What am I missing?

As for which version of vlc I'm using, the command vlc --version gives this:

VLC version 2.0.6 Twoflower (2.0.6-7-g729aa7a)
Compiled by fun on fat (Apr  8 2013 23:22:26)
Compiler: gcc version 4.6.3 (GCC) 

Answer

Melissa picture Melissa · Jun 21, 2013

-acodec and -vcodec

Example:

"C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv dshow:// :dshow-vdev="USB Video Device" --sout=#transcode{vcodec=mp2v,fps=60,width=1080,acodec=mp2a,scale=1,channels=2,deinterlace,audio-sync}:standard{access-file,mux=ps,dst="C:\SPI3-Lite\VideoOutput\test1.mpg}