Reduce delay/lag when streaming from stdin to http ...?!

About encoding, codec settings, muxers and filter usage
alex0801
New Cone
New Cone
Posts: 1
Joined: 24 Oct 2013 10:40

Reduce delay/lag when streaming from stdin to http ...?!

Postby alex0801 » 24 Oct 2013 10:53

Hi there,

I have a Raspberry Pi with a Raspberry Pi Camera Board.

I'm streaming h264 video like this:

Code: Select all

raspivid -w 1280 -h 720 -b 2000000 -o - -t 300000000 -fps 25 | cvlc stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264
raspivid is a command line tool to create h264 encoded video. The argument "-o -" put's the video data to stdout. In this case with 1280x720@25fps and 2Mpbs.

The goal is to have a http h264 stream, which I can decode with VLC on desktop computers as well as with an own App on Android.

Now the problem is: Directly after starting the stream and connecting to it, I get a delay of about 1sec. The longer the stream runs, the bigger the delay gets...
CPU load is <10%.

If I pipe the video data instead to gstreamer, I get a delay of <0,5sec.. But with Full-HD resolution! (see this solution: http://pi.gbaman.info/?p=150). This proofes that the raspivid tool is not causing the delay. Must be VLC :-(

So, back to the "pipe to VLC" solution: I also tried to reduce the http-caching on client side. But this does not really lower the delay. It's still about 1sec and gets bigger and bigger the longer the stuff runs (2-4sec after 20min or so).

Now my question: How do I tweak my command line to reduce the delay as low as possible?

br,
Alex

P.S. Using VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e) on Raspbian Wheezy on Raspberry Pi ARM hardware.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Reduce delay/lag when streaming from stdin to http ...?!

Postby Jean-Baptiste Kempf » 05 Nov 2013 20:45

Reduce VLC input and streaming caching.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Adamski11
New Cone
New Cone
Posts: 4
Joined: 28 Mar 2011 12:45

Re: Reduce delay/lag when streaming from stdin to http ...?!

Postby Adamski11 » 06 Nov 2013 15:43

I've found exactly the same problem. Reducing the resolution and fps helps a bit but there's still far to much lag to use for real time viewing (e.g. where you remotely control camera movement) and in my testing the same problem of an increasing delay over time even with lower settings. This is a real shame as there doesn't appear to be a solution I can find to this problem other than using gstreamer which has its own problems especially with viewers for all platforms

Rita VLC
Blank Cone
Blank Cone
Posts: 12
Joined: 03 Dec 2013 01:52

Re: Reduce delay/lag when streaming from stdin to http ...?!

Postby Rita VLC » 03 Dec 2013 20:16

Apart from reducing the VLC input and streaming caching, there seems to be no solution to the time lag. Maybe , it's something the developers can look into.

yileku
Blank Cone
Blank Cone
Posts: 16
Joined: 17 Dec 2013 03:36

Re: Reduce delay/lag when streaming from stdin to http ...?!

Postby yileku » 17 Dec 2013 03:44

I am streaming from a Raspberry Pi using raspivid piped to clvc. The latency is about 6 seconds. I am interested in getting less than a second latency. I am using vlc 2.1.2 player for mac os x. I don't see anyplace to set the cache size. Any help is appreciated.
Y-

kielbasa
New Cone
New Cone
Posts: 3
Joined: 14 Apr 2015 14:27

Re: Reduce delay/lag when streaming from stdin to http ...?!

Postby kielbasa » 14 Apr 2015 22:51

I'm using the latest version of VLC 2.1.5 and I'd like to increase delay of a streamed video (to 7sec i.e.)
I read that I could tweak caching under codecs/RTS option, but looks like this option is no longer there.

Is there any way of doing it in a different way?
It's for our coach so that he could watch the volleyball action live first, and then to be able to see it on tablet again.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 21 guests