video-static-html/thumbnailer.sh

9 lines
238 B
Bash
Raw Permalink Normal View History

2020-04-11 22:18:23 +00:00
#!/bin/bash
videos_dir="${1:-static/media}"
output_dir="${2:-static/media/thumbnails}"
for file in "$videos_dir/"*.mp4; do
out="$output_dir/${file%.*}.png"
ffmpeg -i "$file" -vf "thumbnail,scale=640:360" -frames:v 1 "$out"
done