How to reduce network latency?

macOS specific usage questions
llamafilm
Blank Cone
Blank Cone
Posts: 13
Joined: 06 Aug 2018 02:36

How to reduce network latency?

Postby llamafilm » 06 Aug 2018 03:25

I'm trying to play an H.264 elementary stream from a Raspberry Pi. It works ok with VLC, but I'm trying to reduce the latency. I've set network caching to 0ms. Are there any other relevant settings? The weird thing is, sometimes it has about 1200ms latency, and other times it's about 4000ms, and nothing is changing except I quit and relaunch it. This is over a fast LAN and the stream is only 1Mbps.
The stream is generated using picamera with netcat.
In VLC I use this input:

Code: Select all

tcp/h264://192.168.1.3:8080
I see H264 in the preferences under Demuxers, but I don't see any settings for the TCP protocol.

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: How to reduce network latency?

Postby InTheWings » 06 Aug 2018 10:07

Use MJPEG or configure your stream with higher frame rate or low latency H264 (Intra, P frames only...)
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

llamafilm
Blank Cone
Blank Cone
Posts: 13
Joined: 06 Aug 2018 02:36

Re: How to reduce network latency?

Postby llamafilm » 06 Aug 2018 17:45

MJPEG is not an option here, since I want this to work over the internet and have good 720p quality in 1Mbps. I'm using 30fps, do you really think higher than that will help?
I will experiment to see if picamera can adjust the I-frames, but there is another app which can play this stream perfectly with only about 100ms latency on iOS. I'm hoping to do the same on a computer. This is the app: https://github.com/ShawnBaker/RPiCameraViewer

banshee1971
New Cone
New Cone
Posts: 5
Joined: 31 Oct 2017 13:29

Re: How to reduce network latency?

Postby banshee1971 » 25 Oct 2018 21:31

I got the same issue here.
I can play a UDP multicast Stream with FFPLAY with an overall latency arround 200ms ... But with VLC, can't find how to reduce the latency to the same value, using command line under Windows.

How can i acheive that ?
I was using this command line, without improvement in the latency :
vlc -vvv --network-caching=300 --sout-x264-preset=ultrafast --sout-x264-tune=zerolatency udp://@239.255.179.6:5000
now i use HEVC stream, so x264 preset will probably not working.


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: No registered users and 34 guests