Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Plex: Guide to Moving Transcoding to RAM

Featured Replies

5 hours ago, SPOautos said:

Since Kodi can direct play them all

Kodi uses the Client's CPU to decode any audio and video stream. Instead Plex uses mainly the media decoding API of the Client. By that Plex works on any low power hardware while Kodi does not.

 

Finally it would be easy. Plex only needs to include different players or allow using external player softwares. There are different feature requests in the forums pointing to this:

https://forums.plex.tv/t/request-update-to-latest-exoplayer-android-firetv-listen-to-your-customers/622086

https://forums.plex.tv/t/feature-request-configuring-external-player-like-mpc-or-vlc-for-pmp-on-windows/312576

 

I think Plex ignores them because Plex can't guarantee judder-free playback as it depends on resolution, hdr/sdr, bitrate, etc if the clients CPU has enough power to play a stream. Instead, the client's API guarantees it and everything that is not supported by the client, will be transcoded. Another reason could be, that they don't want users leaving the Plex UI and including open source players is a problem as Plex is making money with their software which could be disallowed by the open source players.

 

But finally you still have options. You could use Plex as your server and still use Kodi, Infuse, etc as your Player. Those softwares have Plex plugins for that.

 

Or you transcode all your content, so it can be played directly. This is how Netflix & Co solves it.

 

Or you consider using Emby / Jellyfin. They support external playback as far as I know.

  • Replies 472
  • Views 380.4k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • By this guide Plex uses your RAM while transcoding which prevents wearing out your SSD.   Edit the Plex Container and enable the "Advanced View":   Add this to "Extra Paramet

  • Yesterday, I was lazy and set only "/dev/shm/plextranscode" as my transcoding path. I checked the path and it was created: ls /dev/shm plextranscode/   But it stays empty while transcoding

  • Yes it is needed as /transcode will be created, even it is not mapped through the containers settings.   So I will hopefully update my guide for the last time ^^ EDIT: Done.

Posted Images

On 1/2/2021 at 4:46 AM, mgutt said:

That's the reason why you should limit the RAM path to 4 or 8GB. Even your server can crash.

 

Plex uses as much space for the temporary transcoding files as available. This has nothing to do with 4K. The same would happen if multiple clients transcode 1080p streams. Plex preserves so much files so the user is able to jump back on the timeline without the need to re-transcode. But as this is a rare case, you can limit the RAM usage without problems. Plex starts cleaning when there is no space left. In theory you could even limit it to 100MB (don't do it, causes juddering ;) ).

 

I’ve created a 4GB Ramdisk folder for Plex transcoding and it’s working perfectly.  It fills up and then Plex clears it out seamlessly. Thanks again for the reply. 

On 12/14/2020 at 1:03 PM, UnraidDuck said:

Thanks to @Hoopster Reminder to RTFM, I now have Plex transcoding to the RAM disk.

image.thumb.png.39e700294516b702286818dc13d5c67d.png

So I also use Binhex PlexPass container so this image is super helpful! What I am curious about is which script did you end up using as I see two different ones posted in the comments.

 

There's this one...

#!/bin/bash

mkdir /tmp/PlexRamScratch

chmod -R 777 /tmp/PlexRamScratch

mount -t tmpfs -o size=4g tmpfs /tmp/PlexRamScratch

 

And also this one...

#!/bin/bash

mkdir /tmp/PlexRamScratch

mount -t tmpfs -o size=4g tmpfs /tmp/PlexRamScratch

@bilinz I'm using:

 

#!/bin/bash
mkdir /tmp/PlexRamScratch
chmod -R 777 /tmp/PlexRamScratch
mount -t tmpfs -o size=4g tmpfs /tmp/PlexRamScratch

  • 3 weeks later...

So if you limit the ram to only use 4gb, it will delete once it reaches that limit and keep going. The alternative would be once the movie stops playing, it deletes it all at once. Does this sound correct?

 

4 hours ago, dotexe said:

Does this sound correct?

Yes

On 9/19/2020 at 1:22 PM, mgutt said:

New Guide which uses only a limited size of your RAM

I currently came across this and don't know if this was already mentioned here but this would be also achievable with a entry in the template at 'Extra Parameters':

 

--mount type=tmpfs,destination=/tmp,tmpfs-size=4000000000

image.png.9624a396f2b9e442f03ebb18135ef02c.png

 

In the above example a RAMdisk is created with a limit of 4GB (the size has to be defined in bytes).

The screenshot has the destination down as /transcoding, is that a typo in the text with

Quote

--mount type=tmpfs,destination=/transc,tmpfs-size=4000000000

?

8 minutes ago, ich777 said:

--mount type=tmpfs

 

It should be:

--mount type=tmpfs,destination=/transcode,tmpfs-size=4000000000

 

As /transcode is the default transcode path of Plex:

280215101_2021-02-0111_27_13.png.b5ded746a154fbc2e4e5bff080c64db5.png

 

This is really nice as it makes it even easier as this tmpfs path only exists inside of the Plex Container. I will update my Guide. Thank you!

 

1 hour ago, UnraidDuck said:

The screenshot has the destination down as /transcoding, is that a typo in the text with

?

Sorry my bad... :P

 

EDIT: Corrected it in my post but that shouldn't matter this describes only the path in the container itself whether it's '/transc', '/transcode', '/transcoding', '/mnt/transcoding' or whatever you want. Just be sure to set the transcoding path in your App (Plex, Emby, Jellyfin,...) to the corresponding path that you defined in the 'Extra Parameters'.

may consider add :rw

 

--mount type=tmpfs,destination=/transcoding:rw,tmpfs-size=4000000000

 

otherwise plex wont write into the mount (at least here ...)

 

ok, well, here it falls back and writes then into /tmp/transcode inside docker which ends up in filling up docker image, nevermind, was just taking a look if it simply works (as i expected too) but fails here.

 

ok, reverted and now it works ... dont ask me why

Edited by alturismo

12 minutes ago, alturismo said:

ok, reverted and now it works ... dont ask me why

If the transcode dir physically exists in the container, then this can happen. One user accidentally mapped his movies to /transcode/Movies and since then he was not able to map /transcode as a tmpfs path. Even after he corrected the wrong mapping, he was still not able to use /transcode. I think a fresh Plex installation would solve it (or an update?!). Not sure. But the solution was to use /transcode2 as the tmpfs path and changing this path in the Plex settings accordingly. 

i found the point more or less, i guess the restart (with existing /transcode) fails then to use it

yes, confirmed, as i use a script to fix hevc tone mapping for hw transcoding on plex which will end up restarting the docker, after a restart the permissions are messed ... chmod /transcode and its good again

 

so it works when u dont restart the docker .... at least thats my current state

 

and as plex also only needs a restart on updates its not the best choice (yet)

Edited by alturismo

@alturismo & @mgutt you can also append permissions to the mounted folder like:

 

--mount type=tmpfs,destination=/transcode,tmpfs-mode=1777,tmpfs-size=4000000000

 

This should set the permissions on every start of the container.

 

EDIT: Should be a little bit more precise, this sets to permissions:

tmpfs-mode=1777

 

 

50 minutes ago, ich777 said:

this sets to permissions:

 

Tested this. After setting it the first time it works. But after stopping / starting the container it writes to /tmp/Transcode.

 

Then changed to 700. Same game.

 

Then changed to 0770. Same game.

 

Result after setting 0770 and first start:

755 drwxr-xr-x   3 plex users   60 Feb  1 14:36 transcode

 

Result after stop / start:

755 drwxr-xr-x   2 root root    40 Feb  1 14:37 transcode

 

Executing this inside the container and it works again:

chown 99:100 /transcode

 

Another solution:

Edit the container, change nothing and hit apply (which re-creates the container). 

 

So stop / start and restart does not set the owner. And now?

 

EDIT: Seems to be a bug:

https://github.com/docker/for-linux/issues/138

 

 

 

2 minutes ago, mgutt said:

Then changed to 700. Same game.

This defaults to 1700.

 

Forgot to link the source: Click

 

Then this is possibly not usable for Plex, I run it in Emby without a problem, have to investigate further.

yes, but not really a solution when u need to run a script after docker run ;) and restart, but im glad im not alone ...

 

same goes for any docker like emby too it seems ... at least after tests here

 

and i would say, this would also hit in when u just restart the server (which in the end restarts dockers too)

@ich777 in emby, ffmpeg transcode logs before and after restarting docker

 

before

-segment_list "/transcode/transcoding-temp/95499A.m3u8"

after restarting docker

-segment_list "/config/transcoding-temp/BDAC04.m3u8"

 

of course the segmented files also come in there ...

Edited by alturismo
wrong copy / paste ;)

@alturismo & @mgutt

 

I now have a working solution.

Put this into your 'Extra Parameters':

--mount type=tmpfs,destination=/tmp,tmpfs-size=4000000000

 

Then go to your Plex transcoding settings and set the path to '/tmp':

grafik.png.7b7094bbabd5991869740b0d8f56ed1b.png

 

Tested this after 5 restarts and the permissions for '/tmp' are always:

 

After the first start:

drwxrwxrwt   4 root root    80 Feb  1 15:36 tmp

 

After a restart:

drwxrwxrwt   3 root root    60 Feb  1 15:37 tmp

 

After the fifth restart:

drwxrwxrwt   3 root root    60 Feb  1 15:39 tmp

 

 

Hope that helps ;)

32 minutes ago, ich777 said:

Then go to your Plex transcoding settings and set the path to '/tmp':

 

Is it needed? As /transcode does not exists, it should fallback to /tmp automatically.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.