friedrith / productivity

Scripts and commands to improve productivity
MIT License
10 stars 1 forks source link

co-delay command error #3

Open b4kik opened 19 hours ago

b4kik commented 19 hours ago

After I got the shortcut, I changed the command "convert" into "magick" according to the error message, and now another one appeared:

Error: /Users/b4kik/Library/Group Containers/group.com.apple.shortcuts/Temporary/ com.apple.WorkflowKit.BackgroundShortcutRunner/5FCECD03-8CE5-4440-9FDE-41EDC6F63B7E:15: i command not found: ffmpeg magick: unable to open image 'co-delay': No such file or directory @ error/blob.c/OpenBlob/3596. magick: no decode delegate for this image format ''@ error/constitute.c/Readlmage/746.

Script: PATH=/opt/homebrew/bin:/usr/bin/

require ffmpeg and imagemagick installed

set -e videoFilename=$1 filename="${videoFilename%.*}" tmpFilename="$filename.tmp.gif" gifFilename="$filename.gif"

cf https://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality

filters="fps=10,scale=1000:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=128[p];[s1][p]paletteuse=dither=bayer"

ffmpeg -i "$videoFilename" -vf "$filters" -c:v pam -f image2pipe - | magick co-delay 10 - -loop 0 -layers optimize "$gifFilename"

echo "GIF $gifFilename generated"

Anyone has such an issue?

friedrith commented 19 hours ago

Hi. Have you installed ffmpeg?