Public Repository

Last pushed: 2 months ago
Short Description
PLEX media server with commercial detection/removal and transcoding
Full Description

Overview

This project leverages docker-compose to create a service that provides PLEX media system and a post-processor that will mark and/or remove commercials from DVR OTA recordings, as well as transcode them to high-quality h.264, and reinserting them into the PLEX library.

This project leverages docker and docker-compose to create a service of two containers:

  1. The standard plexinc/pms-docker:plexpass container, modified by injecting a postprocessing script (in src/plexpost)
  2. My plexpost container, which detects new recordings and processes them with:
    • Commercial Detection, marking, and/or removal
    • Transcoding to H.264.

Change Log

The changelog can be found here in the git source repository for this project.

Workflow

If you are familiar with the docker-compose system (recommended reading), you will see a volume created called postdata. This volume is mapped by both containers (plex and plexpost). When the plexpost container starts, it will copy the postprocessing script to a bin directory inside the postdata volume. Using the defaults, the postdata volume will be mapped/mounted inside both containers at /postdata. Thus, the postprocessing script will end up in /postdata/bin/plexpost.

This mechanism also ensures that the plexpost container can be updated separately from the plex container. For example, to upgrade the plexpost container without affecting the running plex container:

$ docker pull mbrown/plexpost:latest
$ docker stop plexpost
$ docker rm plexpost
$ docker-compose up -d

The postprocessing script, run after every recording, will create an entry in the postdata volume. Using defaults this can be seen from either container at the path /postdata/queue. The plexpost container scans the queue folder every QUEUETIMER seconds and launches the actual postprocessing tasks as it finds new jobs.

Sources

In addition to the official plex:plexpass docker image, i'm leveraging components from other contributors. Many thanks to these for the fantastic work they have done, without which this project would not have happened.

Quick-Start

  1. Create a directory to hold the docker-compose.yml and mapped data (e.g /docker/data/plex)
  2. Copy the docker-compose.yml file below into the directory.
  3. Modify the ADVERTISE_IP to match your host's IP address
  4. Get a Plex Claim Token and set the PLEX_CLAIM variable to this token. This is only needed the first time you run the container; once the data is initialized, it will be ignored. Once you see "Token Successfully Claimed" in the logs you are good to go.
  5. If you are running a firewall, make sure all the ports listed under ports: are opened
  6. Start it up (docker-compose up -d)
  7. Browse to http://your-host-ip:32400

Next Steps

  1. Configure Plex to your liking:
  2. If you were already a PLEX user you can migrate your PLEX configuration. In the example dockerfile, the PLEX Library folder needs to go in the subdirectory ./data below the docker-compose.yml file.
  3. You do need to be sure to set the postprocessing script location in PLEX to: /postdata/bin/plexpost
  4. Refer to the plex container documentation for details on configuring the plex container.
  5. After configuring your DVRs make sure you set the post processor to /postdata/bin/plexpost

docker-compose.yml Configuration

For detailed configuration of the docker-compose.yml configuration, see the project README and the sample docker-compose.yml file in the github repository.

Docker Pull Command
Owner
mbrown