Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created February 23, 2017 04:38
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/969f9c8ddbde14f1c5029b2b65638af1 to your computer and use it in GitHub Desktop.
Save tripflex/969f9c8ddbde14f1c5029b2b65638af1 to your computer and use it in GitHub Desktop.
Plex DVR Post Process remove Commercials with Comskip
#!/bin/csh
# Add bash path to Plex path.
set path = ($path /usr/local/bin)
# Sleep for a pseudorandom period (up to 10 seconds) to limit the number of instances that start at once
sleep `echo $$%10 | bc`
/root/comchap/comcut --ffmpeg=/usr/local/bin/ffmpeg --comskip=/root/comskip/comskip --lockfile=/tmp/comchap.lock --comskip-ini=/usr/local/etc/comskip.ini "$1"
HandBrakeCLI -i "$1" -o "$1".mkv --format mkv --encoder x264 --quality 20 --loose-anamorphic --decomb fast --x264-preset fast --h264-profile high --h264-level 4.1
find /mnt -name "*.ts" -not -path "*/\.*" -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment