Streaming webcams

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
frederick1978
New Cone
New Cone
Posts: 5
Joined: 13 Jul 2007 00:31

Streaming webcams

Postby frederick1978 » 19 Jul 2007 01:21

Dear all,
I tried unsuccessfully to do what follows and my conclusion is that it seems not to be possible. Please correct me if I am wrong.

I would like to host on my website with IP aaBBccDD
1. the streaming coming from a webcam connected to the webserver A (same IP aaBBccDD)
2. the streaming coming from a webcam connected to a computer B with different IP ddEEffGG.
Both the computers have VLC installed.

I observed that
1. If A and B are within the same LAN and the IP are the local IPs, then
1.1 using the RTP protocol for both the streaming
- is possible to see only on the browser of the webserver both the webcams
- none of the webcam will appear on the browser of the computer B
I guess, this is because for both the streaming the RTP protocol requires the local IP of the destination (webserver A)

1.2 using the HTTP protocol
- is possible to see on both the web-browser the webcam connected to the webserver
This is because even if I am able to ping the two computers with no difficulties, with the HTTP protocol I can only stream locally the webcam
connected to webserver A. VLC doesn't allow me to stream from computer B to computer A.

2. If A and B are not within the same LAN and the IP are the static IPs, then
the RTP streaming from A to B and from B to A doesn't seem to work for me (the firewall ports are open)
I can still broadcast the webcam on computer A to the website and see it from computer B.
However there is no way to see the webcam B on computer A.

Why is such ?

Regards
Federico

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: Streaming webcams

Postby dionoea » 19 Jul 2007 13:52

You can only use RTP to stream to an IP address which the server can reach (So basically an IP in the same subnet or a public IP). This is due to RTP using UDP to stream.

HTTP streaming should work to all hosts (even those behind a NAT). What command line/options are you using when configuring the HTTP stream in VLC?
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

frederick1978
New Cone
New Cone
Posts: 5
Joined: 13 Jul 2007 00:31

Re: Streaming webcams

Postby frederick1978 » 21 Jul 2007 14:28

Thanks a lot Antoine for your reply.

The command that I am sending to broadcast the webcam on my website is the following:

vlc -vvv v4l:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/dsp" :v4l-norm=3 :v4l-frequency=-1 --sout '#transcode{vcodec=mp4v,vb=128,scale=1,acodec=mp4a,ab=128,channels=2}:duplicate{dst=std{access=http,mux=ts,dst=111.111.1.102:8082}}'

On the webpage the activeX control has the following parameter in the html code:

...
<param name="MRL" value="http://28.11.0.125:8082" />
...

where 28.11.0.125 is the public IP address of the webserver/website

With these commands I am able to see the webcam broadcast on the web.
However must be observed that the address used for VLC is 111.111.1.102 which is the local IP address of my webserver. If I put 28.11.0.125 VLC won't be able to stream even if I can ping with no problem to that address from any machine within the LAN and outside the LAN.

If I use the RTP protocol to broacast the webcam the command I am using is the following:

vlc -vvv v4l:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/dsp" :v4l-norm=3 :v4l-frequency=-1 --sout '#transcode{vcodec=mp4v,vb=128,scale=1,acodec=mp4a,ab=128,channels=2}:duplicate{dst=std{access=rtp,mux=ts,dst=111.111.1.102:8082}}'

On the webpage the activeX control has the following parameter in the html code:
...
<param name="MRL" value="udp:@111.111.1.102:8082" />
...
or alternatively "udp:@:8082

To be noted that in this case not only I have to put the local address 111.111.1.102 in order to broadcast the webcam to the webserver.
Also in the activeX control of the webpage I have to specify such address, which means that the webcam broadcast will be available only within the LAN.
If I put the public IP 28.11.0.125 in the activeX control and/or in the VLC command the streaming won't work.

In order to do what I need with VLC I should be able to
a. stream the webcam via HTTP specifying a public IP in VLC
or
b. stream the webcam via RTP specifying a public IP either in the ACTIVEX control and in VLC

At the moment these functionalities seem not to be available.

Any suggestions?

Regards

Federico

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: Streaming webcams

Postby dionoea » 23 Jul 2007 14:52

Try using dst=0.0.0.0:<port number>. This will listen on all IP addresses.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

frederick1978
New Cone
New Cone
Posts: 5
Joined: 13 Jul 2007 00:31

Re: Streaming webcams

Postby frederick1978 » 23 Jul 2007 19:28

I did as you suggested, but nothing is changed. :(

However, to be honest with you, I didn't understand the aim of listening on all IPs.

I thought that the address specified by the dst field was the destination address where the streaming was directed to:
hence if I am on computer A with IP aa, and I want to receive the streaming on computer B, with IP bb, I would expect that on the VLC command of computer A the IP specified is bb and not aa (as for example using the RTP connection).

Why when I try to send

vlc -vvv v4l:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/dsp" :v4l-norm=3 :v4l-frequency=-1 --sout '#transcode{vcodec=mp4v,vb=128,scale=1,acodec=mp4a,ab=128,channels=2}:duplicate{dst=std{access=http,mux=ts,dst=bb:8082}}'

from computer A, VLC even doesn't start the streaming (the webcam remains switched off)?

bb can either be the local IP of computer B or the public IP of computer B to which I can ping with no problem ?

Thank you again and apologies for bothering you...


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 32 guests