Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Plex Remote Transcoder - Dockerized

kjenney69kjenney69 Posts: 30Members, Plex Pass Plex Pass

Dockerizing Plex Remote Transcoder

This is a fork of this thread:
https://forums.plex.tv/discussion/178320/plex-remote-transcoder-a-distributed-transcoding-backend-for-plex

As a huge fan of Plex and it's community and huge fan of Docker and it's community I figure - why not combine these two awesome things ?!!

Plex Remote Transcoder is here:
https://github.com/wnielson/Plex-Remote-Transcoder

Instructions for deploying to Ubuntu are here:
https://github.com/wnielson/Plex-Remote-Transcoder/wiki/Ubuntu-Install

Tim Haan's Plex Server container is here:
https://github.com/timhaak/docker-plex

The initial goal would be to create a (relatively) simple container that abstracts Tim's container, adding requirements for PRT, and then build a second container for the slaves.

Here's the action-plan as I see it:

  1. Setup NFS mount on Plex Server Host
  2. Add Plex UID and GID for NFS on Host
  3. Start Plex Server container mounting the config and data volumes from NFS
  4. Setup NFS mount on PRT Slave Host
  5. Add Plex UID and GID for NFS to match Host
  6. Start PRT Slave container mounting the config and data volumes from NFS

I've created a Github project that's a combination of Tim's and Weston's work wrapped up with a shell script:
https://github.com/mastermindg/docker-plexremote

This will be where I will begin. If you have any comments/suggestions and/or want to help knock this out of the park then feel free. There are no such thing as bad ideas.

«1

