diff options
author | Caleb Noelke <cjn075@firemail.cc> | 2024-10-21 12:54:52 -0400 |
---|---|---|
committer | Caleb Noelke <cjn075@firemail.cc> | 2024-10-21 12:54:52 -0400 |
commit | fe96c467eec5d66864dde93b4b5186524e258fd1 (patch) | |
tree | f9c7550e03241bb087ade674b459667b1f63ae9a /.local/bin/slider | |
parent | 398886b6d4631bb1e695bf7851f1012c64f6895a (diff) | |
parent | 628ed4dc995f3c09e33c24a01c817c18b1a268af (diff) |
Diffstat (limited to '.local/bin/slider')
-rwxr-xr-x | .local/bin/slider | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/.local/bin/slider b/.local/bin/slider index 3460c77..b412e95 100755 --- a/.local/bin/slider +++ b/.local/bin/slider @@ -67,7 +67,6 @@ if [ -n "${audio+x}" ]; then *) echo "That doesn't look like an audio file."; exit 1 ;; esac totseconds="$(date '+%s' -d $(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//))" - endtime="$((totseconds-seconds))" fi prepdir="${prepdir:-$cache/$file}" @@ -95,10 +94,10 @@ do # If images have already been made in a previous run, do not recreate # them unless -r was given. { [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} && - convert -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base" + magick -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base" else { [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} && - convert -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base" + magick -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base" fi # If the first line, do not write yet. @@ -111,6 +110,7 @@ duration $duration" prevseconds="$(date '+%s' -d "$prevtime")" done < "$file" # Do last file which must be given twice as follows +endtime="$((totseconds-seconds))" echo "file '$base' duration ${endtime:-5} file '$base'" |