Thought I'd share a rule I created for a niche requirement I had:
Check each time a new video file is added to the Downloads folder and see whether it's HEVC (x.265) encoded.
Requirements:
- Have Mediainfo installed. In my case it's installed in /usr/local/bin/mediainfo by installing it via Homebrew's brew command* :
- Code: Select all
brew install mediainfo
Setup:
Here is my ruleset:
Here is my Shell Script (remember to set it to run in shell /bin/bash
- Code: Select all
CODEC=$(/usr/local/bin/mediainfo --Inform="Video;%Format%" "$1")
if [ $CODEC == 'HEVC' ]
then
echo "Output 0. HEVC"
exit 0
else
echo "Output 1. Not HEVC"
exit -1
fi
The echo commands are optional and won't do anything. I used them during debugging.
*You can install Homebrew from here: https://brew.sh