Extrem delay when playing a network video stream
I'm getting a huge delay of about 7-15s while streaming a video from a local network webcam. The Uri looks like this: http://192.168.10.77/webcam/?action=stream
XAML:
<vlc:MediaPlayerElement
IsVisible="{Binding IsLoadingWebCamStream, Converter={StaticResource BooleanReverseVisibilityConverter}}"
MediaPlayer="{Binding MediaPlayer}"
LibVLC="{Binding LibVLC}"
VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
Margin="5"
BackgroundColor="{DynamicResource Black}"
EnableRendererDiscovery="True">
<vlc:MediaPlayerElement.PlaybackControls>
<vlc:PlaybackControls
IsAudioTracksSelectionButtonVisible="False"
IsClosedCaptionsSelectionButtonVisible="False"
IsAspectRatioButtonVisible="True"
IsCastButtonVisible="False"
IsPlayPauseButtonVisible="False"
IsRewindButtonVisible="False"
IsSeekButtonVisible="False"
IsSeekEnabled="False"
IsSeekBarVisible="False"
/>
</vlc:MediaPlayerElement.PlaybackControls>
</vlc:MediaPlayerElement>
C#
List<string> options = new List<string>();
options.Add(string.Format("--file-caching={0}", FileCaching));
//options.Add(string.Format("--network-caching={0}", NetworkBufferTime));
//options.Add(string.Format("--live-caching={0}", NetworkBufferTime));
//options.Add(string.Format("--clock-jitter={0}", 0));
//options.Add(string.Format("--clock-synchro={0}", 0));
options.Add("-vvv");
Core.Initialize();
LibVLC = new LibVLC(options.ToArray());
//MediaPlayer = new MediaPlayer(LibVLC);
if (MediaPlayer != null && MediaPlayer.IsPlaying)
MediaPlayer.Stop();
string uri = string.Format("{0}{1}{2}", Server.Protocol, Server.Address, Uri);
var Media = new Media(LibVLC, uri, FromType.FromLocation);
//Media.AddOption(string.Format(":network-caching={0}", NetworkBufferTime));
//Media.AddOption(string.Format(":clock-jitter={0}", 0));
//Media.AddOption(string.Format(":clock-synchro={0}", 0));
//await Media.Parse(MediaParseOptions.ParseNetwork);
MediaPlayer = new MediaPlayer(Media)
{
EnableHardwareDecoding = true,
NetworkCaching = Convert.ToUInt32(NetworkBufferTime),
FileCaching = Convert.ToUInt32(FileCaching),
};
MediaPlayer.Play();
I tried a lot of combinations with the options, however nothing seems to work. I found some posts on Stackoverflow, however none was working as expected. Is there anything I miss? Thanks for helping out!