SOLVED Best practice for Plex Transcoder temporary directory?

Daisuke

Contributor
Joined
Jun 23, 2011
Messages
1,041
All my @truecharts applications run on a software pool on dual SSDs. Ideally, I would like to have the Plex container /tmp directory:
Code:
$ df -ahT /tmp
Filesystem                           Type  Size  Used Avail Use% Mounted on
software/ix-applications/k3s/kubelet zfs   419G   13M  419G   1% /tmp

Set as Transcoder temporary directory into RAM, is this a good practice? How are files cleaned inside Transcoder temporary directory? Thank you.

1670554291719.png
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Plex will manage the files in that directory and doesn't care if they are scrapped on restart.

I run like that in CORE with no issues (actually quite the opposite... transcoding is basically a no-go without it).

I'm not sure I'd want to do that without some kind of limit though... I don't see that option on the screen you're sharing.
 

fenichelar

Dabbler
Joined
Jul 5, 2022
Messages
20
Yes, there’s no limit for memory use, into setting. In my case, I always have 100Gb of free RAM, so I was thinking to do that.
I am pretty sure the memory limit set for the app is applied:

1670609225236.png


1670609146634.png


1670609200294.png
 
Last edited:

Heavy

Explorer
Joined
Aug 12, 2021
Messages
57
@fenichelar is right.

Then all you have to do is change your transcode directory in plex to whatever your emptyDir mount path is:

1670625528325.png



I use this for Plex, Jellyfin, SabNZB(download to ram), and I am sure a few others.
 

Daisuke

Contributor
Joined
Jun 23, 2011
Messages
1,041
Very useful info @fenichelar and @Heavy, thank you!
Code:
$ df -ahT /tmp
Filesystem     Type   Size  Used Avail Use% Mounted on
tmpfs          tmpfs   32G     0   32G   0% /tmp

What size would you recommend for transcoding? I know @sretalla suggested should be the largest file you suppose to transcode, and that memory setting is for the pod, which defaults to 8Gi, so I quadrupled it.

I rebooted the server yesterday and right now all services show using only 8Gi. Does that includes the memory allocated to Kubernetes apps?

1670631649844.png
 
Last edited:

fenichelar

Dabbler
Joined
Jul 5, 2022
Messages
20
@Daisuke The memory is not allocated to the app, it is the maximum that the app is allowed to use.

Given enough time, your ZFS cache will likely grow to 50% of your total memory. So you have 125GB of memory to use for TrueNAS and your apps (VM memory will be taken away from the ZFS cache). The maximum allowed for all apps combined can exceed 125GB if you are confident they won't all use the maximum allowed at the same time.

Starting with 32GB and increasing if needed is probably a good method. If you only have a few other apps and they have low memory requirements, you could go higher. If you have a lot of other apps or apps with high memory requirements, you may want to start lower.
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
I'm hijacking this topic a little bit, please tell me if I need to create my own. I've created a support ticket with the guys over at the TrueCharts Discord but so far no solutions. It seems the Plex App is unable to write files in the transcode directory. First I got this error:

