Skip to content

Instantly share code, notes, and snippets.

@shunchu
Created November 15, 2012 18:00
Show Gist options
  • Save shunchu/4080126 to your computer and use it in GitHub Desktop.
Save shunchu/4080126 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