Live webcam streaming over the Internet

About encoding, codec settings, muxers and filter usage
Warlord1981
New Cone
New Cone
Posts: 9
Joined: 15 Jun 2011 12:44

Live webcam streaming over the Internet

Postby Warlord1981 » 15 Jun 2011 13:13

Hello there

I did my research in this and other forums the past week, not finding any helpful info, so I'm sorry if this has been mentioned before but due to limited time I cannot search thoroughly the entire forum for related threads/posts.

This is the case: As the case study part of my thesis, I have to code (preferably mpeg-4) and stream live 3D stereoscopic video from 2 webcams capturing the same scene, over the Internet and not localy! As a streaming server i chose VLC 1.1.10. I use Windows 7 Ultimate 64-bit. I also installed stereoscopic multiplexer (for capturing stereoscopic video from the 2 webcams and use it as input source), as well as Stereoscopic Player (that has the Open URL... functionality, in order for the internet client to stream the video content in 3D mode). So what I do is open VLC, go to Media>Streaming>Capture Devcice, i choose Stereoscopic Multiplexer as the device name and no audio source and press Stream. Then on the source page it says dshow:// and i just press Next. Next page is the Destinations. What protocol do i choose in order to stream over the internet and how exactly do i set it up (path/ip/port etc)? Also, except forwarding the related port on the server's/client's routers, as well as allowing VLC public activity on both server's and client's windows firewalls, what other configuration do i have to do?

Thank you for your valuable help and i'm sorry again if the questions have been asked before.

Mike

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

Re: Live webcam streaming over the Internet

Postby Greg » 15 Jun 2011 15:02

On a simplistc level, not much to configure.
See

viewtopic.php?f=4&t=66473

Although the post is for LAN, the config is the same, only diference is client will obviously need your servers public WAN IP in the URL http://IP:port
I would leave the default port of 8080 unless it is being used for something else and leave the path at default \ blank
I would first try/prove this out on LAN first, Your input (device?) may/may not work with VLC?
Don't forget to open the appropriate ports in router & firewall

Warlord1981
New Cone
New Cone
Posts: 9
Joined: 15 Jun 2011 12:44

Re: Live webcam streaming over the Internet

Postby Warlord1981 » 15 Jun 2011 19:56

hello again and theank you for your reply.

ok i've seen this method of configuration but its on previous release of vlc.. on the latest vlc software, in destination settings, in the HTTP parameters, theres a box with 8080 port as default and the next box is Path (instead of address) with a "/" inside it. what do i enter in this box? and what do i enter on the clients network URL prompt?

Warlord1981
New Cone
New Cone
Posts: 9
Joined: 15 Jun 2011 12:44

Re: Live webcam streaming over the Internet

Postby Warlord1981 » 15 Jun 2011 22:10

ok i managed to do it via HTTP locally, but not over the internet..when i give the http://(server'spublic)IP:port from the clients pc it wont play the stream..

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

Re: Live webcam streaming over the Internet

Postby Greg » 15 Jun 2011 23:40

If you have got VLC working across LAN, then something is blocking the route to WAN client.
best go through basic checks again
Check the VLC Messages (log) for some indication of what is going on. (Tools menu) on client
You may need to set VLC streaming TTL to a higher figure to hop all the routers in the WAN route (Say 10ish to start with)
You have sufficient upstream bandwidth over WAN? could take some time to connect??
Firewall & router Port(s) open and forwarded. VLC is allowed ? (add exception for VLC & port) on server.
Your public IP is static?
Your ISP is not blocking your chosen port
Your not behind a proxy server.

You may want to check out the routes/ports using the ping or tracert commands from command prompt (client) to server to prove the route is clear.

Warlord1981
New Cone
New Cone
Posts: 9
Joined: 15 Jun 2011 12:44

Re: Live webcam streaming over the Internet

Postby Warlord1981 » 18 Jun 2011 20:19

ok Greg thx very much! it proved to be a problem with the ISP blocking ports. everything works great now.

