Stream Webcam with VLC

By | 2010/06/29

How can I stream video from my webcam in Linux?

One way is to use VLC! VLC can make a stream accessible over http, for one example.

On the streaming computer, make sure first that a webcam or video device is connected. Then issue this command from the terminal:

vlc "v4l2://" --v4l-vdev="/dev/video" --v4l-adev="/dev/null" --sout #transcode{vcodec=theo,vb=256}:standard{access=http,mux=ogg,dst=:1234}" -I dummy

Leave that running – this will create a video stream available from that computer’s ip address on port 1234.

Now, use VLC on any other computer to connect to your video stream!

For instance if the streaming computer’s ip address is on your home network, you would use VLC to open this http network stream:


You can also get creative with port forwarding in your router to access this outside of your home network. Though streaming video out across the internet of course depends on your available upstream bandwidth.


6 thoughts on “Stream Webcam with VLC

  1. matt

    Doesn’t work in ubuntu 11.10

    vlc: unknown option or missing mandatory argument `–v4l-vdev=/dev/video0′

    1. scott Post author

      This should work – I’ll check it out later.

      vlc v4l2:///dev/video0 --sout '#transcode{vcodec=theo,vb=256}:standard{access=http,mux=ogg,dst=:1234}'
  2. samsunix

    Try these

    cvlc v4l2:// :v4l2-vdev="/dev/video0" --sout '#transcode{vcodec=x264{keyint=60,idrint=2},vcodec=h264,vb=400,width=368,heigh=208,acodec=mp4a,ab=32,channels=2,samplerate=22100}:duplicate{dst=std{access=http{mime=video/x-ms-wmv},mux=asf,dst=:8082/stream.wmv}}' --no-sout-audio &

    remeber change port to 8082 and add “/stream.wmv” in the end when opening with vlc. you can also open it with firefox your.ip.add.ress:8082/stream.wmv

  3. Hmm

    Could you, like, explain what each of those command line options does? So that people could solve problems on their own instead of just blindly copying and pasting a command line?

    No? Why, did you just blindly copy and paste it?

  4. Craig

    This worked, but it’s awful laggy. I’m streaming from one laptop on my lan to another. Seems to pause, then gets a dylithium crystal boost, then pauses again. I’m trying to figure out a way for someone with cancer to attend a church service being held within wifi range of where she’s stuck.


Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.