[Release] UnicornTranscoder, create a Plex Transcoding Cluster

Windows isn’t supported and it’s not planned in our roadmap but feel free to fork and support it😉

Keep up the good work!

1 Like

I’ve got a docker build of this that I’m currently working on so then you can just run run this in Docker on Windows which might also be another option rather than forking the project totally.

Just trying to iron a few bugs out with the transcoder currently then I’ll push up my code.

4 Likes

Nice! I’m so excited to use Docker to debug it easier :grin:

Thank you! I’ll go ahead an provision a secondary plex dev server for testing!

This is an awesome project and just what I’m looking for.
I run an Airbnb with 4 private rooms, each one with a Raspberry Pi running Plex on Libreelec. They are being served by an ageing laptop running Plex Media Server on Ubuntu 18.04 LTS, which is pulling video files from my Synology NAS.

The issue is that when all 4 rooms are trying to transcode, then PMS starts to choke.
I’m thinking of replacing the laptop with another Raspberry Pi to act as the main PMS, then have the RPI’s in the rooms use this project to help out with the transcoding.

So if you would be so kind to answer these questions?

  1. Can this project be run on a Raspberry Pi?
  2. If so, what is the minimum SD Card size required to be able to handle the transcode? The largest movies in my collection are around 40-50 GB, so would a 128GB SD Card suffice?

Hello,

Yes the project can run on Raspberry Pi but it’s not the best solution, the goal of this project is to use multiple servers for transcode videos and Raspberry Pi have really poor performance for that :sweat_smile:

Understandable. But I was thinking that if each Pi can handle just 1 transcode, then having a pool of 4 of them should be enough to suffice the requirements of all the Airbnb rooms? I’m thinking of having each rooms raspberry pi be part of the pool, so they would be part Plex client, part Plex transcoder. Do you think I should go down this rabbit hole? :slight_smile:

1 Like

I’m not sure of the result, it could work but I’m not sure about performance

I think you will have a bad result, when you start to transcoding, you rely on Plex Transcoder that is basically a tunned FFMPEG. The h264 encoder of FFMPEG is libx264, and the implementation is in assembler. The ARM version of libx264 is not well optimized so you will loose some performance just because Rasberry PI have an ARM CPU. Also the installer is made to work on x86_64 Linux, if you want to run UnicornTranscoder on Raspbery PI, you will have to find a version of Plex Transcoder that run on ARM Linux.

It is time for the Plex 1.15.x support!
You can update your Plex to 1.15.2 and update your transcoders with UnicornTranscoder 2.1.0 :wink:

CHANGELOG:

  • Support music transcode
  • Support Plex 1.15.2
  • Add debug option
3 Likes

Got a dev environment all setup and everything’s working. Would you guys be open to adding a repo in your org for apache? I have a working reverse proxy config I’d like to share, and have others contribute to.
Thanks!

1 Like

Of course we can :slight_smile:

Make a Pull Request on this repository:

Apologies if I’m missing something. It looks like the repo isn’t initialized, so I can’t fork or pull request.

1 Like

My fault, it’s fixed :sweat_smile:

We are back! With good news! :ok_hand:

The 2.2.0 pre-release is now available, this version supports “Media Optimizer” and “Sync” features :grin:

Update to 2.2.0

You need to update your LoadBalancer, the fake “Plex Transcoder” and your transcoders , don’t forget to type npm i to install new required dependencies :ok_hand:

https://github.com/UnicornTranscoder/UnicornLoadBalancer/releases/tag/2.2.0

Report bugs

It’s a pre-release version, some bugs can happend, if you have some bug please report it on Github (or here)

To report bugs:

1 Like

Time for UnicornTranscoder 2.2.1

This release supports Plex 1.15.3

Update notes

  • Shutdown your transcoder
  • Pull the 2.2.1 version
  • npm i
  • npm run install
  • restart

After a few days of troubleshooting and trying to get this to work I’ve finally figured it out so I hope this may help someone.
I followed the install guides from the GitHub: https://github.com/UnicornTranscoder/UnicornTranscoder

