From 374e1b1fa2f89d98242591b2978a10fb6e82cbde Mon Sep 17 00:00:00 2001 From: Jan Jastrow Date: Wed, 19 Jan 2022 13:51:34 +0100 Subject: [PATCH] Changed 120 to non-system variable --- vithumbs.sh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/vithumbs.sh b/vithumbs.sh index 993d718..5c1157f 100644 --- a/vithumbs.sh +++ b/vithumbs.sh @@ -1,15 +1,15 @@ #!/bin/bash if [ -z "$1" ]; then - echo "usage: ./vithumbs.sh INPUT [COLUMNS=5] [ROWS=5] [SIZE=1600]" + echo "usage: ./vithumbs.sh INPUT [COLS=5] [ROWS=5] [SIZE=1600]" exit fi # Define variables INPUT=$1 -COLUMNS=$2 -if [ -z "$COLUMNS" ]; then - COLUMNS=5 +COLS=$2 +if [ -z "$COLS" ]; then + COLS=5 fi ROWS=$3 if [ -z "$ROWS" ]; then @@ -19,7 +19,7 @@ SIZE=$4 if [ -z "$SIZE" ]; then SIZE=1600 fi -NFRAMES=$(echo "scale=0;$COLUMNS*$ROWS" | bc) +NFRAMES=$(echo "scale=0;$COLS*$ROWS" | bc) DURX=$(ffmpeg -i "$INPUT" 2>&1 | grep Duration | awk '{print $2}' | tr -d ,) DURATION=$(ffmpeg -i "$INPUT" 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,// | sed 's@\..*@@g' | awk '{ split($1, A, ":"); split(A[3], B, "."); print 3600*A[1] + 60*A[2] + B[1] }') RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "$INPUT") @@ -30,27 +30,27 @@ TMPDIR="/tmp/thumbnails-${RANDOM}/" mkdir $TMPDIR for (( VARIABLE=0; VARIABLE>${TMPDIR}metadata.txt