Here is a little script I put together to automate some actions I have after Plex has recorded a show for me. It isn’t perfect, I am sure it needs some work, but it works well enough for now. Any feedback would be appreciated. Below is a quick list of what it does and what you need.
- Follow the instructions on this post to get a majority of the tools installed.
- Install HandbrakeCLI and mkvtoolnix with brew at the command line: brew install mkvtoolnix handbrakecli
- Don’t forget to add the Path to the script in your Plex DVR Settings. i.e. /Users/media/PostProcessingPlex.sh
- Also check the box to process video while recording in device settings. This will save the file as mkv which is needed in order to detect aspect ration properly.
Once you have all of that installed place the PostProcessingPlex-1.0.sh somewhere on your Mac and make sure it is executable. To do that run chmod 755 in the terminal on the file PostProcessingPlex-1.0.sh. i.e. “chmod 755 PostProcessingPlex-1.0.sh”
You can test the program by running the following in the terminal program.
sh PostProcessingPlex-1.0.sh doogiehowser.mkv
This will feed the script whatever video file you have. In my case doogiehowser.mkv is the name of the video file. If you want to monitor the progress you can use the terminal with the program tail to watch the progress. i.e “tail -f /tmp/postProcessPlex.log”
Download the script from my downloads directory. It is called PlexPostProcessScript-1.0