Expressingx
Expressingx

Reputation: 1572

Extracting thumbnails from a video for creating sprite is really slow on large videos

I have to create 'preview' on video progress hover. I'm doing with a sprite image and WebVTT file. Using ffmpeg and imagemagick. However generating thumbnails from a mp4 video is really damn slow (20-30 minutes for 2hrs and 20 min long video). The video is Full HD, H246 encoded, 2GB big. The command used

"ffmpeg.exe -i largevideo.mp4 -f image2 -bt 20M -vf fps=1/5 thumbs-%03d.jpg"

Which means thumb for every 5 secs of the video. Is there a way to make it faster? Videos in prod can be even bigger.

OS: Win10, ImageMagick is used later to create the sprite from all the thumbnails created with ffmpeg.

Upvotes: 4

Views: 2209

Answers (1)

llogan
llogan

Reputation: 134173

Skip everything except keyframes:

ffmpeg -skip_frame nokey -i input.mp4 -vsync passthrough thumbs-%03d.jpg

Also see:

Upvotes: 8

Related Questions