I already tried FileCaching = 0
, NetworkCaching = 0
, but the playback delay still appears to be very high (several seconds). I am using the Avalonia view from LibVLCSharp.Avalonia
NuGet package, but that should not matter.
Here's how the code looks like:
var mediaPlayer = new MediaPlayer(this.vlc) {
FileCaching = 0,
NetworkCaching = 0,
EnableHardwareDecoding = true,
};
var input = new StreamMediaInput(new VideoStream(source));
using var media = new Media(this.vlc, input);
media.AddOption(":demux=h264");
mediaPlayer.Play(media);
P.S. After some research, I found, that h264 demuxer does not really know the video FPS, so the reason for delay might be that VLC is only showing frames at 24-30 per second. I tried adding media.AddOption(":h264-fps=60")
to indicate real video FPS, but the issue did not disappear. This parameter appears to be ignored (wrong format? broken?).
P.P.S. Sadly LibVLCSharp does not complain about unrecognized options.