Streaming, from a webcam, to a server, out to public

About encoding, codec settings, muxers and filter usage
wtilton
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Oct 2006 21:55

Streaming, from a webcam, to a server, out to public

Postby wtilton » 01 Oct 2006 23:17

I'm having problems understanding how to stream a webcam device out to a server so that users can connect and view the stream.

What I'd love is if someone can point me to or explain how to:

1) Set up the video casting device (in this case a webcam) to connect to the server. I believe this is "Open Capture Device" but from there...

2) Set up the server so it can stream the video out to the users. Do I open the connection? Is it live already? How do I get it to accept the incoming video?

3) What the user's will use to connect to the video. A URL, a MMS source? How would I set this up?

TIA. I'm going to heavily document this process as I think this should be a simple task but it's been taking me all morning and I haven't gotten anywhere.

wtilton
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Oct 2006 21:55

Postby wtilton » 02 Oct 2006 04:29

I keep fiddling with things, one of the things I notice is how do I know if things are working?

On my remote machine, with the video source, what happens when I connect to the server correctly? Right now I see a timer that counts upwards but I don't see any source video or anything.

On my server, how can I tell when the remote machine connects?

Lister
New Cone
New Cone
Posts: 7
Joined: 07 Sep 2006 22:27

Postby Lister » 02 Oct 2006 12:07

What OS are you using?

The first thing to to is to make sure you can view your webcam using vlc, so you want to "open capture device", and find your webcam in the input list. (If you are on Windows, I found that I had to "refresh" the list before the webcam appeared).

Once you are getting an image from the webcam, you need to transcode the video to whatever format you fancy. If you are using the GUI there is a tick box to allow this, which allows you to select codecs and transport formats etc. I would take a look at the streaming tutorial as there is too much stuff to explain here :)

wtilton
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Oct 2006 21:55

Postby wtilton » 02 Oct 2006 20:00

My bad, I'm using a Quickcam 4000 in Windows XP.

Server is Windows 2003.

Question, can I use Windows Media Encoder to send the video to the server setup with VLC? I've used that along with Windows Media Server to accomplish this in the past. I can't figure out how to set that up again either.

I have been reading the tutorials, and the documentation but I'm not sure which machine I'm supposed to be setting up as...

"Open Capture Device" - My machine with the webcam, I check the box to stream to my IP after transcoding. (UDP, DIV3, MP3)

"Open Network Stream" - My Server where I also check the box to stream the incoming stream out via MMS. (MMS, DIV3, MP3)

"Open Network Stream" - On the client where I just type in the mms://<myip>:<myport>

Problem is I see nothing to indicate that the first two work. The client machine tells me it can't connect. I can't really troubleshoot to see for instance, if my stream is not getting out from my webcam machine (maybe because of a blocked port), or on the server to see if it's trying to connect but something's going wrong there. I see a counter on my webcam machine, does that mean it's sending the stream or just working? I also don't see video, but my webcam does turn on. Does that mean it's getting video or not?

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Postby funman » 02 Oct 2006 20:46

before streaming, you should try if you can see the webcam output on the local pc

wtilton
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Oct 2006 21:55

Postby wtilton » 02 Oct 2006 21:11

before streaming, you should try if you can see the webcam output on the local pc
Within VLC? Or any application? I am NOT able to see it in VLC. The webcam just turns on.

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Postby funman » 02 Oct 2006 23:01

then it's not a streaming problem, but an access problem

which driver do you use to access the cam ?

wtilton
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Oct 2006 21:55

Postby wtilton » 03 Oct 2006 02:47

then it's not a streaming problem, but an access problem

which driver do you use to access the cam ?
Access problem to what the video?

Could I use Windows Media Encoder? I can see the video fine in that one.

I just use the latest drivers that I downloaded from Logitech's site for the Quickcam 4000.

flowersrj
New Cone
New Cone
Posts: 4
Joined: 08 Jan 2006 18:25

Postby flowersrj » 03 Oct 2006 03:31

When you select "Open Capture Device", for the "video device name" hit the refresh button a few times 1st and then you should see your Quickcam as an option, then you select it. Hit OK at bottom and you should have video in a few seconds.

Now you should see something on screen. If so, access problem solved.

Rich

wtilton
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Oct 2006 21:55

Postby wtilton » 03 Oct 2006 18:42

I am hitting refresh, hit ok, but no video. I'm guessing it doesn't support my web cam. If there's a way to do this stuff via Windows Media Encoder, that'd be great. Comes up just fine in that one...?

wtilton
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Oct 2006 21:55

Postby wtilton » 04 Oct 2006 23:23

Does anyone know of any walkthroughs anywhere for any application that will walk me through setting up a webcam computer, to a server, and out to users? I'd love to be able to setup a remote web cam station that could broadcast events. TIA

ustunozgur
Blank Cone
Blank Cone
Posts: 53
Joined: 09 Oct 2006 00:19
Contact:

