Search code examples
videothumbnailsvideo-thumbnails

How to generate a thumbnail from videos without load the whole video?


There are so many ways to generate a thumbnail from a video, but I am wondering do they need to load the whole video?

As far as I can think, if I just want to extract the first frame in video and convert it into an image, it is no need to load the whole video.

But I also know that not every video format is stream-like. So is there a general way to generate a thumbnail from a video with the least cost?

PS: OS is linux and I want to use command line.


Solution

  • You could use ffmpeg, example from the docs:

    ffmpeg -i input.flv -ss 00:00:14.435 -vframes 1 out.png
    

    This example will seek to the position of 0h:0m:14sec:435msec and output one frame (-vframes 1) from that position into a PNG file.