Plex DVR Post Processing Script

October 20, 2016 by Christopher Silvertooth

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.

  1.  Follow the instructions on this post to get a majority of the tools installed.
    https://forums.plex.tv/discussion/233879/macos-plex-dvr-commercial-removal-guide-for-dummies/p3
  2. Install HandbrakeCLI and mkvtoolnix with brew at the command line:  brew install mkvtoolnix handbrakecli
  3. Don’t forget to add the Path to the script in your Plex DVR Settings.  i.e. /Users/media/PostProcessingPlex.sh
  4. 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

Cheers,

Chris

tools

Comments

  1. letsgo1776 says:

    Thank you for the script. I removed the handbrake processing part. It was useful to solve the issue I was having where two shows completed recording in PLEX DVR simultaneously and then locking up my computer due to trying to strip commercials on two files at once.

Leave a Reply

Your email address will not be published. Required fields are marked *