Skip to content

Instantly share code, notes, and snippets.

@markshust
Created July 16, 2022 05:39
Show Gist options
  • Save markshust/aaaddfe749708fc82861465dede28d3d to your computer and use it in GitHub Desktop.
Save markshust/aaaddfe749708fc82861465dede28d3d to your computer and use it in GitHub Desktop.
Generate video thumbnails at 15 sec timestamp from directory of MP4 files
#!/bin/bash
for i in *.mp4; do
[[ $i == *"- clean"* ]] && continue # this line excludes files that contain "- clean" in filename
prefix=`echo "$i" | sed "s/^\([0-9]*\)\.\(.*\)/\1/"`;
ffmpeg -i "$i" -ss 00:00:15.00 -vf "thumbnail,scale=480:270" -frames:v 1 "$prefix.webp"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment