The magick convert is deprecated

This commit is contained in:
Ken Fallon 2024-12-24 13:02:58 +01:00
parent 2ac5bd0e51
commit a8897cc793
2 changed files with 26 additions and 9 deletions

View File

@ -54,20 +54,20 @@ trap 'cleanup_temp $TMP1' SIGHUP SIGINT SIGPIPE SIGTERM EXIT
ffmpeg -v 0 -analyzeduration 900000000000 -probesize 200M -threads 2 -i "$AUDIO" \
-filter_complex aformat=channel_layouts=mono,showwavespic=colors=white:s=3200x800 \
-frames:v 1 -f apng - 2>/dev/null | \
magick convert - -background black -alpha remove -alpha off "$TMP1" 2>/dev/null | cat > /dev/null 2>&1
magick - -background black -alpha remove -alpha off "$TMP1" 2>/dev/null | cat > /dev/null 2>&1
#
# Not clear what's being done to the image here, but it produces a useful end
# result, or seems to!
#
magick convert -background black "$TMP1" -gravity center -background black -transparent white - | \
magick convert - -gravity South -background white -splice 0x5 -background black -splice 0x5 - | \
magick convert - -trim - | \
magick convert - -gravity South -chop 0x5 - | \
magick convert - -gravity North -background white -splice 0x5 -background black -splice 0x5 - | \
magick convert - -trim - | \
magick convert - -gravity North -chop 0x5 - | \
magick convert - -resize '800x200!' "$IMAGE"
magick -background black "$TMP1" -gravity center -background black -transparent white - | \
magick - -gravity South -background white -splice 0x5 -background black -splice 0x5 - | \
magick - -trim - | \
magick - -gravity South -chop 0x5 - | \
magick - -gravity North -background white -splice 0x5 -background black -splice 0x5 - | \
magick - -trim - | \
magick - -gravity North -chop 0x5 - | \
magick - -resize '800x200!' "$IMAGE"
#
# The original renamed the temporary file to be the target image file, but

17
bin/duration.bash Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# Copyright Ken Fallon - Released into the public domain. http://creativecommons.org/publicdomain/
find ${HOME}/processing/ -type f | egrep -v '/sponsor-anhonesthost.com-hpr15.flac|/outro.flac|/intro.flac|/sponsor-archive.org.flac' | while read mediafile
do
duration=$( mediainfo --full --Output=XML "${mediafile}" | xmlstarlet sel -T -t -m "_:MediaInfo/_:media/_:track[@type='Audio']/_:Duration[1]" -v "." -n - | awk -F '.' '{print $1}' )
if [ "${duration}" != "" ]
then
echo "${mediafile}: ${duration}"
continue
fi
duration=$( /bin/date -ud "1970-01-01 $( ffprobe -i "${mediafile}" 2>&1| awk -F ': |, ' '/Duration:/ { print $2 }' )" +%s )
if [ "${duration}" != 0 ]
then
echo "${mediafile}: ${duration}"
continue
fi
done