one final question though. When streaming, how do I transcode in real-time using H.264 encoder? Whenever i select h.264 the program hangs up. Maybe the proper encoder is missing, but then i downloaded x264 from the video lan's website but dont know where to put the folder. Is there any installer?

nobody.loopback
Cone that earned his stripes
Cone that earned his stripes
Posts: 109
Joined: 08 Mar 2005 01:20

Re: Live webcam streaming over the Internet

Postby nobody.loopback » 19 Jun 2011 12:41

I found, that, with the 1.1.10 version I cannot use the x264 codec on Windows unless I disable the audio - program crashes as soon as I press the play button. But, on macosx it works more or less ok.
viewtopic.php?f=4&t=91128#p301755

which platform do you use ?
To convert a stream to x264 i used on Windows:
:sout=#transcode{vcodec=h264,vb=1024,fps=24,acodec=mp4a,ab=92,channels=2,samplerate=44100}:http{mux=ts,dst=:10500/stream} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

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

Re: Live webcam streaming over the Internet

Postby Greg » 19 Jun 2011 22:49

@Warlord1981

H/x264 will be included by default in your VLC (Windows version) No need to add/install it unless you have some non std or unofficial version.
Version 1.1.10 is working fine for me in Win XP for capture and transcode. (default profile H264+aac (mp4))
H/x264 is very cpu hungry. Guessing from what the info you have given, it may be likely that your cpu is overloading and causing the hang? Check your Task manager.
Solutiion: Suggest you reduce Video Size to something smaller eg 320x240

Warlord1981
New Cone
New Cone
Posts: 9
Joined: 15 Jun 2011 12:44

Re: Live webcam streaming over the Internet

Postby Warlord1981 » 23 Jun 2011 01:35

@ Greg

I cannot make it work..i select even the lower resolution u proposed (though my CPU is i7@4HGz so i dont think the problem is cpu) and as soon as it starts streaming it hangs up..

what about destination settings? HTTP or RTP or UDP dont work.. and what about bitrate and fps..?

here it says that when u stream MP4 the protocol will be... File(?)
http://www.videolan.org/streaming-features.html

Warlord1981
New Cone
New Cone
Posts: 9
Joined: 15 Jun 2011 12:44

Re: Live webcam streaming over the Internet

Postby Warlord1981 » 23 Jun 2011 02:03

i also have problem converting an avi to h.264 via vlc.. it creates a *.ps file that is played with vlc, but it is not the whole video.. the last like 7-8 seconds are cut..
Also, using h.264+AAC(TS) profile to convert creates a laggy, stuttering video file..

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

Re: Live webcam streaming over the Internet

Postby Greg » 23 Jun 2011 02:17

Could you describe what is "hanging up" ???

The local display may stall - frame freeze on the server while the stream is running.

Can the client see-connect to the live stream?

Edit
Re last post
One thing at a time please.

Warlord1981
New Cone
New Cone
Posts: 9
Joined: 15 Jun 2011 12:44

Re: Live webcam streaming over the Internet

Postby Warlord1981 » 23 Jun 2011 11:13

