update thumb generator script
This commit is contained in:
parent
74613daf2e
commit
ce800b9ddb
@ -1,17 +1,20 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
input_file_path=$1
|
input_file_path=$1
|
||||||
|
|
||||||
# Get the number of frames, fallback to 100 if missing
|
vcsi "${input_file_path}" \
|
||||||
nb_frames=$(ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=noprint_wrappers=1:nokey=1 "$input_file_path")
|
--metadata-position hidden \
|
||||||
|
--metadata-margin 0 \
|
||||||
# Fallback if nb_frames is empty or "N/A"
|
--metadata-horizontal-margin 0 \
|
||||||
if [ -z "$nb_frames" ] || [ "$nb_frames" = "N/A" ]; then
|
--metadata-vertical-margin 0 \
|
||||||
echo "nb_frames was ${nb_frames} which is unsupported. Are you trying this on a .ts file? (It may not work on ts, try mp4.) Exiting."
|
--grid-spacing 0 \
|
||||||
exit 555
|
--grid-horizontal-spacing 0 \
|
||||||
fi
|
--grid-vertical-spacing 0 \
|
||||||
|
--timestamp-horizontal-margin 0 \
|
||||||
sep=$((nb_frames/25))
|
--timestamp-vertical-margin 0 \
|
||||||
|
--timestamp-horizontal-padding 0 \
|
||||||
# Generate a 5x5 tile thumbnail
|
--timestamp-vertical-padding 0 \
|
||||||
ffmpeg -i "$input_file_path" -vf "select=not(mod(n\,max(1\,$sep))),scale=160:-1,tile=5x5" -vsync 0 -update 1 -frames:v 1 "${input_file_path%.*}-thumb.png"
|
-w 830 \
|
||||||
|
-g 5x5 \
|
||||||
|
-o "${input_file_path%.*}-thumb.png"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user