Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HatScripts/d4aa916a93ba18d4a74702d86a695838 to your computer and use it in GitHub Desktop.
Save HatScripts/d4aa916a93ba18d4a74702d86a695838 to your computer and use it in GitHub Desktop.
Batch generate thumbnails from mp4 files using ffmpg
#!/bin/bash
# setup
FILES=name_of_file_to_match_*.mp4
SEEK_POINT=00:00:30
IMG_FORMAT=png
FRAME_SIZE=150X100
DEST=thumbnails
for f in $FILES
do
echo "Generating thumbnail for $f ..."
ffmpeg -i $f -y -an -ss $SEEK_POINT -vcodec $IMG_FORMAT -r 1 -vframes 1 -s $FRAME_SIZE $DEST/_$f.$IMG_FORMAT
echo "===================================================="
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment