Sunday, April 26, 2009

Streaming webcam using VLC

VLC is definitely more than just a video player. It has lot of interesting features and extensions which are not explored by all. By enabling one of its various input interfaces, it is even possible to program against your VLC player -- I had written a clip-list application quite sometime back that automatically directs vlc player to play only portions of a given video (maybe a post later).

I'm not really interested in streaming my webcam but this was actually useful for me for a different reason. I actually started writing a post on that, and felt that this topic is worth a post by itself -- some people might just want to stream webcam.

It's pretty simple.
  1. Start VLC (all my instructions/snapshots will be as of vlc 0.9.6).
  2. Before proceeding further, let us open the VLC's console, so we know if there is any error during the process. To open the console, Menu: Tools -> Add Interface -> Console. VLC will throw log messages into this console.
  3. Menu: Media->Stream (or ctrl -S)
  4. Choose the 'Capture Device' tab (btw, you can stream a video/audio file/DVD using the appropriate tabs)
  5. Under the 'Video device name' drop down choose your camera (you can even stream your desktop by choosing it in 'Capture Mode').
  6. Click on Stream. A new window pops up. This is where you provide the streaming options.



  7. A simple method is to stream over HTTP -- this specially helps to get across firewalls/networks without glitch. Provide the IP address of the interface in which you want to stream your video. Eg., if you have a multi-homed computer, you might want to bind it only to your private network and not your internet IP. Choose an appropriate port of your choice. Even 80 would do.
  8. Under Profile, choose Windows (wmv/asf) -- If you understand, you can opt to choose the right profile as you see fit.



  9. Now click on stream and your video should start streaming. If everything was fine, you should see a 'creating httpd' message in the console without any other relevant error messages following it (sometimes you might not have an appropriate encoder or the port binding might fail etc.,). Also the VLC player UI's status pane should show 'Streaming'.
That's it. Now to view the streaming video on any other machine in the network,
  1. open VLC on any other machine
  2. Menu: open Network (or control - N)
  3. Select HTTP in protocol and the IP address of the machine where you are streaming. The port number stays disabled for me (Workaround: change the protocol to RTP, change the port and change the protocol back to HTTP :) )
  4. Click on Play.

28 comments:

  1. Thank you, works great!

    ReplyDelete
  2. but is same thing possible if the computers are not in a same network?i mean through internet global ip?

    ReplyDelete
  3. This is great! Thank you :)

    ReplyDelete
  4. I'm so tired.... sorry if this is too brief. I've tried every combination to get WMP on my HTC Touch Pro to work. (WMP 10 Mobile for PPC, v10.3 Build 19972).
    What is the syntax for opening a stream from VLC, eg. mms://192.168.1.107:8080 ??.
    I can open the stream in WMP 10 on another laptop, using just mms://192.168.1.107:8080
    But on the Mobile, I just get various error messages based on the syntax I try.
    Thanks for any info.

    ReplyDelete
  5. Hey, I noticed you are playing with Vitamin D. I am trying to get vlc to restream content and have vitamin d pick it up. So far I have gotten as far as causing VLC to crash when Vitamin D attemtps to connect! That seems pretty close to me!

    Have you tried that?

    ReplyDelete
  6. @Barnes: I have not used WMP on WinMo as a stream-player, so not sure of the syntax. In general, the you should make sure that the player uses the same protocol as the streamer (and connect to the correct port as necessary).

    @michael: I don't use Vitamin D. That's so strange the VLC crashes on connect. Try upgrading the VLC in case you aren't running the latest one. If not, raise this issue in videolan forums.

    ReplyDelete
  7. Thanks man. We´re using it in our company for smaller conferences. 8-)

    ReplyDelete
  8. Hey!
    Good tutorial.. Can you post to do the similar thing in the latest version of VLC? I think it v.1.1.5 (as of now).
    I unable to get it right on this version :(

    ReplyDelete
  9. I'd love to see a tutorial for the v1.17. I can
    t get anything to happen and I' usually able to figure these kids of things out. has anyone been able to stream a webcam with the new version. VLC's forum sucks. Next to impossible to get help with it.

    ReplyDelete
  10. hello guys, my name is tony.i was able to stream a live webcam feed from pc1 to pc2 which relay it to pc3.i have done it with RTP and UDP, but i am only getting images... i.e. the reception on pc3 is INCREDIBLY slow... what can i do to make it work?
    thank you for your help

    ReplyDelete
  11. of course vlc forum suck, it sucks lot

    ReplyDelete
  12. vlc is pain in ass, don't waste you time with it. it's like linux- every guy like programmers- for what? like in the world nothing much? lakes, rivers, mountains. don't waste you time with it.

    ReplyDelete
  13. It worked for me at last. Just not sure, if you need to install more Drivers or Codecs, i installed Manycam and ffdshow. Mainly, i manually choose my Webcam at VLC from the Pulldown Menu and my Soundcard, and it shows up in 1.1.11 even without an Server. Under Codecs Information in Extra i have at Stream 0 Planar 4:2:0 YUV, at Stream 1 Audio PCM S16LE(araw). Webcam is a No Name Webcam.

    ReplyDelete
  14. Errr, My Bad, Now it works when only, when i go to Media - streaming - Capture Device, pick Webcam and Soundcard, click stream below, at Destination, once, File - Activate Transcoding WMV+WMA, and another http, replacing (/) with 127.0.0.1. Check Displaylocal, next, SAP announce with any Characters as Desciption, next click stream.

    ReplyDelete
  15. VLC sucks, there are 9824723984732473287 different versions, and EVERY SINGLE ONE OF THEM is TOTALLY DIFFERENT.

    ReplyDelete
    Replies
    1. What version were these directions written for?

      Delete
  16. Great thanks for sharing this post. I was looking for something like this. Your post have inspires me a lot.Thanks. Corporate Films || Live Streaming || products photography

    ReplyDelete
  17. This is the first time i am reading your post and admire that your post which gives users lot of information regarding particular topic thanks for this share. Corporate Film Production || Animation Video Production Company

    ReplyDelete
  18. IP-camera sofa-sex on firefox + chrome: 109.90.153.129 has login admin1 password: 123 on port 80 enjoy!!!

    ReplyDelete
  19. IP-camera sofa on firefox + chrome: 109.90.155.106 has login admin1 password: 123 on port 80 enjoy!!!

    ReplyDelete
  20. hot house-IP-camera 109.91.101.8 admin1 pass: 123

    ReplyDelete
    Replies
    1. New IP 109.91.100.109 admin admin

      Delete
  21. This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post.
    streaming de video

    ReplyDelete
  22. Hi, I am using VLC 2.2.4 Weathermax. I am very new to VLC and streaming. I am trying to stream a desktop webcam/microphone to a RTSP stream... I don't think I have the correct settings because I cannot get anything to connect.

    ReplyDelete
  23. Hi, I am using VLC 2.2.4 Weathermax. I am very new to VLC and streaming. I am trying to stream a desktop webcam/microphone to a RTSP stream... I don't think I have the correct settings because I cannot get anything to connect.

    ReplyDelete
  24. This is fascinating, however it's important in order to click this particular hyperlink: Alanis

    ReplyDelete
  25. IP-Sofa-Cam 178.201.91.5 admin admin

    ReplyDelete