Live streaming of a webcam using VLC.

About encoding, codec settings, muxers and filter usage
Robbert
New Cone
New Cone
Posts: 2
Joined: 05 Nov 2009 15:10

Live streaming of a webcam using VLC.

Postby Robbert » 05 Nov 2009 15:45

Hi and first of all, thanks for reading!

I've used the search option and found a few threads, but none were really useful in helping me solve my problem of getting a live webcam stream on the internet, using standard embedded objects. I don't want the end user to install anything, only codecs if that really has to be done.

To accomplish this, I've attempted to follow the wikiHowTo page on this subject along with this page on the VLC wiki, but to no avail.

Okay, setup:
I'm on a LAN, behind a router. The computer with the webcam has IP 192.168.2.249 and I want it to broadcast over port 8080. As a result, I've poked open port 8080 for both TCP and UDP packets and unblocked VLC in the Windows Firewall just to be sure. There's a few other PCs hanging in the network, but those are not important for the setup.

I can use DirectShow to view the webcam and, using the streaming options, I have been able to stream the webcam over LAN and I have been able to view it using VLC on another PC in the same LAN.

My goal is that the PC with the webcam streams the video stream to the internet, over port 8080 using MMSH. There's no need for audio and there's no need need for a server inbetween: I want the video stream to be streamed directly from the PC to which the webcam is connected.

I want something like this on the server side:

An ASX/WVX file that points to the stream that is being streamed/served by VLC

Code: Select all

<ASX version = "3.0"> <TITLE>RealDetection webcam stream</TITLE> <Entry> <Ref href = "mms://[Our_WAN_IP]:8080" /> </Entry> </ASX>
[Our_WAN_IP] of course points to us on port 8080 and in the firewall, NAT is being used to redirect all UPD and TCP traffic on port 8080 to the PC with the webcam.

An HTML file that embeds the ASX/WVX in a player:

Code: Select all

<OBJECT id="MediaPlayer0" width="400" height="300" style="position:absolute; left:0;top:0;" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> <PARAM name="filename" value="stream.wvx"> <PARAM NAME="SendPlayStateChangeEvents" VALUE="True"> <PARAM NAME="AutoStart" VALUE="True"> <PARAM name="uiMode" value="full"> <PARAM name="PlayCount" value="9999"> <PARAM NAME="stretchtofit" value="false"> </OBJECT>
A player directly pointing to the stream would be just fine, too.

What I've tried so far:
1. Media -> Streaming
2. Go to 'Capture Device' tab
3. Set Video device to Logitech QuickCam Messenger
4. Set audio device to None
5. Click Stream
6. I keep the source as is ('dshow://')
7. In destinations, I add MMS as destination. I click on Add.
8. Not too sure on what to enter in address, but I enter the local IP of the PC (192.168.2.249)
9. I set port on 8080
10. Click next
11. In the Generated Stream Output String, I change a few things. It basically says this: :sout=#transcode{vcodec=h264,vb=800,scale=1}:std{access=mmsh,mux=asfh,dst=192.168.2.249:8080}
12. I then click Stream

Now VLC appears and it says "Streaming" at the bottom of the screen and I can view the stream on LAN by opening VLC on another computer and opening the stream at mssh://192.168.2.249:8080, but I am incapable of viewing it online. Whenever I go to the webpage that contains the player which directly points to mssh://[WAN_IP]:8080 as its source, the screen just remains black and it's the same with the player which refers to the ASX/WVX file.

Does anyone know what I'm doing wrong? :\ I can't get this to work, no matter what I do. I've done it with TinCam, so it must be possible with VLC, too.

Greg
Cone that earned his stripes
Cone that earned his stripes
Posts: 316
Joined: 24 Feb 2009 00:37

Re: Live streaming of a webcam using VLC.

Postby Greg » 05 Nov 2009 18:34

Leave the dst address either blank or 0.0.0.0
re your points
8.
11.

Re point 11. Just use the default Win-asf or the DIV3 asf, otherwise it won't work! You can tweak the parameters, but just leave as standard for the first time. Eh!

Re read and follow the VLC simple stream wiki and try it with http and <metafile>.asx
Also
If you use the simpler example to point to the metafile, like

<embed src="localstream1234.asx">

instead of your embedded WM Media player html
Then the client does not need to have WM Media player and thus can be read by nearly all browsers/players

Robbert
New Cone
New Cone
Posts: 2
Joined: 05 Nov 2009 15:10

Re: Live streaming of a webcam using VLC.

Postby Robbert » 06 Nov 2009 10:02

Hi Greg!
You're a lifesaver, thank you! I've got it up and running now, using WMV2 and WMA, but I took the audio part out of the transcode. Works perfectly now with roughly five seconds of latency, with which we can live.

Thanks again!

yviyvi
New Cone
New Cone
Posts: 1
Joined: 29 Sep 2017 02:15

Re: Live streaming of a webcam using VLC.

Postby yviyvi » 29 Sep 2017 02:22

hi friends, I am trying to figure out how to capture a video and live stream it from vlc server to vlc client, I am stuck on it for few days, so frustrating, can anyone please give me some directions?

Thank you very much!!


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 20 guests