Postby ustunozgur » 10 Oct 2006 20:33

After you hit refresh, and before you hit OK, make sure you select the web cam in the scroll down list.

smokin
New Cone
New Cone
Posts: 8
Joined: 09 Oct 2006 18:45

Postby smokin » 12 Oct 2006 11:53

Doing this is quite straight forward i have it working now streaming my webcam from my pc to a dedicated server in another country, and from there the public can pick up the stream.

ill give some basic info.

My pc is running windows.
The dedicated hosted server is running linux with no GUI.
I have standard latest build on both machines of vlc.

Ok, so on my windows machine with the webcam.
File, open capture device and open the device you wish to stream.
Click the Stream/Save button and then click settings next to it.
In the target box, paste this line, modifying it for your environment.

:sout=#transcode{vcodec=WMV2,vb=284,scale=0.5,acodec=mp3,ab=64,channels=2,deinterlace,croptop=2}:duplicate{dst=std{access=mmsh,mux=asfh,dst=localip:port}}

now press ok, then ok again till you are back at vlc main window.

now you should be streaming your webcam or any device you chose to your local ip on the port selected. You can test this by opening another instance of vlc.

File, open network stream, and in the customize box enter the following.
mmsh://localip:port

you should then see a transcoded version of your webcam stream in this second instance of vlc.

now you need to open a port from your firewall to the ip and port of the pc where you will be streaming from. Or nat it, or port forward or however it works on your setup. Basicially you need to open that stream to the outside world.

Once you have verified that is working and assuming you are using linux on the server. you need to open a shell prompt and paste the following

vlc -vvv mmsh://external_ip:port --sout='#standard{access=mmsh,mux=asfh,url=ip_of_server:port}'

Once you have done that, the stream will then be being relayed from the source pc with the initial stream out from this server. So many people can connect at a time without affecting your own bandwidth at the source.

you can now test this in a similar way to how we did it earlier by opening vlc and doing the following.

File, Open network stream, in the customize box enter mmsh://ip_of_server:port

you should then be receiving the stream from the server. And should be a direct reflection / relay of the source client.


you could then embed something like media player in a web page for users to view without having to know any details. For exmaple.

Create a webpage and paste the following, editing it for your specifics.

<OBJECT id="VIDEO" width="800" height="600"
style="position:absolute; left:0;top:0;"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">

<PARAM NAME="URL" VALUE="mms://server_ip:port">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM name="uiMode" value="full">
<PARAM name="PlayCount" value="9999">
<PARAM NAME="stretchtofit" value="true">

</OBJECT>


Hope this helps.

danmcb
New Cone
New Cone
Posts: 2
Joined: 12 Oct 2006 12:01

Postby danmcb » 12 Oct 2006 12:27

thanks a lot!

we have been trying to get this to happen, now we have a basic webcam stream up and running.

one thing we are wondering about : we want to stream over DSL, which means restricting bandwidth. Using ASF/WMV2, we seem to always need about 2mbps upload which will be too high. We tried reducing the scaling and the kb/s in the codec setting, but the upload never seems to change.

we are gonna play about with codecs and other stuff, to see if we can improve things, but maybe someone can help ... ?

the other thing we need to work on is getting the latency down. it's about 3s now ...

thanks people for teh s/w and the help.

(info : we are using prebuilt latest VLC on XP machines, cam is a Logitech Quickcam)

smokin
New Cone
New Cone
Posts: 8
Joined: 09 Oct 2006 18:45

Postby smokin » 12 Oct 2006 13:45

that is simple.

just change the vb setting in this line.

:sout=#transcode{vcodec=WMV2,vb=284,scale=0.5,acodec=mp3,ab=64,channels=2,deinterlace,croptop=2}:duplicate{dst=std{access=mmsh,mux=asfh,dst=localip:port}}

atm its set to 284kbps.

change it to whatever you require and it will stick to that.

Mr.P
New Cone
New Cone
Posts: 1
Joined: 22 Oct 2006 23:23

Postby Mr.P » 22 Oct 2006 23:36

This post is really great thanks all, I have done all this steps and it works.
But I really like to add a video to a webpage and I am having problems with that.
I read all forums and I cannot find a right answer.

Did your code work for you?

<OBJECT id="VIDEO" width="800" height="600"
style="position:absolute; left:0;top:0;"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">
<PARAM NAME="URL" VALUE="mms://server_ip:port">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM name="uiMode" value="full">
<PARAM name="PlayCount" value="9999">
<PARAM NAME="stretchtofit" value="true">
</OBJECT>

It don’t work for me.
<PARAM NAME="URL" VALUE="mms://server_ip:port">
I try send to http instead of mmsh and I try to udp on the html code and on the server side, but with no success. Maybe I am doing something wrong.
Can you confirm if that code works for you?

