1

I have a sequence of images that I was able to extract from a video using LibVLCSharp. This sample to be more specific. I'm creating a small video library manager for learning purposes, and I would like to extract frames and create thumbnails to play when the user hovers the mouse over the previewer.

Using the aforementioned sample I was able to create a WPF UI around the same loging and extract the frames from a video file. However what I want now is to convert these extracted frames into a video file, using them as preview for the video, just like happens on YouTube.

I wasn't able, however, to find out how to achieve this using LibVLCSharp or just LibVLC. Using this answer on Super User I was able to achieve my goal and put those frames together into a video using ffmpeg.

I haven't taken the time yet to study FFmpeg.Autogen, so I don't know if I would be able to extract the frames from the video files in the same way I can do with LibVLCSharp, but I don't see with good eyes using both libraries on my application, one to export the frames and one to generate these frames into a video.

So, is there a way to get the output frames and convert them into a playable video using LibVLCSharp (or libvlc) itself?

adamasan
  • 1,092
  • 1
  • 12
  • 33

2 Answers2

1

I don't see with good eyes using both libraries on my application

You already are, LibVLC ships with ffmpeg.

So, is there a way to get the output frames and convert them into a playable video using LibVLCSharp (or libvlc) itself?

It is possible that there is a way, but I cannot find it right now. Using libvlc for this would be awkward and an inflexible solution. I would use ffmpeg.

mfkl
  • 1,914
  • 1
  • 11
  • 21
  • Good to know that LibVLC ships with ffmpeg. I meant more in a sense of using two wrappers to to something that I could be doing with only one. I'm trying to find something in the ffmpeg docs. I was able to find something calling VLC directly but only works for exporting frames. Which I'm already doing. – adamasan Feb 09 '21 at 02:48
1

You are not forced to use FFmpeg.Autogen for conversion scenarios you can achieve with ffmpeg.exe. I would start a ffmpeg process to do the conversion, and read the ffmpeg stdout for the video data, if you don't want to save it somewhere.

I think there is a way to play images at a specific rate (look at the VLC CLI options), but I don't know how well it works as I never used that

cube45
  • 3,429
  • 2
  • 24
  • 35