Page 1 of 1

Is there a way to buffer a video before playing it?

Posted: 04 Apr 2021 12:51
by DanielK117
Is there any way to buffer a video before it plays?

My current play logic is implemented as follows:

Code: Select all

media = new Media(vlc, nextMediaItem.FileNameWithPath); videoClipMediaPlayer.Media = media; this.videoClipMediaPlayer.Play();
Currently, buffering happens only when the Play() function is called.
In order to play videos more smoothly, I would like to buffer the video already when the user has selected a video.
Is there a way to start buffering before the play() function?

Re: Is there a way to buffer a video before playing it?

Posted: 04 Apr 2021 18:38
by RĂ©mi Denis-Courmont
You can provide custom stream input callbacks if you want finer control over that. At least with the native API.

See documentation.

Re: Is there a way to buffer a video before playing it?

Posted: 10 May 2021 01:30
by SteelyJim
I record video to a disc file and play it back simultaneously with LibVLCSharp media player. I always make sure the playback always is at least 10 seconds behind the recording. Without buffering, playback is pretty rough. This code smooths it out...

Core.Initialize();
string[] options = new string[1];
options[0] = "--disc-caching=3000";
fLibVLC = new LibVLC(options);

SteelyJim