[solved] getting a basic http stream working

*nix specific usage questions
glok_twen
Blank Cone
Blank Cone
Posts: 11
Joined: 25 Feb 2009 05:27

[solved] getting a basic http stream working

Postby glok_twen » 25 Feb 2009 06:24

have to admit i'm having some difficulties. end goal is just to be able to stream live video from 2 webcams on 2 newborns.

for now, i'm just trying to get the output of one vlc session to be sent to another. this is a first step toward putting it onto a web page, etc. but i'm very stuck. here are the commands and results. searched on connection refused as well and none of the cases matched this.

certainly open to any ideas just to get a simple config up. (yep, read most of the basic section on the wiki)


server process:
glok@glok:~/practice$ vlc -d v4l2:// /dev/video0 --sout '#standard{access=http,mux=ogg,dst=127.0.0.1:1234}'
VLC media player 0.9.8a Grishenko
[00000001] main libvlc debug: VLC media player - version 0.9.8a Grishenko - (c) 1996-2008 the VideoLAN team
[00000001] main libvlc debug: libvlc was configured with ./configure
[00000001] main libvlc debug: translation test: code is "C"

glok@glok:~/practice$ ps -ef | grep vlc
glok 13770 6297 0 18:08 pts/1 00:00:04 gedit vlc_help.txt
glok 18818 1 9 22:17 ? 00:00:00 vlc -d v4l2:// /dev/video0 --sout #standard{access=http,mux=ogg,dst=127.0.0.1:1234}


client process and errors:
glok@glok:~$ vlc http://192.168.1.5:1234
VLC media player 0.9.8a Grishenko
[00000001] main libvlc debug: VLC media player - version 0.9.8a Grishenko - (c) 1996-2008 the VideoLAN team
[00000001] main libvlc debug: libvlc was configured with ./configure
[00000001] main libvlc debug: translation test: code is "C"
[00000001] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00000358] main access error: connection failed: Connection refused
[00000358] access_http access error: cannot connect to 192.168.1.5:1234
[00000358] main access error: connection failed: Connection refused
[00000358] access_mms access error: cannot connect to 192.168.1.5:1234
[00000356] main input error: open of `http://192.168.1.5:1234' failed: could not create access


ifconfig:
eth1 Link encap:Ethernet HWaddr 00:------------------
inet addr:192.168.1.5 Bcast:192.168.1.255 Mask:255.255.255.0
Last edited by glok_twen on 26 Feb 2009 02:27, edited 1 time in total.

rh
Cone that earned his stripes
Cone that earned his stripes
Posts: 158
Joined: 21 Sep 2006 13:11
VLC version: 2.0.2
Operating System: Lin / Win / Andr
Location: Germany

Re: getting a basic http stream working

Postby rh » 25 Feb 2009 10:14

From your client use nmap to look up the streaming port of your server like this:
nmap -p1234 <VLCStreamingServerIP>. You shoud become a message that this port is NOT open, so you cant connect in any with to this VLCStreamingServer.

In your configuration you should not set the streaming port to 127.0.0.1:1234 because ONLY your local machine can connect to this port. You can try this with a second vlc instance. You shoud set the sout chain to your network ip address (192 ... ) and then streaming will work.

But i think this can only stream video content so the configuration for webcams with integrated micro with linux is a little bit tricky ...
scarcely you do it right it works ...
Greetings, rh

glok_twen
Blank Cone
Blank Cone
Posts: 11
Joined: 25 Feb 2009 05:27

Re: getting a basic http stream working

Postby glok_twen » 25 Feb 2009 17:24

thanks for taking the time to reply. am giving that a try now.

note that in my example both the client and server are indeed on the same machine. does this change your thinking at all?

Rémi Denis-Courmont
Developer
Developer
Posts: 15324
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: getting a basic http stream working

Postby Rémi Denis-Courmont » 25 Feb 2009 17:42

If you're setting the HTTP server address to 127.0.0.1, it is quite normal that connection fails with another address,
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

glok_twen
Blank Cone
Blank Cone
Posts: 11
Joined: 25 Feb 2009 05:27

Re: getting a basic http stream working

Postby glok_twen » 25 Feb 2009 17:46

thanks also i used your suggestion with nmap. it did indeed show my server listening on port 1234 and ready for connection.

so then i fired up the client and got no video output. just the gui screen itself, but no video screen. here is the command i used and messages:

VLC media player 0.9.8a Grishenko
[00000001] main libvlc debug: VLC media player - version 0.9.8a Grishenko - (c) 1996-2008 the VideoLAN team
[00000001] main libvlc debug: libvlc was configured with ./configure
[00000001] main libvlc debug: translation test: code is "C"
[00000001] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00000360] main stream error: cannot pre fill buffer

glok_twen
Blank Cone
Blank Cone
Posts: 11
Joined: 25 Feb 2009 05:27

Re: getting a basic http stream working

Postby glok_twen » 25 Feb 2009 17:55

also i should add yes i changed the sout to 192.168.1.5:1234 and removed any references to 127.0.0.1 -- that got rid of my connection refused error so thanks for the tip.

glok_twen
Blank Cone
Blank Cone
Posts: 11
Joined: 25 Feb 2009 05:27

Re: getting a basic http stream working

Postby glok_twen » 25 Feb 2009 18:19

also when connecting to the server from a different node, the same error is returned after a few seconds "main stream error: connot pre fill buffer"

any suggestions?

thanks.

glok_twen
Blank Cone
Blank Cone
Posts: 11
Joined: 25 Feb 2009 05:27

Re: getting a basic http stream working

Postby glok_twen » 26 Feb 2009 02:23

this is basically solved. thanks to those who read and provided feedback.

for posterity, and those who may search on this later, here are some pointers on the items i addressed in getting this to work.

- make sure you have the right drivers. this example used a logitech quickcam communicate mp (s 5500). i needed to download, build and install uvcvideo
- make sure to find out by searching around on your webcam whether it needs v4l2 or v4l1. a lot of the older posts out about other software like webcam-server will not work yet with v4l2.
- if you need v4l2, when you build your vlc, add the --enable-v4l2 parameter to the command line when you run ./configure
- get the right/latest version of vlc. for me 0.9.8a did the trick.

- streamed webcam video has to be transcoded. here is the vlc command i used for the server
vlc -vvv v4l2://dev/video0:norm=secam:frequency=543250:size=640x480:channel=0:adev=/dev/dsp:audio=0 --sout '#transcode{vcodec=mp4v,vb=800,scale=1,acodec=mp4a,ab=128,channels=2}:standard{access=http,mux=ogg,dst=192.168.1.5:1234}'
- obviously replace the 192.168.1.5:1234 with the ip address of your server. 1234 for a port seems to be standard
- there's probably an easy way to get to the above command via the gui. but i had to experiment so many times it went faster by dropping to command line.
- client side was easy, just vlc http://192.168.1.5:1234
- client side uses the same command as previous from either the same node or a different. per the advice above, using 127.0.0.1 didn't work for me.

good luck, hth.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 25 guests