The relay from my remote server is working like you say on your post, I can play my video using other VLC on 3ª computer.

Any one of you can give me advice about how to stream a video via a webpage?
Thanks in advance for any replay....
I really prefer to use windows media player but in this moment any format can be useful

smokin
New Cone
New Cone
Posts: 8
Joined: 09 Oct 2006 18:45

Postby smokin » 31 Oct 2006 13:11

it works fine for me.

if you cannot provide any kind of error log or anything its impossible to say why it doesnt work.

smokin
New Cone
New Cone
Posts: 8
Joined: 09 Oct 2006 18:45

Postby smokin » 31 Oct 2006 13:25

i see you write mmsh.

when using media player its mms:// not mmsh://

maybe thats what you have wrong.

wtilton
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Oct 2006 21:55

Postby wtilton » 07 Nov 2006 00:17

Thanks smokin for your help. Right now I'm going from a WinXP machine to a Win2k3 server so the Linux part might be a difference that might not workout for me, but I'm going to give this another go tonight. I got a new camera with a firewire port so I'm hoping this works. I'll keep you posted.

plonky
New Cone
New Cone
Posts: 2
Joined: 23 Oct 2006 17:47

Postby plonky » 16 Nov 2006 18:34

well this is a great thread full of good information.

First of all thank you, i get it working.

i would like to know if its possible that instead the linux server connect to the pc to grab the stream, that is the pc client which connect to linux server which would be listening passively for incoming stream to relay it away ?

So the linux server would runs vlc in standalone 24/24 and each time a source would like to be relayed by the linux server, it export the webcam stream to the linux server.

At the end, the final client just has to open a classic client and connect to the linux server to read the relayed streaming

Thanks in advance

markfm
Big Cone-huna
Big Cone-huna
Posts: 1536
Joined: 22 Feb 2004 17:42

Postby markfm » 19 Nov 2006 18:58

You can probably do that if the Linux box is looking for a UDP source stream.

A windows startup command line to do this would look something like:
vlc udp://@ :sout=#transcode{vcodec=DIV3,vb=512,scale=1,acodec=mp3,ab=128,channels=2}:duplicate{dst=std{access=mmsh,mux=asfh,dst=127.0.0.1:1234}}
What the above does:
look fo an incoming UDP stream addressed to the server PC on the standard port 1234.
Transcode the incoming stream -- turn it into a 512Kbps DIV3, 2 channel 128kbps mp3.
Encapsulate it in asfh.
Act as an mmsh server.

(Not sure what the Linux syntax differences are)

psaingtong
New Cone
New Cone
Posts: 3
Joined: 02 Nov 2006 18:32

Postby psaingtong » 03 Dec 2006 15:37

This is a great document.

stonkers
Blank Cone
Blank Cone
Posts: 24
Joined: 07 Oct 2006 01:23
Location: Denver, CO

Postby stonkers » 04 Dec 2006 02:06

OK, so we're trying to do this going from Camera to XP to Win2K3. We can't even get this to work locally (i.e. Camera to XP to Same XP machine). It seems to work, meaning the timer starts on both the push VLC Player and the receive VLC Player, but the receive end doesn't show any video. We're set to stream output locally as well and the video shows up there (VLC PLayer #1), but not on the listening end. Any help?

globalguy
New Cone
New Cone
Posts: 1
Joined: 10 Dec 2006 17:38
Location: Ontario

Server using VLC player and client using Windows Media Playr

Postby globalguy » 21 Dec 2006 18:51

You can probably do that if the Linux box is looking for a UDP source stream.

A windows startup command line to do this would look something like:
vlc udp://@ :sout=#transcode{vcodec=DIV3,vb=512,scale=1,acodec=mp3,ab=128,channels=2}:duplicate{dst=std{access=mmsh,mux=asfh,dst=127.0.0.1:1234}}
What the above does:
look fo an incoming UDP stream addressed to the server PC on the standard port 1234.
Transcode the incoming stream -- turn it into a 512Kbps DIV3, 2 channel 128kbps mp3.
Encapsulate it in asfh.
Act as an mmsh server.

(Not sure what the Linux syntax differences are)
Your post helped me out a lot. I changed udp://@ to http:// and got rid of the @ sign. I'm still trying to figure out the meaning of that line. Anyway I got VLC running on the server and my client can pick up the stream and display it in Windows Media Player. Here is the HTML I used

<OBJECT id="VIDEO" width="640" height="480"
style="position:absolute; left:75;top:75;"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">

<PARAM NAME="URL" VALUE="http://local:port">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM name="uiMode" value="full">
<PARAM name="PlayCount" value="9999">
<PARAM NAME="stretchtofit" value="true">

</OBJECT>

So I have a Windows Server 2003 server running VLC and a client computer running Windows XP with Windows Media Player 11. And it streams well. Only trick was to get the new version of Media Player.

Thanks again.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 18 guests