Skip to content

Instantly share code, notes, and snippets.

@joshluongo
Created December 18, 2020 02:22
Show Gist options
  • Save joshluongo/9a728c8d7faeb92b22bb603f1bd3eda6 to your computer and use it in GitHub Desktop.
Save joshluongo/9a728c8d7faeb92b22bb603f1bd3eda6 to your computer and use it in GitHub Desktop.
FFMPEG Thumbnail Generator
#!/bin/bash
# Loop.
for a in `find . -type f \( -iname \*.dv -o -iname \*.mp4 -o -iname \*.mkv \) -not -path '*/\.*'`; do
# Generate thumbs
echo "Processing: $a"
ffmpeg -hide_banner -loglevel fatal -y -ss "$(bc -l <<< "$(ffprobe -loglevel error -of csv=p=0 -show_entries format=duration "$a")*0.5")" -i "$a" -vf yadif -frames:v 1 "$a.jpg"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment