Live streaming issues

About encoding, codec settings, muxers and filter usage
UtahNL
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Dec 2010 13:09

Live streaming issues

Postby UtahNL » 01 Dec 2010 14:17

I'm looking for a solution to streaming a usb webcam over the internet, that is accessible from normal web browsers and android.

So far i have been able to stream via rtsp as a mpeg-ts h.264 stream, but it is only playable using android or vlc and i could not find any webplayer able to play this stream.

I also tried streaming over http as a flv h.264 and it is playable via flowplayer and vlc but it's not real time as it starts buffering for several minutes, the longer the stream server has been running the longer it takes flowplayer(and also vlc) to play the stream.

Streaming as ogg theora vorbis over http works and is playable with the cortada java applet but the image quality quite low.

When i try to stream via rtsp as mpeg-ts mpeg4 part 2, the stream is playable usings the IBM ISMA applet but the quality is even lower than ogg theora, in comparison with mpeg-ts h.264, needs a bitrate 4 to 8 times higher to archieve the same quality as h.264 as wel as mpeg4 part2 having a higher cpu usage.

The streaming server is a pentium3 900mhz running xp and has about 90% cpu usage when transcoding to rtsp mpeg-ts h.264 using x.264. The webcam is 320x240 pixels, runs on 10fps and i have an upload of 200kbps max available to the stream server.

Also for some strange reason vlc does not support transcoding to the mp4 nor the webm container when streaming, which makes most webplayer applets and the html5 video tag useless to my goals.


Any suggestions and working implemetations are welcome.

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

Re: Live streaming issues

Postby Greg » 01 Dec 2010 18:19

A 900Mhz P3 is far too slow for what you are asking of it.
You might get some sort of result at 200k upstream using .asf for a web browsable output. The quality will be poor but has much lower cpu usage. I cannot comment on Android being .asf friendly?.
You may well get a better result from a 2 stage transcode. if a new faster box is not possible
see
http://wiki.videolan.org/Stream_VLC_to_ ... _and_Flash

You will need something like at least a fast P4 at 3Ghz to do h264 from an average quality webcam @320x240. You could expect a lag of 4 to 8 secs capture to display with this setup. Eg http h264/flv flowplayer

UtahNL
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Dec 2010 13:09

Re: Live streaming issues

Postby UtahNL » 01 Dec 2010 19:38

Actualy the 900mhz cpu does a pretty good job encoding H.264 with x.264, only drops a few frames every now and then with a cpu usage of about 90%.
The frame rate doesn't need to be that high, 10 fps in enough for me.
The biggest problem i have with h.264 via rtsp is that i haven't been able to find an applet or plugin that would work without installing anything on the clients pc.

At the moment android is able to play mpeg4 part 2, mpeg4 avc/h.264 baseline profile and mainline profile to some point.

I already tried http h.264/flv streaming with flowplayer in single stage but the stream doesn't play realtime(i read somewhere that flash doesn't support http live streaming, only progressive and pseudo streaming).
Would the 2 stage transcode make any difference?

Using the IBM M4play applet i've been able to do http mpeg4 part2 streaming, bandwith is about 400kbps.

Webcam(re-used WM smartphone :roll: ) might glitch once in a while so i wil be looking for a replacement soon and also a new streaming pc.

Last question, why can't vlc mux to mp4 when streaming and wil this be supported in the future?
Last edited by UtahNL on 16 Dec 2010 14:08, edited 1 time in total.

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

Re: Live streaming issues

Postby Greg » 02 Dec 2010 14:22

From my own experience, I still assert that a P3 900 is not up to the job, however if you have found otherwise, then so be it.
I can confirm that the http - h/x264 - flv - Flowplayer - JWPlayer methods desribed in the wiki work well with circa 3 to 5 secs delay on LAN and 6 to 9 sec delay on WAN. Achieved in a single capture/transcode/served from a webserver all on the same ( much faster) box(s). I guess it all depends on what you mean by "realtime"
The idea of a two stage transcode is to load share, so you may find it helps? Try it?

