Skip to content

Instantly share code, notes, and snippets.

@hthighway
Last active August 3, 2020 13:13
  • Star 16 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hthighway/4d3567a5b4b505c3d23b93e5a7838f3e to your computer and use it in GitHub Desktop.
Comskip for Linux

Comskip Setup for Linux

This will install comskip, mkvpropedit, ffmpeg, and PlexComskip.py

  • Install Comskip following the Instrutions shown here: https://github.com/erikkaashoek/Comskip

    Pro Tip use `./configure --enable-dontator` and then make a donation to http://www.kaashoek.com/comskip/
    
  • Install mkvtoolnix, which include mkvpropedit here: https://mkvtoolnix.download/downloads.html#ubuntu this is for setting the audio language to English from Unknown

  • Clone the PlexComskip repo: https://github.com/ekim1337/PlexComskip.git

  • Copy PlexComskip.conf.example to PlexComskip.conf and edit as necessary (defaults should be pretty good)

  • create a dvr.sh (or whatever you want to call it) file to include

      #!/bin/sh
    
      /usr/bin/mkvpropedit "$1" --edit track:a1 --set language=eng --edit track:v1 --set language=eng
      
      sleep 10
      
      /usr/bin/python /path/to/PlexComskip.py "$1"
    
@DaveInTO
Copy link

Any idea why when i run it from command line it works perfectly.
But when Plex runs it, it doesn't work?
2016-10-13 21:00:11,744 [7f6611] PlexComskip got invoked from /usr/local/bin/PlexComskip.py
2016-10-13 21:00:12,518 [7f6611] Using session ID: 7f66115f-9cd4-47d2-a44c-e777b603470e
2016-10-13 21:00:12,519 [7f6611] Using temp dir: /tmp/7f66115f-9cd4-47d2-a44c-e777b603470e
2016-10-13 21:00:12,519 [7f6611] Using input file: /Videos/TV/.grab/751659b96f8bae8b244f7abc06a1e6b87bb696f1/Grey's Anatomy (2005) - S13E04 - Falling Slowly.mkv
2016-10-13 21:00:12,520 [7f6611] Copying file to work on it: /tmp/7f66115f-9cd4-47d2-a44c-e777b603470e/Grey's Anatomy (2005) - S13E04 - Falling Slowly.mkv
2016-10-13 21:00:23,935 [7f6611] [comskip] Command: ['/usr/local/bin/comskip', '--output', '/tmp/7f66115f-9cd4-47d2-a44c-e777b603470e', '--ini', '/usr/local/bin/comskip.ini', "/tmp/7f66115f-9cd4-47d2-a44c-e777b603470e/Grey's Anatomy (2005) - S13E04 - Falling Slowly.mkv"]
2016-10-13 21:00:23,967 [7f6611] Using EDL: /tmp/7f66115f-9cd4-47d2-a44c-e777b603470e/Grey's Anatomy (2005) - S13E04 - Falling Slowly.edl
2016-10-13 21:00:23,968 [7f6611] Keeping segment from 0.0 to the end of the file...
2016-10-13 21:00:23,968 [7f6611] [ffmpeg] Command: ['/usr/bin/ffmpeg', '-i', "/tmp/7f66115f-9cd4-47d2-a44c-e777b603470e/Grey's Anatomy (2005) - S13E04 - Falling Slowly.mkv", '-ss', '0.0', '-c', 'copy', 'segment-0.mkv']
2016-10-13 21:00:24,015 [7f6611] Going to concatenate 0 files from the segment list.
2016-10-13 21:00:24,015 [7f6611] [ffmpeg] Command: ['/usr/bin/ffmpeg', '-y', '-f', 'concat', '-i', '/tmp/7f66115f-9cd4-47d2-a44c-e777b603470e/segments.txt', '-c', 'copy', "/tmp/7f66115f-9cd4-47d2-a44c-e777b603470e/Grey's Anatomy (2005) - S13E04 - Falling Slowly.mkv"]
2016-10-13 21:00:24,054 [7f6611] Sanity checking our work...
2016-10-13 21:00:24,054 [7f6611] Output file size was too similar (doesn't look like we did much); we won't replace the original: 1.7GB -> 1.7GB
2016-10-13 21:00:24,054 [7f6611] Leaving temp files in: /tmp/7f66115f-9cd4-47d2-a44c-e777b603470e
2016-10-13 21:00:24,054 [7f6611] Done processing!

@pokes135
Copy link

I had the same issue. I was able to run by cli successfully as well, except my ffmpeg (Ubuntu 16.04) install had a different ffmpeg binary path:
PlexComskip.conf default path:
/usr/local/bin/ffmpeg
PlexComskip.conf my Ubuntu path:
/usr/bin/ffmpeg

Thanks hthighway and would you know why the script won't run in Plex? Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment