项目作者: gesa

项目描述 :
Remove commercials, add chapter markers, convert captions to subtitles, and compress files recorded from the Plex DVR
高级语言: TypeScript
项目地址: git://github.com/gesa/plex-dvr.git
创建时间: 2020-09-08T06:37:09Z
项目社区:https://github.com/gesa/plex-dvr

开源协议:

下载


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

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

```shell script
$ plex-dvr [options] [FILE]

  1. ## Options
  2. | option | type | description |
  3. | :-: |:-: | --- |
  4. | `--help`, `-h` | | show CLI help |
  5. | `--verbose`, `-v` | | Verbose logging to the console. |
  6. | `--debug`, `-d` | | Include stdout and stderr from all tools in logs (overrides `verbose` flag) |
  7. | `--encoder`, `-e` | string | Video encoder string to pass to Handbrake. Run `HandbrakeCLI --help` to see available encoders. |
  8. | `--encoder-preset` | string | Video encoder preset to pass to Handbrake. Run `HandbrakeCLI --encoder-preset-list <string encoder>` to see available presets. |
  9. | `--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. |
  10. | `--ignore-quiet-time` | | Process file immediately without checking against quiet time hours. |
  11. | `--ccextractor-location` | string | [default: ccextractor] CCExtractor binary location |
  12. | `--comcut-location` | string | [default: comcut] Comcut binary location |
  13. | `--comskip-location` | string | [default: comskip] Comskip binary location |
  14. | `--ffmpeg-location` | string | [default: ffmpeg] ffmpeg binary location |
  15. | `--handbrake-location` | string | [default: HandBrakeCLI] Handbrake binary location |
  16. | `--handbrake-presets-import` | string | Load Handbrake presets file. Defaults to whatever presets are available in the gui, or barring that, nothing. |
  17. | `--handbrake-preset-name` | string | Name of preset to select from gui or supplied preset file |
  18. | `--[no-]keep-original` | | Prevent original `.ts` file produced by Plex's DVR from being deleted. Default behavior is to delete. |
  19. | `--[no-]keep-temp` | | Prevent temporary working directory from being deleted. Default behavior is to delete. |
  20. | `--sample-config` | | Print default config values & config directory location and exit. |
  21. ## Examples
  22. ```shell script
  23. plex-dvr /path/to/video
  24. 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.