Code:
[Req#5b9/Transcode] Error creating directory "/transcode": Read-only file system

Upon a suggestion from one of the people helping me I created an emptyDir with /transcode as mount point.
1677016281883.png


This removed the "read only filesystem" error. However I'm still not able to play any content that requires transcoding.

It seems the Plex App is able to create subfolders in the /transcode directory because I see a "Transcode/Sessions" folder. But no actual files are created.
1677016490739.png


I see these errors also, but I don't know if they are related.
1677016518086.png


The moment I start up a video file that requires transcoding I get two errors and the video file refuses to play. I just get a loading icon.
1677016558931.png


This is the text
Code:
First error:
Message
[Req#681/Transcode/ffhjvbvmkhjjvws78j1umoft/61f1cd63-37c1-4355-8e08-1381c085f5ba] [vobsub @ 0x7fa39f85d040] Unable to open /transcode/Transcode/Sessions/plex-transcode-ffhjvbvmkhjjvws78j1umoft-61f1cd63-37c1-4355-8e08-1381c085f5ba/temp-0.sub as MPEG subtitles

Second error:
Message
[Req#686/Transcode/ffhjvbvmkhjjvws78j1umoft/61f1cd63-37c1-4355-8e08-1381c085f5ba] /transcode/Transcode/Sessions/plex-transcode-ffhjvbvmkhjjvws78j1umoft-61f1cd63-37c1-4355-8e08-1381c085f5ba/temp-0.idx: No such file or directory

When I set the type to "Memory" instead of "Default" for the /transcode folder I still get the same errors.

Any thoughts on what is going wrong with my Plex App from TrueCharts?
 

Heavy

Explorer
Joined
Aug 12, 2021
Messages
57
@Mannekino

Can you verify that the exact same files you are attempting to transcode work when you are NOT transcoding to ram?
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
No, it doesn't work at all. Both when using "Default" and "Memory" option. The exact same episode of that TV show simply won't play at all. I just see a loading icon.

However, when I try and play an episode of a different TV show that supports Direct Stream it does work. Weirdly enough when I then switch that episode playback to for example 720p HD it does start transcoding and it seems to work. The quality lowers visibly.
 

Heavy

Explorer
Joined
Aug 12, 2021
Messages
57
No, it doesn't work at all. Both when using "Default" and "Memory" option. The exact same episode of that TV show simply won't play at all. I just see a loading icon.

However, when I try and play an episode of a different TV show that supports Direct Stream it does work. Weirdly enough when I then switch that episode playback to for example 720p HD it does start transcoding and it seems to work. The quality lowers visibly.

Direct streams are not being transcoded, which is why those will work.

So, lowering the quality when using ram for transcoding works?

Also, how much ram did you allocate plex?
Maybe you did not allocate enough ram for plex to transcode larger files on, Transcoding at a higher quality will require more ram.
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
Forget about the Ram part please :). That was just a comment from me that I tested that option also.

It's this specific TV show that seems to have problems transcoding, doesn't matter if I put the transcode folder as Default or Memory.

The same shows works perfectly fine on my current production TrueNAS CORE server. But not on my new TrueNAS SCALE server.
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
I have another update. I tried switching to the official Plex App instead of the TrueCharts one. But I have the exact same error when I try to play an episode from that same TV show.
Code:
Message
[Req#339bf/Transcode/6bvzab66lwmc8t6vs3tvff53/c4492c84-e94c-423d-9669-29172051d107] [vobsub @ 0x7fa5d96b8040] Unable to open /transcode/Transcode/Sessions/plex-transcode-6bvzab66lwmc8t6vs3tvff53-c4492c84-e94c-423d-9669-29172051d107/temp-0.sub as MPEG subtitles

Doesn't seem like it's all Transcoding. For example I've tried a couple of other TV shows that have both the ability for Direct Play and another one that needs transcoding and both work.

Here is a directory and a bunch of files that are being created right now as we speak when I'm playing another episode from a different TV show where Direct Play was possible. I switched it to 720p HD High and it's transcoding.

1677022792945.png


1677022799992.png


This is on the new Plex App I've installed from the official repository

1677022837099.png


I don't know why it's showing up as remote either. Perhaps it has something to do with the fact that it is a Docker container and it has a IP not in my LAN range.
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I don't know why it's showing up as remote either. Perhaps it has something to do with the fact that it is a Docker container and it has a IP not in my LAN range.
You should specify your LAN Networks under the server: Settings | Network
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
Yeah I did that. I put 192.168.178.0/24 there. When I manage the server it shows up as "Remote" but when I play a file I see "Local" now weird. But that's not very important. Not being able to play certain Movies and Episodes of TV Shows is important. Still no progress there. It's only episodes of this TV show that is giving me this level of headache. Other stuff is able to transcode.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
It's only episodes of this TV show that is giving me this level of headache. Other stuff is able to transcode.
So, transcoding is working, period. (if you can transcode anything with success, then your transcode location is fine).

What you're experiencing is a codec problem... that show must be encoded differently to your "working" ones... and must be using a codec that's too hard for your system to transcode (either in compute power or lack of codec terms).

Can you manually convert an episode to a common format like m4v/aac with something like handbrake?
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
Is there a command I can run or a program I can load the video file in to get all the meta data such as the type of codec?

The weird thing is, my current TrueNAS CORE server where Plex is running in a Jail has no issues with the same episodes of this TV show. It starts immediately. My new server is way more beefy in terms of specs than my old one.

There is one thing I would like to try but I have to install Plex again from TrueCharts. Hopefully I have time tonight. I'm really curious what will happen when I remove the .sub and .idx file in the folder of an episode. Because the error message I posted here refers to the .idx file.

The only other thing that is different is that the Plex version on my current server is older.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Is there a command I can run or a program I can load the video file in to get all the meta data such as the type of codec?
Go to the show in the web interface and click the 3 dots button...

Get Info
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
I got an update. I removed the .sub and .idx file from the first episode of this TV show. It started playing immidiatly.

Then I tried the second episode which still has those files I get the same error again.

Code:
Message
[Req#1820/Transcode/d66snfp0ecbddtfdbqfpmsef/f36755b6-1d67-4d9e-9d61-8f8c5d19f270] [vobsub @ 0x7f5d0d7e4a00] Unable to open /transcode/Transcode/Sessions/plex-transcode-d66snfp0ecbddtfdbqfpmsef-f36755b6-1d67-4d9e-9d61-8f8c5d19f270/temp-0.sub as MPEG subtitles

Message
[Req#1825/Transcode/d66snfp0ecbddtfdbqfpmsef/f36755b6-1d67-4d9e-9d61-8f8c5d19f270] /transcode/Transcode/Sessions/plex-transcode-d66snfp0ecbddtfdbqfpmsef-f36755b6-1d67-4d9e-9d61-8f8c5d19f270/temp-0.idx: No such file or directory
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
It's probably your subtitle settings then... you probably have the client set to request burning in the subtitles (which implies a transcode action), so removing them would eliminate that action.
 
Top