Transcoding (using hw) suddenly doesn't work anymore

Server Version#: 1.27.1.5916
Player Version#: 9.4.1.33413 (Plex app on Samsung S21)

Hey there,

I have plex pass and a Nvidia 1050ti in my server, running on Ubuntu. Hardware transcoding worked perfectly for a very long time. However, it now suddenly doesn’t anymore. Transcoding in general doesn’t work anymore! No hardware, but also software doesn’t work anymore. See the settings here (easier than typing and translating everything over):

I looked into the logs of plex and every time I start a stream that requires transcoding, the stream buffers and then exists. In the logs the following is found:

[Transcode] [FFMPEG] - No VA display found for device 300.
[Transcode] [FFMPEG] - No VA display found for device 300.
[Transcode] [FFMPEG] - No VA display found for device 300.
[Transcode] [FFMPEG] - No VA display found for device 300.
[Transcode] Got a request to stop a transcode session without a valid session GUID.

On my phone, I get the message (translated): Something went wrong. Check your connection and try again.

A display is plugged into the video card. When I play the media (the new doctor strange movie) in a setup that doesn’t need transcoding (4k HEVC, AAC stereo, SRT subs), it plays perfectly fine. When I start streaming with a setup that requires transcoding (4k HEVC, AAC 5.1, ASS subs), it fails. Normally I have an idea and know my way around plex but this time I really don’t know what happened that it suddenly doesn’t work anymore. This problem is not only on my phone, but on every client so it’s not a problem with my phone.

Hopefully you can help! Thanks :slight_smile:

May I have the full DEBUG logs ZIP file which captures this?

It is impossible to diagnose from a snippet.

Yes of course.

  1. I enabled General → Debug logging
  2. Started a stream with the “transcode” setup
  3. It failed
  4. Did Debugging → Download logs and this is the resulting zip file.

Plex Media Server Logs_2022-06-29_18-23-19.zip (540.8 KB)

@Casvt

Would you please disable database trace and run again?

Where do I turn this off?

Forgot how you turned it on ? :wink:

EnableDatabaseTrace=0

I did:

curl -isSLX PUT '{URL}/:/prefs?X-Plex-Token={TOKEN}&EnableDatabaseTrace=0'

Request returned 200 so I think it worked.

I did “the routine” again and this is the result:
Plex Media Server Logs_2022-06-29_20-30-22.zip (1.4 MB)

P.S. I was working on plex_exporter_importer.py to add a new feature where the user can export and import server settings. During my testing, I might’ve accidentally set some (hidden) setting that broke transcoding?

I’m intrigued to learn of EnableDatabaseTrace! Was that suggested during past troubleshooting, or did you find it by poking around?

I don’t think it was disabled - the logs appear to still have database statements. Perhaps Plex must be restarted for it to take effect?

If you view Preferences.xml manually, has the changed setting been saved?

@Casvt

  1. Stop PMS
  2. Add the following to Preferences.xml
EnableDatabaseTrace="0"
  1. Start PMS

Inside Preferences.xml, EnableDatabaseTrace is already set to 0. So I just restarted plex. Then, well…, you know what I did:
Plex Media Server Logs_2022-06-29_21-15-51.zip (1.3 MB)

Go back to Prefences.xml.

Stop Plex
Add LogDebug="1"

Let’s go around the block again.

:taxi:

Plex Media Server Logs_2022-06-29_21-20-30.zip (1.2 MB)

Edit:
In the pref file, these are all the settings that I could find with the word Transcode:

TranscoderH264BackgroundPreset="slower"
TranscoderQuality="2"
TranscoderTempDirectory="/dev/shm"
TranscoderVideoResolutionLimit="1"
TranscoderPhotoFileSizeLimitMiB="1"
TranscoderPruneBuffer="0"
TranscoderH264Options="1"
TranscoderH264OptionsOverride="80"
TranscoderH264Preset="https://app.plex.tv/auth"
TranscoderH264MinimumCRF="0"
TranscoderLogLevel="0" 
TranscoderToneMapping="1"
ABRKeepOldTranscodes="0"
TranscoderThrottleBuffer="120"
TranscodeCountLimit="0"

Now that I’m making a nice list of it, what’s up with the value of TranscoderH264Preset ?? Maybe that’s what making it wrong: there is no “setting” defined for ffmpeg to use when transcoding so it fails? What’s the default value for you and I’ll copy it over…

Have you thought about comparing with a default Preferences.xml?

You could delete yours, so Plex will make a fresh one.

Or stand up another Plex instance in a container, and compare with that.

Maybe?


I agree that setting looks wrong and breaky. I’m wondering if your script has an off-by-one or a failure-to-initialize and has scrambled some settings.

Plex will tell you the defaults and valid options for many settings if you ask it:

curl -s "http://ip.ad.dr.es:32400/:/prefs"

(Add the token as required.)

Also a bit unrelated but still relavant for me:

In the pref file I see the setting VaapiKernelDriver="veryfast" (relating to hw transcoding I think). The value looks a lot like the ffmpeg preset. Does this hidden setting define the preset used for hw transcoding? Because if so, I would like to set it to something like “medium”. I have at max one transcode session at the same time so no need to “spare” my 1050ti with the veryfast preset. Rather have better video quality then…

Didn’t think about that one. Thanks I think I’ll just use that

It works perfectly now but during the coding/testing phase it apparently didn’t at least once and then messed up my config.


Update: I found an “old” vm on my windows computer that I started up with linux + plex on it so I’ll look at that pref file as that one is “clean”.

I am developing a theory here based on observation…

It’s the theory of “incorrect over-management”. :man_shrugging:

I recommend the following:

  1. Stop Plex
  2. COPY the existing Preferences.xml – so you don’t lose the server ID values
  3. Now , REMOVE all those extra micro-managing Transcoder settings (ALL OF THEM)
  4. Start Plex.
  5. Enable HW transcoding only. Do not change anything else.
  6. Test.
1 Like

But I also have the problem that, for example, MachineIdentifier is set to 0. So maybe it’s a better plan to rename the broken pref file, restart plex and thus let it generate a new one and then only copy over the settings that actually are needed (or just do it via the web-ui).

@Casvt

PM sent.

This concept doesn’t really map from how x264 works, with CRF and presets as levers, to how vaapi (Nvidia) has bitrate controls.

Yeah okay that’s true. It was just a thought, no problem.