Skip to content

Instantly share code, notes, and snippets.

@tomeko
Last active January 13, 2025 18:05
Show Gist options
  • Save tomeko/70f2da1caf484000b416784c5aaad713 to your computer and use it in GitHub Desktop.
Save tomeko/70f2da1caf484000b416784c5aaad713 to your computer and use it in GitHub Desktop.
Comskip + Jellyfin setup guide (Ubuntu 22.04)

Setting up Comskip with Jellyfin (non docker install)

This just got way easier as comskip seems to be in apt packages now. The only thing you need to do is slightly modify the script in jellyfin-dvr-comskip because it assumes a docker install

1. Install comskip

sudo apt install comskip

2. Get and update jellyfin-dvr-comskip

git clone https://github.com/Protektor-Desura/jellyfin-dvr-comskip.git
  • Open/edit <extracted_path>/config/comskip/jellyfin-drv-comskip.sh
  • In the following line:
$__command --ffmpeg=$__ffmpeg --comskip=/usr/local/bin/comskip --lockfile=/tmp/comchap.lock --comskip-ini=/config/comskip/comskip.ini "${__file}"
  • change the --comskip= to your installed location (probably /usr/bin/comskip, check with whereis comskip)
  • change the --comskip-ini= to the full path of comskip.ini you extracted earlier
  • jellyfin-drv-comskip.sh should be executable, but just in case chmod +x jellyfin-drv-comskip.sh

3. Configure Jellyfin

  • Open your Jellyfin client (web, Android, etc.)
  • Dashboard > Live TV > DVR, then find the Post-processing application: field
  • Enter the path to the jellyfin-drv-comskip script (make sure it's the full absolute path)
<extracted_path>/config/comskip/jellyfin-drv-comskip.sh
  • The Post-processor command line arguments should be "{path}" by default. If not, put it there
  • Save settings

Note: If you have this set up in your home folder and have issues, make sure your home folder has public read/exec permissions (e.g. chmod /home/myuser 775)

@williamthrilliam
Copy link

It seems that comcut also has to be installed; the script is exacting subtitles but isn't cutting commercials. Is there a package for this or does it need to be installed from source?

@rohitsud
Copy link

It seems that comcut also has to be installed; the script is exacting subtitles but isn't cutting commercials. Is there a package for this or does it need to be installed from source?

comcut is in the jellyfin-dvr-comskip repo

@nordge1
Copy link

nordge1 commented Jan 13, 2025

I am running jellyfin in an LXC container using a helper script. . I am getting a permissions error when running the script.

  1. I believe jellyfin is run by a user "jellyfin" and I have added it to the sudoers group.
  2. I have chmod _R 775 the install directory /jellyfin-dvr-comskip
  3. I am getting the logs below
    I'm certain this has to do with permissions but not sure what to do.
    Any clue as to how to fix it?

2025-01-13 11:26:57.664 -06:00] [INF] Triggering refresh on "/var/lib/jellyfin/data/livetv/recordings/show.ts" [2025-01-13 11:26:57.666 -06:00] [INF] Refreshing recording parent "/var/lib/jellyfin/data/livetv/recordings" [2025-01-13 11:26:57.672 -06:00] [INF] Starting "/usr/lib/jellyfin-ffmpeg/ffprobe" with args "-analyzeduration 200M -probesize 1G -i file:\"/var/lib/jellyfin/data/livetv/recordings/show.ts\" -threads 0 -v warning -print_format json -show_streams -show_chapters -show_format" [2025-01-13 11:26:57.676 -06:00] [INF] Running recording post processor "/jellyfin-dvr-comskip/config/comskip/jellyfin-drv-comskip.sh" "\"/var/lib/jellyfin/data/livetv/recordings/show.ts\"" [2025-01-13 11:26:57.973 -06:00] [INF] Starting "/usr/lib/jellyfin-ffmpeg/ffprobe" with args "-analyzeduration 200M -probesize 1G -i file:\"/var/lib/jellyfin/data/livetv/recordings/show.en.srt\" -threads 0 -v warning -print_format json -show_streams -show_format" [2025-01-13 11:26:58.003 -06:00] [ERR] Error getting external streams from "/var/lib/jellyfin/data/livetv/recordings/show/show.en.srt" MediaBrowser.Common.FfmpegException: ffprobe failed - streams and format are both null. at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.GetMediaInfoInternal(String inputPath, String primaryPath, MediaProtocol protocol, Boolean extractChapters, String probeSizeArgument, Boolean isAudio, Nullable1 videoType, CancellationToken cancellationToken)
at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.GetMediaInfoInternal(String inputPath, String primaryPath, MediaProtocol protocol, Boolean extractChapters, String probeSizeArgument, Boolean isAudio, Nullable1 videoType, CancellationToken cancellationToken) at MediaBrowser.Providers.MediaInfo.MediaInfoResolver.GetExternalStreamsAsync(Video video, Int32 startIndex, IDirectoryService directoryService, Boolean clearCache, CancellationToken cancellationToken)

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