Using a VLC command-line to silently capture video from a webcam, or to capture a series of frames as images, is not well documented IMHO. I have therefore given examples and simple explanations below. The same commands should apply for Windows (tested with VLC 1.0.1), linux or the Mac-OS. (To open a DOS window under Windows, click Start/Run, type in "cmd" and use the DOS command "CD" to navigate to the VLC directory, or use the MicroSoft CmdHerePowertoySetup gadget).
++++++++++++++++++++++++++++++++++++++++
VLC silent capture of an AVI video from a webcam
First determine the :sout string to transcode the video. In the VLC GUI, select Media/Open CaptureDevice, select Direct Show and the Video Device name eg "Monitor Webcam". At the bottom, instead of "Play" select "Stream" in the pull-down menu to the left. The Stream Output dialogue shows the source as dshow:// Click on Destinations, select File, click Add and enter the filename eg D:\temp\test.avi Select Activate Transcoding with the default Profile "Video - H.264 + AAC (TS)" Finally, click on Options and copy the :sout string to a single VLC command line at the end of the other switches (below).
vlc dshow:// :dshow-vdev="Monitor Webcam" :dshow-adev="none" :dshow-size="640x480" :dshow-caching=1000 --run-time=2 -V dummy --intf=dummy --dummy-quiet :sout=#transcode{vcodec=h264,vb=800,scale=1,acodec=mp4a,ab=128,channels=2,samplerate=44100}:std{access=file,mux=ts,dst=D:\temp\mytest.avi}
Explanation of the less obvious switches (see http://wiki.videolan.org/VLC_command-line_help )
dshow:// : outputs with direct show
:dshow-vdev="Monitor Webcam" : this defines the input as the direct show device "Monitor Webcam"
:dshow-adev="none" : there is no audio device (the default will be used if we omit this switch)
:dshow-caching=1000 : the cache time is 1000 milliseconds
--run-time=2 : runs for 2 seconds (corresponding to only a ~1 second capture)
-V dummy : this suppresses the actual video window
--intf=dummy : this also suppresses the VLC interface window
--dummy-quiet : this suppresses the progress log window, so nothing at all pops up
:sout=#transcode{...}:std{...} : this specifies the output transcode and file as found from the VLC stream interface setup
Note that switch prefixes -- or : or - simply determine the extent of the switch and can often be interchanged.
++++++++++++++++++++++++++++++++++++++++++
VLC silent capture of a jpg snapshot from a webcam
I posted this under another heading, but include it here for completeness. Silently capturing a snapshot from a webcam, or a series of frames as images, can be done with the single VLC command-line:
vlc --dshow-vdev="Monitor Webcam" --dshow-size=640x480 -V dummy --intf=dummy --dummy-quiet --video-filter=scene --no-audio --scene-path=D:\temp --scene-format=jpeg --scene-prefix=snap --scene-replace --run-time=1 --scene-ratio=24 "dshow://" vlc://quit
Explanation of the less obvious switches (see http://wiki.videolan.org/VLC_command-line_help )
--dshow-vdev="Monitor Webcam" : this defines the input as the direct show device "Monitor Webcam"
-V dummy : this suppresses the actual video window
--intf=dummy : this also suppresses the VLC interface window
--dummy-quiet : this suppresses the progress log window, so nothing at all pops up
--video-filter=scene : scene apparently replaces the earlier image, which no longer works
--scene-replace : is supposed to replace an existing snapshot snap.jpeg, but instead it creates snap.jpeg.swp
--run-time=1 : inputs for 1 second
--scene-ratio=24 : outputs every 24th frame (ie 1 frame for 25 fps PAL)
"dshow://" : outputs with direct show
vlc://quit : quits silently after finishing; the user sees nothing but snap.jpeg appearing in D:\temp
Some of these switches are not really needed eg removing --scene-replace and setting --scene-ratio=3 will give a series of snapshots of every 3rd frame.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remaining requirements for complete command line control of VLC capture
1. We still need a command line switch that will list the available direct show devices.
2. We still need a command line switch that will list the permitted resolutions of these devices.