the moment i press "Stream" and having selected "display locally", the streaming server starts and the display of its playback freezes at the first frame..
client cannot connect..
with all the codecs everything works fine. the only problem is h.264..ive tested all resolutions, bitrates and fps with the same result.. :(

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

Re: Live webcam streaming over the Internet

Postby Greg » 23 Jun 2011 15:43

Have you tried live streaming from an alternative input source?
Eg Webcam or other video capture device....TV card etc
This would help to narrow down the problem

It may be that your input device/source/format is the problem?
For example:
I had found in th past that a wma/wmv (asf) input stream would not transcode to h264, but a div3/mp3 (asf) worked OK
This was solvable by first transcoding to to div3/mp3 and then transcoding again (on another box) to h264....

Might also be an idea to open your Messages (logs) before you start the stream for information on what is failing? Set verbosity at 2 for full information

Warlord1981
New Cone
New Cone
Posts: 9
Joined: 15 Jun 2011 12:44

Re: Live webcam streaming over the Internet

Postby Warlord1981 » 23 Jun 2011 16:09

Yes, ive tried from stored files of many different formats, as well as from my webcam, and ive tried all kinds of encapsulation methods..

the Messases tool amongst ohters, gave this error every 6 lines:
avcodec error: more than 5 seconds of late video -> dropping frame (computer too slow ?)

is there a way to stream without transcoding via HTTP? i will convert to H.264 with Xilisoft first..

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

Re: Live webcam streaming over the Internet

Postby Greg » 23 Jun 2011 21:37

It's difficult to guess with limited information.

You appear to be suggesting that you can stream in all other profiles Except.. h264 ..? It also appears that you are unable to stream in h264 with/from any other devices/sources.

If your messages log is not telling you of an error or failure to transcode/stream, then probably:
Your VLC is broken/corrupt
A problem with your OS
You are doing something unusual or incorrect that is causing a failure? If you confident that your hardware is not overloaded, then???

Apart from the post by nobody.loopback earlier on, I am unaware of a problem?

You could try:
Re Installing VLC (From the Videolan website)
Or
An earlier release
http://download.videolan.org/pub/videolan/vlc/
Or
A clean VLC install on another Windows hardware, and try it all again.

Beyond that, I'm running out of ideas.

You could try a repost detailing your specific h264 problems with Win 7 64 and VLC 1.1.10
Last edited by Greg on 23 Jun 2011 23:51, edited 1 time in total.

nobody.loopback
Cone that earned his stripes
Cone that earned his stripes
Posts: 109
Joined: 08 Mar 2005 01:20

Re: Live webcam streaming over the Internet

Postby nobody.loopback » 23 Jun 2011 23:28

I checked today the same VLC binary on windows with the same parameters on the same machines (one XP, one Windows7).
And to my astonishment it did not crash, it just transcoded without a problem.

When I tried that first, and it crashed (on the same PCs (one of these has even not been rebooted since the first test)), since I use a DVB/S stream the content now is different.

So, there is a possibility, that the x264 encoder might not work reliable depending on the material you give it.

@Warlord: have you tried to use a different material, like a DVD or whatever and then try to check if transcoding to x264 is ok ?
also, maybe disable the output on the screen to rule out possible problems of hardware acceleration by the graphics card.

Warlord1981
New Cone
New Cone
Posts: 9
Joined: 15 Jun 2011 12:44

Re: Live webcam streaming over the Internet

Postby Warlord1981 » 24 Jun 2011 00:54

hmm i havent tried with DVD. ill do it immediately.
also ill download an earlier version of vlc to check defenitely..

i'd like, though, to ask, in case the problem insists, if i can stream the file without transcoding? and if so, will i choose raw profile or just leave it the way it is.. because ive tried streaming without transcoding, but i cannot stream the content from another computer (localy though)

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

Re: Live webcam streaming over the Internet

Postby Greg » 24 Jun 2011 02:27

Suggest you backtrack through this thread and check in detail...
You seem to be jumping to conclusions.
Firstly you have not confirmed you have an official genuine copy of vlc from Videolan website.?
Check this first
Then do a clean re install of the current version.
If that fails then try an earlier version.

The recent post by nobody.loopback has confirmed that Win7 is apparently working (perhaps with an initial glitch?) The comments renforce my earlier hints regarding the encoder being able to deal with the input(s).
i'd like, though, to ask, in case the problem insists
...etc

You need to address the what is going on or wrong with your current setup before trying to bodge a way around it.If the fundamentals are wrong then the rest will be likewise. It is working OK for me, nobody.loopback and probably many others who have not posted a problem. So either you are doing something wrong or there is something wrong with your setup.
You have not given much clue to what you have tried or done so it is V. difficult to suggest solutions.
I don't think wild speculation and guesswork is needed in your thesis?


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 14 guests