source of latency?

About encoding, codec settings, muxers and filter usage
stefanx
Blank Cone
Blank Cone
Posts: 14
Joined: 09 Jul 2008 23:50

source of latency?

Postby stefanx » 19 Aug 2008 20:15

I have the following setup:
1) Server grabs screen with VH Screen Capture Driver which is send via DirectShow to VLC. VLC encodes with H264 and sends the stream to the client.
2) On the client site VLC retrieves and decodes the screen and displays it on the screen.

This setup results in several seconds latency. I would like to know from you experts what you assume as the main source of latency in this scenario and how to get rid of it. Thank you very much for your help!

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: source of latency?

Postby Jean-Baptiste Kempf » 19 Aug 2008 21:36

If you display locally on the VLC (server), how muh delay do you have ?
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.

stefanx
Blank Cone
Blank Cone
Posts: 14
Joined: 09 Jul 2008 23:50

Re: source of latency?

Postby stefanx » 20 Aug 2008 23:22

Streaming locally-from one VLC instance to another-has a delay of about two seconds.

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

Re: source of latency?

Postby Rémi Denis-Courmont » 21 Aug 2008 20:39

The input cache on both sides. Try --use-stream-immediate and lower caching, depending on the protocol used.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

doxsi
New Cone
New Cone
Posts: 6
Joined: 22 Aug 2008 10:48

Re: source of latency?

Postby doxsi » 22 Aug 2008 10:59

The input cache on both sides. Try --use-stream-immediate and lower caching, depending on the protocol used.


Hi,
i m using a simple stream like VLC---------------------------VLC with the comand line:

vlc -vvv v4l:// :v4l-adev="/dev/audio" :v4l-vdev="/dev/video1" :v4l-norm=1 :v4l-width=320 :v4l-height=240 :v4l-fps=15 :v4l-audio=2 -- sout '#duplicate{dst="transcode{vcodec=mp4v,vb=1024,acodec=mpga,ab=192,sfilter=time,soverlay,channels=2,audio-sync}:std{access=udp,mux=
ts,dst=x.x.x.x}"}'

i use it ti transmit web cam image and voice. But de delay is always about 2 seconds. I try adding de option

--sout-udp-caching 10

but nothing change. How i can reduce this delay ?
thx a lot

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

Re: source of latency?

Postby Rémi Denis-Courmont » 22 Aug 2008 17:45

It's --v4l2-caching ...
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

doxsi
New Cone
New Cone
Posts: 6
Joined: 22 Aug 2008 10:48

Re: source of latency?

Postby doxsi » 25 Aug 2008 10:11

how i must use it?
and the value to have the smaller end-to -end delay?

i try use it but the smaller delay i have is alwaye about 2 seconds.


thanks

stefanx
Blank Cone
Blank Cone
Posts: 14
Joined: 09 Jul 2008 23:50

Re: source of latency?

Postby stefanx » 25 Aug 2008 21:03

The input cache on both sides. Try --use-stream-immediate and lower caching, depending on the protocol used.
The option --use-stream-immediate seems not be exist in VLC 0.8.6 for Windows. I get the message "the command line options couldn't be loaded, check that they are valid." In which VLC does this option exist?

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

Re: source of latency?

Postby Rémi Denis-Courmont » 26 Aug 2008 17:36

Versions 0.9.0 and up.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

stefanx
Blank Cone
Blank Cone
Posts: 14
Joined: 09 Jul 2008 23:50

Re: source of latency?

Postby stefanx » 02 Sep 2008 17:34

Until yet I was not able to get VLC 0.9 to work. I tried the nighlies and beta releases on both Windows and Linux. I will test the option and reply to you as soon as possible.

stefanx
Blank Cone
Blank Cone
Posts: 14
Joined: 09 Jul 2008 23:50

Re: source of latency?

Postby stefanx » 12 Sep 2008 20:12

I was able to get the nightly build of today working. :-)

Startint with --use-stream-immediate works but streaming locally (from one VLC instance to another on the same PC) has a latency of about 4-5 seconds. When setting the cache of the client instance to 0 the latency decreases to about 3 seconds. The cache at the server instance is default to 300ms. If I decrease this value the streaming does not work any more. So to locate the root problem instead of screen grabbing I tried to stream a video file locally. Also in this case it was not possible to decrease the server cache less than 300ms. For my opinion this depends on the video codec but I was not able to find another configuration/coded where it was possible to reduce the server cache below 300ms. How to decrease the cache of a streaming server?


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 29 guests