0

How to get the current video frame while playing video by libvlcsharp? I can play video with libvlcsharp by the codes below:

public void OnAppearing()
        {


            LibVLC = new LibVLC();
            var media = new LibVLCSharp.Shared.Media(LibVLC, new Uri("http://live.cgtn.com/1000/prog_index.m3u8"));


            MediaPlayer = new MediaPlayer(LibVLC)
            {
                Media = media
            };

            media.Dispose();

            Play();
        }
private void Play()
        {
            
            if (m_url != string.Empty)
            {
                MediaPlayer.Play(new LibVLCSharp.Shared.Media(LibVLC, new Uri(m_url)));
            }
            
           
        }
Bill Qu
  • 27
  • 2
  • Can you help me see how to solve this? https://stackoverflow.com/questions/69210874/libvlcsharp-will-get-stuck-playing-specific-videos-on-any-platform – bbhxwl Sep 16 '21 at 15:54

1 Answers1

0

You could use the TakeSnapshot method. However please note:

  • The snapshot will be written to the disk, there's no way to get the frame in memory in VLC 3 (A new API for that will likely come in VLC4)
  • This is not meant to grab every frame, use it only for a snapshot.

If you need more frames, have a look at the Thumbnailer samples. They're not meant to grab all frames either.

cube45
  • 3,429
  • 2
  • 24
  • 35