npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

plex-dvr

v2.0.0

Published

A postprocessing script for the Plex DVR. Removes commercials, adds chapter markers, extracts captions as subtitles, and converts to mkv. Requires comskip, comcut, ccextractor, ffmpeg, and HandbrakeCLI.

Downloads

20

Readme

plex-dvr

oclif Version Downloads/week License

PLEX DVR POSTPROCESSING

This script accepts a transport stream as an argument [FILE] and does the following:

  1. Copies the original ts to a subdirectory within the system tmpdir
  2. Runs comskip to find commercial boundaries*. If found, it
    1. Deletes them using comcut
    2. Generates chapter boundaries at commercial breaks
  3. Extracts closed captions as subtitles
  4. Remuxes to mp4 to add chapter markers
  5. Transcodes to mkv to compress and add subtitles
  6. Cleans up after itself
    1. Deletes original ts
    2. Deletes temporary files
    3. Moves mkv to source directory (presumably .grab/)

It does all of this while respecting quiet hours and ensuring only one file is being processed at a time. It also produces detailed logs on its own and adds begin/end lines to the PMS logs.

PREREQUISITES

  • ffmpeg: https://ffmpeg.org/
  • comskip: https://github.com/erikkaashoek/Comskip
  • comcut: https://github.com/BrettSheleski/comchap
  • ccextractor: https://github.com/CCExtractor/ccextractor
  • HandbrakeCLI: https://handbrake.fr/downloads.php

You can likely get some or all of these programs from your package manager.

Using in Plex

As of Plex Media Server v1.19.3, the postprocessing script must be called from the Scripts directory inside the application data directory.

Usage

$ plex-dvr [options] [FILE]

Options

| option | type | description | | :-: |:-: | --- | | --help, -h | | show CLI help | | --verbose, -v | | Verbose logging to the console. | | --debug, -d | | Include stdout and stderr from all tools in logs (overrides verbose flag) | | --encoder, -e | string | Video encoder string to pass to Handbrake. Run HandbrakeCLI --help to see available encoders. | | --encoder-preset | string | Video encoder preset to pass to Handbrake. Run HandbrakeCLI --encoder-preset-list <string encoder> to see available presets. | | --quiet-time, -q | string | Quiet time, in the format of NN-NN where NN is an hour on the 24-hour clock (0 being midnight, 23 being 11pm). Default value 03-12 because I am a night owl. | | --ignore-quiet-time | | Process file immediately without checking against quiet time hours. | | --ccextractor-location | string | [default: ccextractor] CCExtractor binary location | | --comcut-location | string | [default: comcut] Comcut binary location | | --comskip-location | string | [default: comskip] Comskip binary location | | --ffmpeg-location | string | [default: ffmpeg] ffmpeg binary location | | --handbrake-location | string | [default: HandBrakeCLI] Handbrake binary location | | --handbrake-presets-import | string | Load Handbrake presets file. Defaults to whatever presets are available in the gui, or barring that, nothing. | | --handbrake-preset-name | string | Name of preset to select from gui or supplied preset file | | --[no-]keep-original | | Prevent original .ts file produced by Plex's DVR from being deleted. Default behavior is to delete. | | --[no-]keep-temp | | Prevent temporary working directory from being deleted. Default behavior is to delete. | | --sample-config | | Print default config values & config directory location and exit. |

Examples

plex-dvr /path/to/video
plex-dvr -q 22-06 -e vt_h264 /path/to/video

Setup

plex-dvr looks for your comskip.ini file at $HOME/.config/plex-dvr/comskip.ini You can also save yourself some hassle and set any of the above options as default in $HOME/.config/plex-dvr/config.json. They will be overwritten by CLI options.