viltube/genthumbs.sh
2025-02-19 06:13:56 -05:00

11 lines
494 B
Bash
Executable file

#!/bin/sh
# Script to generate thumbnails
rm thumbs/*.webp
for video_file in videos/*; do
file_name=$(basename "$video_file")
file_extension="${file_name##*.}"
thumbnail_file="thumbs/${file_name%.*}.webp"
ffmpeg -loglevel 8 -y -i "$video_file" -ss 00:00:30 -vframes 1 -vf "scale=160:-1" -c:v libwebp "$thumbnail_file"
#this one makes animated webp thumbnails
#ffmpeg -loglevel 8 -y -i "$video_file" -vf "setpts=0.6*PTS,scale=iw/8:-1" -c:v libwebp "$thumbnail_file"
done