I installed ffmpeg and every time I have to use it inside KM I always have to add this to the beginning of the script:
/opt/anaconda3/bin/
I already have this in my variables:
Initially, from what I was told, this would fix the issue and I would just have to add the script, like this, for example:
ffmpeg -f avfoundation -i ":3" -t 3 /Users/dannywyatt/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Tiago/System/Attachment\ Files/audio/audioaudiocapture.mp3
But to make it run in KM, I have to have this:
/opt/anaconda3/bin/ffmpeg -f avfoundation -i ":3" -t 3 /Users/dannywyatt/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Tiago/System/Attachment\ Files/audio/audioaudiocapture.mp3
So this is the first issue, if someone can help me with this?
I'm not an expert, but this seems to be the issue with certain workflows, for example if I want to use different variables to create a final script and then merge everything into a single variable and just add $KMVAR_Local__myVarHere
to the Execute Shell action, it doesn't work, even though the whole script is working when I paste it directly to the Execute Shell action.
So, this does NOT work:
Execute a Shell Script failed with script error: text-script: line 1: ffmpeg: command not found
This DOES work:
This does NOT work:
2024-05-26 09:50:43 Action 15907120 failed: Execute a Shell Script failed with script error: ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers
built with clang version 11.1.0
configuration: --prefix=/opt/anaconda3 --cc=x86_64-apple-darwin13.4.0-clang --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-gpl --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-libx264 --enable-pic --enable-pthreads --enable-shared --enable-static --enable-version3 --enable-zlib --enable-libmp3lame --pkg-config=/Users/runner/miniforge3/conda-bld/ffmpeg_1627813741069/_build_env/bin/pkg-config
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[AVFoundation indev @ 0x7fb94c704280] Video device not found
":3": Input/output error
If I save this code to an .sh
file and try to read it:
Execute a Shell Script failed with script error: /bin/sh: /Users/dannywyatt/My Files/AppleScript, Apps, Automator, Scripts, Droplets, etc/Shell Scripts/audiocapture.sh: Permission denied
I get this error reading from the .sh file whether I add /opt/anaconda3/bin/
to the beginning of the script or not.