Transcode buffering when hardware acceleration is enabled

Server Version#: 1.21.3.4014
Player Version#: Any - impacts all players

Hi everyone. I have a Synology DS918+ and am struggling to play Standard 1080p video with H264 encoding when hardware acceleration is enabled AND subtitles are also enabled (when they have to be burned in).

I’ve taken a look at the CPU utilization with hardware acceleration and it only caps around ~40 some percent according to the graph on the Plex interface. Nonetheless, the transcoding “Speed” indicator drops from about 1.5 to around .7-.9 when I enable subtitles.

If I entirely turn off hardware acceleration my CPU utilization is near capped at ~95% however I can at least play a single video smoothly when closed captions are enabled without buffering.

Given hardware acceleration drops my utilization substantially, it’s incredibly frustrating that it somehow winds up with a worse performance. Why would turning off hardware acceleration result in higher CPU utilization but better transcoding performance?

I found threads like the below where others have the same issue and many turn off all hardware acceleration as a workaround - pretty poor solution if text-based subtitles are not available (like for live TV)

Your CPU is not powerful enough to burn in subtitles.

Hardware transcoding only works for the Video track.
Subtitle tracks are separate.

What’s difficult to see from a CPU utilization plot is what happens

When HW transcoding is enabled and active + subtitles are being burned:

  1. HW is used to decode the image
  2. The CPU then overlays (burns in) the text for each video frame as it’s decoded.
  3. HW is then again invoked to encode the combined image to send out
  4. Send out the resultant frame

This is different than without subtitles:

  1. HW decode with direct HW re-encode to target bitrate (single operation)
  2. Send out the resultant frame

So not to be argumentative, but why does everything work fine when ONLY using the CPU with no acceleration? What am I not grasping? Why does it only stutter with acceleration? Shouldn’t that rule out that my CPU isn’t fast enough?

I have exactly the same problem with my DS920+.
I have problem with DTS sound as my new LG Oled CX doesn’t support it and Plex needs to transcode it. It does it smoothly when no subtitles are chosen. When I switch on SRT (external) subtitles it momentarily starts buffering and video freezes every 30 seconds or so - only with HW transcoding. Without HW transcoding - movie plays smoothly but Synology procesor goes to 95-98%.
SRT subtitles with any other movie without DTS sound - everything is OK.
In a few days (right now I’m out of home) I will create new thread for this problem with logs and everything but wanted you to know you are not alone with your problem.

May I have the DEBUG log files please which capture this?

I want to see what’s happening. I’m apparently not understanding something.
The Log files ZIP will show me what’s happening.

Please do the following:

  1. Settings - Server - General - Show Advanced
  2. Verify DEBUG logging ON
  3. Verify VERBOSE logging OFF
  4. Click SAVE if either option changed.
  5. Now recreate the problem (up to 2 minutes of playback time is enough)
  6. Stop playback
  7. Wait 20 seconds for the logs to flush to the disk
  8. Download the logfiles (a ZIP file)
  9. Attach that ZIP file here for me to review.

Hi All

Today I wanted to make tests you mentiond.
But also today I installed 500GB Samsung 970EVO M.2 as SSD cache (only 1 slot, so it’s in read-only cache mode). I bought this SSD for another purpose but decided to try it as additional cache for DS920+.
And the problem disappeared. HW transcoding works like a charm, it transcodes HD (1080p) movie with DTS sound and subtitles enabled on the fly without any buffering, CPU stays around 20%.
I’m a little affraid to remove the SSD to check if it comes back to previous state but I can do it if you insist.
I don’t have previous logs but when HW transcoding was ON, I was able to observe in Plex console info/warning like on attached pictures. Those warnings didn’t appear when HW transcoding was OFF.

A Read-only cache does help. It doesn’t help as much as a Read-Write but it definitely helps. It’s biggest benefit will be with the DB

It increases the perceived i/o operations per second (IOPS) of the drives.
(Drives are read 1 time to put into the SSD; SSD is read many times with zero latency)

Do you think I might use smaller SSD? As I can see only aroud 600MB is being used:

Synology will slowly grow into the cache. I have a 1TB cache. It takes a few days for me, even with all that I do, to utilize all of it.

It’s impossible to play a transcoded stream with subtitles on LG TV app if you have a NAS with low power CPU.

Yeah, I can see now it’s over 10GB and growing…
I’ve just bought second ssd and will star tests soon :wink:

Thanks a lot for your support!

Hi

Guess what happened - before installing the second SSD to have write/read SSD cache I removed the first SSD cache and uninstalled SSD disk from my Syno just to check if it shows problems as before - and HW transcoding with enabled subtitles still works flawlessly. I mean H264 + DTS + SRT subs = very smooth play, no buffering. Dashboard still shows HW encoding, Syno processor gets at maximum 20%.
I don’t understand it, I haven’t changed anything in my Plex configuration, Syno was restarted before and it didn’t help with HW transcoding / buffering problems.
Nevertheless - for now my problem is gone and I can use my SSD for the purpose I bought it :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.