Auto Generate Thumbnails for All Videos Inside Folder with FFmpeg

Lương Như Toàn
2 min readDec 23, 2018

YAY YAY it’s cool. I love to be a human being to making automate jobs.

What I want

  • I have a folder including over 3000 videos and I want to generate 3000 thumbnails corresponding for those videos.
  • Each thumbnail image has size is 480x320

Input Folder including .mp4 Videos

How it works

With each videos, It will seek to the position of 00h:00m:03sec of the video and capture one frame (-vframes 1) then save it into a JPG file => Then Repeat that jobs until done.

Run this command from your terminal

for f in *.mp4; do ffmpeg -i "$f" -ss 00:00:03 -vframes 1 -s 480x320 "${f%.mp4}.jpg"; done
generated thumbnails FOR ALL VIDEOS INSIDE FOLDER (capture thumbnails at 00:00:03) with size -s 480x320

--

--

Lương Như Toàn

Hungry Solopreneur, Software Engineer passionate about turning ideas into real products. Hey YOLO! (You only live Once). My Blog: https://luongnhutoan.com