12 lines
494 B
Bash
12 lines
494 B
Bash
![]() |
#!/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
|