But it didn’t make complete sense. My test was done with 2 cloud servers from Hetzner, so no local internal network. I also wasn’t using any Nginx or Apache proxy, nor was I using a URL, I wanted to test with pure IP configs. I first installed node.js, npm, Plex, then UnicornFFMPEG, then UnicornLoadBalancer on the same system. I then installed the node.js, npm, then UnicornTranscoder on a different system. After these were installed I had a hard time determining the exact syntax required in the config.js files, so here are my examples:

UnicornFFMPEG:
URL: process.env.LB_URL || ‘http://127.0.0.1:3001/
(I tested if you actually needed the ending “/” and you don’t but left it since it was in the install guide)

UnicornLoadBalancer:
This config file is actually located in the “src” directory, the install guide doesn’t state this.
port: env.int(‘SERVER_PORT’, 3001),
public: env.string(‘SERVER_PUBLIC’, ‘http://x.x.x.x:3001/’),
host: env.string(‘SERVER_HOST’, ‘127.0.0.1’)
x.x.x.x is the IP of your UnicornLoadBalancer public IP.
Note: the ending “/” IS required in the public: env.string.
Then near the bottom put your TranscodingServer under:
servers: {
list: env.array(‘CUSTOM_SERVERS_LIST’, ‘string’, [‘http://y.y.y.y:3000’])
y.y.y.y is the IP of your UnicornTranscoder system.
Note: the ending “/” is NOT required and will work either way. The document doesn’t indicate that single quotes are required around the IP in the brackets. I test with and without the brackets and it still worked.

UnicornTranscoder:
loadbalancer_address: env.string(‘LOADBALANCER_ADDRESS’, ‘http://x.x.x.x:3001’),
ping_frequency: env.int (‘PING_FREQUENCY’, 10),
instance_address: env.string(‘INSTANCE_ADDRESS’, ‘http://y.y.y.y:3000’),
x.x.x.x is the IP of the UnicornLoadBalancer
y.y.y.y is the IP of the UnicornTranscoder.
Note: Do NOT use the ending “/” on either IP, it will fail. The install guide uses an example of hostnames and not IPs so was a tad confusing.
You also need to run “npm start”, this is also not indicated in the installation guide.

In your Plex Network settings you will want to set the Custom Server Access URL to the UnicornLoadBalancer IP with port, ex.: http://x.x.x.x:3001

The guide recommends blocking port 32400 but it is not required for this to successfully work as long as you configure the Custom Server Access URL and access the Plex server directly at: http://x.x.x.x:3001
At the moment I haven’t been able to get Plex Remote Access to work properly, but accessing the Plex server using the custom URL works fine.

I hope this helps and now that it’s working it’s pretty awesome.

I’ve tried the docker and kube-plex with not much success and they’re outdated. Once thing they did require was mapped drives but UnicornTranscoder does not, you only need to have the Plex media where your Plex server is. My test was done with a Google Drive and using rclone to mount on the Plex server only and it successfully streamed to the Transcoder on a different system with no media mapped.

2 Likes

Great guide. Very useful. Thanks!

Thanks for the detailed guide, we will improve our documentation with your feedback

UnicornFFMPEG:
I updated the README, the url MUST contain a slash at the end.

UnicornLoadBalancer:
The problem here is you edited the configuration file, it’s explained in the README you can use ENV values to configure all the fields, it’s easier for production setup and updates :wink:

All values are explained, “slash” requirements are in the README, I don’t know what we can do to improve that…

CUSTOM_SERVERS_LIST value is useless in 99.9% of case, the default value is perfect for your setup.
If it’s not defined, each transcoder will register itself during its first exchange with the LB (but you can’t launch any streams until at least one transcoder is registered, it can take few seconds, 10 by default). It’s only useful when you don’t want any (10 seconds) downtime during LB updates…

UnicornTranscoder:
We will update the documentation with slash issues and npm start, it’s not clear, we will fix, sorry for that.

It’s necessary to drop 32400 port, it can work without, but it’s not recommended because when you setup a custom port/url, Plex will add a new url for your server in its list, if when a Plex app ping the server and it take too much time, it will fallback on the 32400 port and all the streams will fail… So please drop the port :slight_smile:

You can mount your files on each transcoder if you prefer, just set the CUSTOM_DOWNLOAD_FORWARD value in the LB :slight_smile:

1 Like