mgutt Posted January 5, 2021 Share Posted January 5, 2021 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. Quote Link to comment
Andiroo2 Posted January 10, 2021 Share Posted January 10, 2021 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. 1 Quote Link to comment
bilinz Posted January 15, 2021 Share Posted January 15, 2021 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. 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 Quote Link to comment
DiscDuck Posted January 15, 2021 Share Posted January 15, 2021 @bilinz I'm using: #!/bin/bash mkdir /tmp/PlexRamScratch chmod -R 777 /tmp/PlexRamScratch mount -t tmpfs -o size=4g tmpfs /tmp/PlexRamScratch 1 Quote Link to comment
dotexe Posted February 1, 2021 Share Posted February 1, 2021 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? Quote Link to comment
mgutt Posted February 1, 2021 Share Posted February 1, 2021 4 hours ago, dotexe said: Does this sound correct? Yes Quote Link to comment
ich777 Posted February 1, 2021 Share Posted February 1, 2021 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 In the above example a RAMdisk is created with a limit of 4GB (the size has to be defined in bytes). Quote Link to comment
DiscDuck Posted February 1, 2021 Share Posted February 1, 2021 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 ? Quote Link to comment
mgutt Posted February 1, 2021 Share Posted February 1, 2021 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: 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! 2 Quote Link to comment
mgutt Posted February 1, 2021 Share Posted February 1, 2021 @jonp It would be nice if you could update your first post as follows: https://forums.unraid.net/topic/35878-plex-guide-to-moving-transcoding-to-ram/?do=findComment&comment=894460 It contains the improvement of @ich777 which makes the guide even easier for the user. Using "/tmp" as mentioned in your post is dangerous as an unlimited RAM usage will probably cause server crashes. 2 Quote Link to comment
ich777 Posted February 1, 2021 Share Posted February 1, 2021 1 hour ago, UnraidDuck said: The screenshot has the destination down as /transcoding, is that a typo in the text with ? Sorry my bad... 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'. Quote Link to comment
alturismo Posted February 1, 2021 Share Posted February 1, 2021 may consider add :rw --mount type=tmpfs,destination=/transcoding:rw,tmpfs-size=4000000000 otherwise plex wont write into the mount (at least here ...) Quote Link to comment
mgutt Posted February 1, 2021 Share Posted February 1, 2021 2 minutes ago, alturismo said: otherwise plex wont write into the mount (at least here ...) Is not needed as rw is the default: https://docs.docker.com/storage/volumes/ Quote Link to comment
alturismo Posted February 1, 2021 Share Posted February 1, 2021 (edited) 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 February 1, 2021 by alturismo Quote Link to comment
mgutt Posted February 1, 2021 Share Posted February 1, 2021 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. Quote Link to comment
alturismo Posted February 1, 2021 Share Posted February 1, 2021 i found the point more or less, i guess the restart (with existing /transcode) fails then to use it Quote Link to comment
alturismo Posted February 1, 2021 Share Posted February 1, 2021 (edited) 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 February 1, 2021 by alturismo Quote Link to comment
ich777 Posted February 1, 2021 Share Posted February 1, 2021 @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 1 Quote Link to comment
mgutt Posted February 1, 2021 Share Posted February 1, 2021 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 Quote Link to comment
ich777 Posted February 1, 2021 Share Posted February 1, 2021 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. Quote Link to comment
alturismo Posted February 1, 2021 Share Posted February 1, 2021 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) Quote Link to comment
alturismo Posted February 1, 2021 Share Posted February 1, 2021 (edited) @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 February 1, 2021 by alturismo wrong copy / paste ;) Quote Link to comment
ich777 Posted February 1, 2021 Share Posted February 1, 2021 @alturismo & @mgutt actually there is a issue open on Github: https://github.com/opencontainers/runc/issues/1647 Quote Link to comment
ich777 Posted February 1, 2021 Share Posted February 1, 2021 @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': 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 1 1 Quote Link to comment
mgutt Posted February 1, 2021 Share Posted February 1, 2021 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. Quote Link to comment
Recommended Posts
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.