latency issues with multiple instances of embedded vlc players (C# WPF vlc.dotnet)

This forum is about all development around libVLC.
irootuser
New Cone
New Cone
Posts: 5
Joined: 16 Sep 2019 23:10

latency issues with multiple instances of embedded vlc players (C# WPF vlc.dotnet)

Postby irootuser » 16 Sep 2019 23:35

I am trying to use Vlc-DotNet to upgrade an old WPF app that used to rely on a VLC 0.9.9 embedded player. I have everything ported and up and running now with vlc.dotnet (winforms in wpf) 3.0 / libvlc 3.0.7 basically following a libvlc.dotnet sample for using winforms hosted in WPF. This app has multiple VLC instances in panes kind of like a security camera view.

After switching to the newer vlc versions I have noticed significant latency issues compared to the old VLC 0.9.9. Instances in each pane appear to get out of sync sometimes as much as 2 seconds. I have played around with different values for the :network-caching setting, but I still always seem to get instances that are not in sync. This is very obvious when I point them at the same stream. Streams types are UDP and rtsp, I have similar results with both, with rtsp being a little bit better.

The main issue that is holding us back is that the VLC instances appear to result in different amounts of latency per instance. If they all have a network-caching setting of 300ms for instance, the feeds could end up being offset by 1-2 seconds even when viewing the same source feed.

Does anyone have any tips or things I could perhaps look into?

irootuser
New Cone
New Cone
Posts: 5
Joined: 16 Sep 2019 23:10

Re: latency issues with multiple instances of embedded vlc players (C# WPF vlc.dotnet)

Postby irootuser » 17 Sep 2019 18:22

It appears that VLC had some changes starting in 3.x that would explain the differences I have encountered. I was told that VLC 3.x now dynamically adjusts the buffer caching when errors are present in the stream, which might explain why I have multiple instances that get out of sync in 3.x verses earlier versions?

I am now curious if there are any custom settings that I could try out with the decoder/other to prevent loss of synchronization between instances. Does anyone know of any decoder settings that I could investigate to try and stop VLC 3.x from dynamically increasing the buffer size? Or any other settings that might help mitigate what I am seeing. Rather than falling back to an earlier version of VLC I was wondering if there is a trade off that could be made in rendering/video quality which would keep my multiple streams in sync latency wise.

irootuser
New Cone
New Cone
Posts: 5
Joined: 16 Sep 2019 23:10

Re: latency issues with multiple instances of embedded vlc players (C# WPF vlc.dotnet)

Postby irootuser » 17 Sep 2019 23:35

Another thing I noticed is that when a stream ends up with more observed latency I find the following line in the log:

Code: Select all

ts warning: Broken stream: pid 68 sends packets with dts 888900us later than pcr, applying delay
When a stream has good results this line is not present in the logs^

My guess is that this added delay is what is causing some of my vlc instances to lag behind

irootuser
New Cone
New Cone
Posts: 5
Joined: 16 Sep 2019 23:10

Re: latency issues with multiple instances of embedded vlc players (C# WPF vlc.dotnet)

Postby irootuser » 18 Sep 2019 00:55

Resolved with:

Code: Select all

--no-ts-pcr-offsetfix
My streams now appear in sync.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 19 guests