Last active
June 23, 2020 04:21
-
-
Save xyvs/dccbce39ec4ee718996973c9eca2771b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#################### | |
# Thumbnail Maker - V1.0 | |
# Usage: thumbnailmaker video.mp4 | thumbnailmaker video.mkv 10 | |
# Author: https://gist.github.com/xyvs | |
#################### | |
if [ "$1" ]; then | |
image () { | |
percent=$(echo $RANDOM % 80 + 10 | bc) | |
filename="thumbnails/$filename-$percent.png" | |
ffmpegthumbnailer -i "$1" -s 0 -q 10 -t $percent -o "$filename" | |
} | |
# Make Folder | |
filename="${1%.*}" | |
if [ -d "thumbnails" ]; then | |
echo "[NFO] Folder Exists" | |
else | |
mkdir "thumbnails" | |
fi | |
# Make Image/s | |
if [ "$2" ]; then | |
for $(seq $2); do | |
image $1 | |
done | |
else | |
image $1 | |
fi | |
echo "[DONE] Your files are available at $(pwd)/thumbnails" | |
else | |
echo "[USAGE] thumbnailmaker video.mp4 | thumbnailmaker video.mkv 10" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment