From 6141e1c8eb8f04b75387f0250a831539b91fc23c Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 8 Nov 2023 11:01:53 -0500 Subject: [PATCH] thumbnailify! because mp4 doesn't specify thumbnails, i'm sick of the blank black, and discord just uses the first frame --- bash/thumbnailify.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 bash/thumbnailify.sh diff --git a/bash/thumbnailify.sh b/bash/thumbnailify.sh new file mode 100755 index 0000000..f0bd3e0 --- /dev/null +++ b/bash/thumbnailify.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +if [ ! -f "$@" ]; then + echo "file to thumbnailify plz" +fi + +fullfilename=$(basename -- "$@") +extension="${fullfilename##*.}" +filename="${fullfilename%.*}" + +pushd $(dirname "$@") + +if [ -f "$filename""_thumbless.$extension" ]; then + echo "there's already a _thumbless in here... I think i'm already done?" + exit 1 +fi + +if [ -f "testframe.mp4" ] || [ -f "thumbnailism.txt" ]; then + echo "my temp files are already here... I think i'm redundant?" + exit 1 +fi + +echo "file testframe.mp4" > thumbnailism.txt +echo "file $fullfilename" >> thumbnailism.txt + +ffmpeg -i "$fullfilename" -ss 1.5 -to 1.51666 testframe.mp4 +ffmpeg -f concat -i thumbnailism.txt -c copy output.mp4 + +mv "$fullfilename" "$filename""_thumbless.$extension" +mv output.mp4 "$fullfilename" +rm thumbnailism.txt +rm testframe.mp4 + +popd