Answers

  • kopfpilotkopfpilot Posts: 297Members, Plex Pass Plex Pass

    The idea is pretty charming :)

    Though, i am curious why you try to mount NFS share everywere..
    Network shares should be mounted to the docker host and used as volumes in order to mount the shares into the docker containers. Actualy this will even result in less network traffic :)

    Problems with remote connection?

    • Does the server have a static-ip and is using a wired connection?
    • Is port forwarding activated in your router and matches the port in PMS->Settings->Remote-Access->Manually enter Port
    • Does the external ip (in PMS) match the wan ip (in router) and is the external port accessible (see: www.canyouseeme.org)?
    • Does the plex.web access work using the url http://remote-ip:32400/web (or the port you specified in your router)?
    • Is Secure conection disabled for troubleshoot? If not:does the router support dns rebind protection and is *.plex.direct excluded?
    • Are any special network configurations involved (Jumbo Frames / IPv6/ VPN / SSH port forwarding / more than a single router or subnet)?
    • Are any Custom server access URLs added?
    • Brand and model of the router?

    What did you try so far (be as specific as you can)?

  • deevusdeevus Posts: 11Members, Plex Pass Plex Pass

    I'll be watching the development of this. +1

  • detzdetz Posts: 110Members, Plex Pass Plex Pass

    This is what I need! I have my main plex box that gets hammered sometimes but my Mac desktop with tons of power sits idel. I might have to get docker on the Mac and try this out, looks very promising.

  • ipmccipmcc Posts: 7Members, Plex Pass Plex Pass

    The NFS requirement is, unfortunately, a requirement of PRT at this point. I've been chin-scratching about how one might work around this, but haven't dug in too deeply yet.

    FWIW, my problem is similar to OP. My Plex machine is relatively wimpy, but my desktop is mostly idle, and far more capable.

  • kopfpilotkopfpilot Posts: 297Members, Plex Pass Plex Pass

    @ipmcc said:
    The NFS requirement is, unfortunately, a requirement of PRT at this point. I've been chin-scratching about how one might work around this, but haven't dug in too deeply yet.

    yep, but you mount the NFS shares on the docker host and mount them inside the containers as volumes (actually mount bind a docker host path to a container path).

    Problems with remote connection?

    • Does the server have a static-ip and is using a wired connection?
    • Is port forwarding activated in your router and matches the port in PMS->Settings->Remote-Access->Manually enter Port
    • Does the external ip (in PMS) match the wan ip (in router) and is the external port accessible (see: www.canyouseeme.org)?
    • Does the plex.web access work using the url http://remote-ip:32400/web (or the port you specified in your router)?
    • Is Secure conection disabled for troubleshoot? If not:does the router support dns rebind protection and is *.plex.direct excluded?
    • Are any special network configurations involved (Jumbo Frames / IPv6/ VPN / SSH port forwarding / more than a single router or subnet)?
    • Are any Custom server access URLs added?
    • Brand and model of the router?

    What did you try so far (be as specific as you can)?

  • doughnetdoughnet Posts: 317Members, Plex Pass Plex Pass

    @kopfpilot said:

    @ipmcc said:
    The NFS requirement is, unfortunately, a requirement of PRT at this point. I've been chin-scratching about how one might work around this, but haven't dug in too deeply yet.

    yep, but you mount the NFS shares on the docker host and mount them inside the containers as volumes (actually mount bind a docker host path to a container path).

    Not sure about docker but why not just use an ftp file system mount like curlftpfs or ssh file system mount like sshfs?

    Speed Test:  http://stage.results.speedtest.comcast.net/result/511584024.png

    Plex Server Remote:  Dual Xeon X5650 (12cores/24threads@2.68GHz), 8GB memory, 240GB Crucial M4 SSD, 3x5TB storage w/ SSD Caching & 1GBit up/down dedicated WAN

    Plex Server Home:  AMD FX 8350 overclocked, 8GB 1866MHZ, 250GB Samsung EVO 840 SSD, 4x4TB Toshiba HDD

    TV: Sony 4K UHD XBR-55X850C

    Plex Clients: Roku 3

    Home PC:  AMD FX 8350 overclocked, 8GB 2166MHZ, RAID10 250GB Samsung 840 EVO & 2TB Seagate SSHD

    iPad Air w/ Plex

    2x iPhone 6 16GB White w/ Plex

  • kopfpilotkopfpilot Posts: 297Members, Plex Pass Plex Pass

    I am mouting my shares using CIFS.
    Use whatever meets your needs :)

    Problems with remote connection?

    • Does the server have a static-ip and is using a wired connection?
    • Is port forwarding activated in your router and matches the port in PMS->Settings->Remote-Access->Manually enter Port
    • Does the external ip (in PMS) match the wan ip (in router) and is the external port accessible (see: www.canyouseeme.org)?
    • Does the plex.web access work using the url http://remote-ip:32400/web (or the port you specified in your router)?
    • Is Secure conection disabled for troubleshoot? If not:does the router support dns rebind protection and is *.plex.direct excluded?
    • Are any special network configurations involved (Jumbo Frames / IPv6/ VPN / SSH port forwarding / more than a single router or subnet)?
    • Are any Custom server access URLs added?
    • Brand and model of the router?

    What did you try so far (be as specific as you can)?

  • dan.franks@gmail.comdan.franks@gmail.com Posts: 10Members, Plex Pass Plex Pass
    edited December 2016

    Sweet! Now we can apply this idea to the official plex docker image.

  • deevusdeevus Posts: 11Members, Plex Pass Plex Pass

    Nothing has been happening in this space so I took the liberty to solve the problem myself: https://github.com/deevus/docker-plex-remote-transcoder

    My work is based off the official plex docker images.

    It is in a working state, as I'm currently running the master on my Synology NAS, with the slave on Ubuntu 16.04. I originally wanted to run my slave in Windows, but Docker for Windows cannot mount network drives yet :(

    I'm looking for contributors to help with documentation and testing. PRs welcome :)

  • deevusdeevus Posts: 11Members, Plex Pass Plex Pass

    Update: I have added a README to the repository.

  • kjenney69kjenney69 Posts: 30Members, Plex Pass Plex Pass

    Good job! I played with it for a little bit and I've got the master and slave working. I'll see if I can find some time to help simplify the SSH process.

  • doughnetdoughnet Posts: 317Members, Plex Pass Plex Pass

    Will the docker version work with multiple slaves communicating with the same master? I.E. four slaves and one master.

    Speed Test:  http://stage.results.speedtest.comcast.net/result/511584024.png

    Plex Server Remote:  Dual Xeon X5650 (12cores/24threads@2.68GHz), 8GB memory, 240GB Crucial M4 SSD, 3x5TB storage w/ SSD Caching & 1GBit up/down dedicated WAN

    Plex Server Home:  AMD FX 8350 overclocked, 8GB 1866MHZ, 250GB Samsung EVO 840 SSD, 4x4TB Toshiba HDD

    TV: Sony 4K UHD XBR-55X850C

    Plex Clients: Roku 3

    Home PC:  AMD FX 8350 overclocked, 8GB 2166MHZ, RAID10 250GB Samsung 840 EVO & 2TB Seagate SSHD

    iPad Air w/ Plex

    2x iPhone 6 16GB White w/ Plex

  • deevusdeevus Posts: 11Members, Plex Pass Plex Pass
    edited December 2016

    @kjenney69 said:
    Good job! I played with it for a little bit and I've got the master and slave working. I'll see if I can find some time to help simplify the SSH process.

    I had the idea that the slaves could register to the master, instead of the other way around.

    1. slave starts up
    2. connect to master via SSH (keys are in /config directory)
    3. call prt add_host and add itself
    4. register itself as known_host using ssh-keygen

    This would support any number of slaves, and the master wouldn't need to know about them when setting up.

    @doughnet said:
    Will the docker version work with multiple slaves communicating with the same master? I.E. four slaves and one master.

    Yep. Under the hood the master is just plex with prt installed. If you docker exec into the container you can run prt add_host yourself.

  • kjenney69kjenney69 Posts: 30Members, Plex Pass Plex Pass
    edited December 2016

    @doughnet said:
    I had the idea that the slaves could register to the master, instead of the other way around.

    Having the slaves register with the master makes the most sense!

    I submitted a Pull Request just now that will remove the requirement to register in known_hosts. So adding a new slave will be a 3 step process that can be automated/started when the container is started.

  • doughnetdoughnet Posts: 317Members, Plex Pass Plex Pass

    @kjenney69 said:

    @doughnet said:
    I had the idea that the slaves could register to the master, instead of the other way around.

    Having the slaves register with the master makes the most sense!

    I submitted a Pull Request just now that will remove the requirement to register in known_hosts. So adding a new slave will be a 3 step process that can be automated/started when the container is started.

    That's awesome. Able to give details on how it does the transcoding:

    Does it split all streams and split transcoding across all slaves?
    Or
    Does it take a single steam and dedicates that to a single slave?

    Speed Test:  http://stage.results.speedtest.comcast.net/result/511584024.png

    Plex Server Remote:  Dual Xeon X5650 (12cores/24threads@2.68GHz), 8GB memory, 240GB Crucial M4 SSD, 3x5TB storage w/ SSD Caching & 1GBit up/down dedicated WAN

    Plex Server Home:  AMD FX 8350 overclocked, 8GB 1866MHZ, 250GB Samsung EVO 840 SSD, 4x4TB Toshiba HDD

    TV: Sony 4K UHD XBR-55X850C

    Plex Clients: Roku 3

    Home PC:  AMD FX 8350 overclocked, 8GB 2166MHZ, RAID10 250GB Samsung 840 EVO & 2TB Seagate SSHD

    iPad Air w/ Plex

    2x iPhone 6 16GB White w/ Plex

  • deevusdeevus Posts: 11Members, Plex Pass Plex Pass

    @doughnet said:

    @kjenney69 said:

    @doughnet said:
    I had the idea that the slaves could register to the master, instead of the other way around.

    Having the slaves register with the master makes the most sense!

    I submitted a Pull Request just now that will remove the requirement to register in known_hosts. So adding a new slave will be a 3 step process that can be automated/started when the container is started.

    That's awesome. Able to give details on how it does the transcoding:

    Does it split all streams and split transcoding across all slaves?
    Or
    Does it take a single steam and dedicates that to a single slave?

    It works exactly the same as Plex Remote Transcoder, except that it's containerized using docker.

  • doughnetdoughnet Posts: 317Members, Plex Pass Plex Pass

    @deevus said:

    @doughnet said:

    @kjenney69 said:

    @doughnet said:
    I had the idea that the slaves could register to the master, instead of the other way around.

    Having the slaves register with the master makes the most sense!

    I submitted a Pull Request just now that will remove the requirement to register in known_hosts. So adding a new slave will be a 3 step process that can be automated/started when the container is started.

    That's awesome. Able to give details on how it does the transcoding:

    Does it split all streams and split transcoding across all slaves?
    Or
    Does it take a single steam and dedicates that to a single slave?

    It works exactly the same as Plex Remote Transcoder, except that it's containerized using docker.

    Thanks but I'm unfamiliar how that works as well.

    Speed Test:  http://stage.results.speedtest.comcast.net/result/511584024.png

    Plex Server Remote:  Dual Xeon X5650 (12cores/24threads@2.68GHz), 8GB memory, 240GB Crucial M4 SSD, 3x5TB storage w/ SSD Caching & 1GBit up/down dedicated WAN

    Plex Server Home:  AMD FX 8350 overclocked, 8GB 1866MHZ, 250GB Samsung EVO 840 SSD, 4x4TB Toshiba HDD

    TV: Sony 4K UHD XBR-55X850C

    Plex Clients: Roku 3

    Home PC:  AMD FX 8350 overclocked, 8GB 2166MHZ, RAID10 250GB Samsung 840 EVO & 2TB Seagate SSHD

    iPad Air w/ Plex

    2x iPhone 6 16GB White w/ Plex

  • kegobeer-plexkegobeer-plex Posts: 5,324Members, Plex Pass, Plex Ninja Plex Ninja

    @doughnet said:
    Thanks but I'm unfamiliar how that works as well.

    In the first post there's a link to the Plex Remote Transcoder thread. That should fill you in on how things work.

    Where are my log files?

    How do I properly name my media files?

    NVIDIA SHIELD SMB/NAS Sharing How-To - / - NVIDIA SHIELD Support Documents

    Plex Server: 1.8.0 running on ThinkServer TS140 w/Server 2012 R2 Essentials
    Primary Plex Player: Shield TV, always the latest beta build, always the latest firmware revision

  • kjenney69kjenney69 Posts: 30Members, Plex Pass Plex Pass

    I'm building out a Vagrant cluster to test slave registration. I'm really interested in an EC2 micro cluster with on-demand transcoding...but that's the next step :)

    P.S. Happy New Year!!!

  • dan.franks@gmail.comdan.franks@gmail.com Posts: 10Members, Plex Pass Plex Pass

    Someone had an on-demand set of scripts that spun up/down PRT slaves at digital ocean. I'll try to find it.

«1
Sign In or Register to comment.