I tried your link( IE & FF), but it failed to connect the stream

Re your issues with "mux to mp4"?... Suggest you re post the specific issue with details and with luck one of the developers will answer you. (I'll shut up and keep out of it)

UtahNL
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Dec 2010 13:09

Re: Live streaming issues

Postby UtahNL » 02 Dec 2010 16:17

When i try to stream using http flv/h264, the longer the server is running the longer the delay gets.
So the server might not be able to keep up the transcoding and instead of dropping frames it seems to increase the delay.

The link i provided should work as long java is installed and has been tested in ie8, firefox and chome, if it does not work the first time you might need to reload the page.

Thanks for the help, wil try the http flv 2 stage transcode as soon as i have bougth a new server pc.

magnets
New Cone
New Cone
Posts: 2
Joined: 03 Dec 2010 13:43

Re: Live streaming issues

Postby magnets » 03 Dec 2010 13:50

I'm trying to stream h264 to my android phone but it won't work, can I ask what stream settings you are using?

UtahNL
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Dec 2010 13:09

Re: Live streaming issues

Postby UtahNL » 05 Dec 2010 11:11

I got streaming h.264 working via the rtsp protocol with the following command line.

Code: Select all

vlc.exe -vvv dshow:// "--dshow-vdev=WebCamera Plus" "--dshow-caching=200" :sout=#transcode{vcodec=mp4v,venc=x264{crf=26,bframes=2,ref=3,weightb,scenecut=40,min-keyint=10,keyint=200,nocabac,me=hex,subme=6,trellis=0,level-31,merange=16},vb=0,fps=10,scale=1,acodec=none,}:rtp{sdp=rtsp://:554/stream.sdp} :no-sout-rtp-sap :no-sout-standard-sap :ttl=20 :sout-keep
Normally the NAT in routers wil block the udp rtsp packets, some others offer a aplication layer gateway enabling it.
I got it working by forwarding port 554 and port 6790 - 6999 and by putting the server in a DMZ.

magnets
New Cone
New Cone
Posts: 2
Joined: 03 Dec 2010 13:43

Re: Live streaming issues

Postby magnets » 06 Dec 2010 13:18

I got streaming h.264 working via the rtsp protocol with the following command line.

Code: Select all

vlc.exe -vvv dshow:// "--dshow-vdev=WebCamera Plus" "--dshow-caching=200" :sout=#transcode{vcodec=mp4v,venc=x264{crf=26,bframes=2,ref=3,weightb,scenecut=40,min-keyint=10,keyint=200,nocabac,me=hex,subme=6,trellis=0,level-31,merange=16},vb=0,fps=10,scale=1,acodec=none,}:rtp{sdp=rtsp://:554/stream.sdp} :no-sout-rtp-sap :no-sout-standard-sap :ttl=20 :sout-keep
Normally the NAT in routers wil block the udp rtsp packets, some others offer a aplication layer gateway enabling it.
I got it working by forwarding port 554 and port 6790 - 6999 and by putting the server in a DMZ.
Thanks. Are you using Android 2.2 or 2.1?

UtahNL
Blank Cone
Blank Cone
Posts: 11
Joined: 01 Dec 2010 13:09

Re: Live streaming issues

Postby UtahNL » 06 Dec 2010 17:16

Using android 2.2 on the htc desire.
Did you get it to work? as it took me a while to figure out.

vindiez
New Cone
New Cone
Posts: 3
Joined: 19 Dec 2010 09:46

Re: Live streaming issues

Postby vindiez » 19 Dec 2010 11:18

hello peeps,
i am new to streaming.i've been trying to stream video to my phone over rtsp protocol.i luckily got this working over WLAN but not able to get it work over internet.the ports are open and also i disabled antivirus,but i dont know whether the problem is with the dynamic dns or something else.even when streaming over wlan it doesnt work when the internet lan cable is connected.can anyone help me on this.any help would be appreciated :)


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 9 guests