Bad performance transcoding when playing on samsung TV

Server Version#: 1.32.5.7349 (on CentOS stream 8)
Server Hardware#: intel NUC i5 with vaapi working
PlexPass# yes, with hardware transcode enabled.
Player Version#: 5.65.2 (on tizen 5.5)
Player Version# 4.112.0 (plex web)

Problem:
Some videos need to be transcoded (specially when image subtitles are selected) and no matter what resolution I set the video, it stops and buffer for 5-10seconds and then resume playing for 30secons and stops again and start buffering again. (imposible to watch a movie this way)

At first I just thought the server doesn’t have enoght capacity to encode the videos, so I let it go.

But yesterday I was making some test and monitoring the server with htop and nvtop, iotop, iftop (to check cpu, gpu, hard disk and network load to find out where is the bottleneck)

I picked up a movie to do the test, a 4k hdr10 , AAC 5.1 audio. and srt subtitle

it worked flawesly with direct play on several samsung tvs (pre tizen, tizen 5.5 and newer).
but when I choose transcode to 10mbps 1080p the problem of buffering strikes again.

I made the exactly same test on my web player (from the app.plex.tv website), on the same local network, same movie, same srt subtitle, same settings (even encoding to 30mbps 4k) and it worked perfectly on each test.

So, what the monitoring showed?.

When using the web player, very low to non CPU usage, same IOPS, same network, and GPU usage 80-100%

when using the player on the TV, the GPU only uses 15-25% of its capacity, and all the CPUs at full.

Lucky shot, I disabled the subtitles on the TV player, and it worked just like the web player (perfectly)

So I find out the problem. the transcoder are not using hardware when the TV player has subtitles selected (I tried with srt, pgs and ass).

But!, there is always a but, as you already guessed by reading this poorly redacted thread, I need subtitles because I don’t speak english and I like the movies with it’s original audio.

So finally… my question is, why can’t use hardware trancode when subtitles are selected?

and why it works if the subtitle are .srt on the web player but not on the TV player?

thank you very much!

Plex is burning the subtitles into the video stream. The video is transcoded using the GPU, but the CPU must be used to add the subtitles into the video stream… The CPU is not powerful enough to perform the task in real time, which is why the video buffers.

Plex Web is very limited. It supports SRT, but not other formats. You should use Plex Desktop instead, as it will direct play almost all video/audio/subtitle formats (documentation, download).

The Plex Smart TV apps (Samsung, LG, etc) are limited by the TV’s capabilities. If the audio and video are direct playing, you should be able to enable PGS or SRT subtitles without needing to transcode (not sure about SSA/ASS). If you are transcoding for any reason, such as an unsupported audio format or to fit under a bandwidth limit, then expect that the subtitle burning may be required.

If you cannot avoid subtitle burning on the Samsung, then consider using a different Plex client, such as an Android TV device (Nvidia Shield Pro, Amazon FireStick 4K, etc). Plex Android TV clients direct play PGS & SRT subtitles even if the video or audio is transcoding.

1 Like

Wow that was fast answer and very clear.

there is a way to use GPU to add the subtitles?

thank you FordGuy.

Unfortunately not. That would be very, very nice.

I’ve an LG TV, which has limitations similar to the Samsung. I got tired of fighting with it and purchased a Shield Pro a few years ago. The Shield direct plays everything I throw at it.

1 Like

I choosed samsung because the plex app works pretty well (I use to have an old LG tv and plex was useless), also I use plex in many places, I have 2 plex servers, but at least 5 TVs, so, getting an android tv device for each one is not very practical.

I guess I have to find a mini pc powerful enough to reinstall my plex server.

@yakko

This would work for you.

You might want to change the SSD before installing Linux but an i7-8xxx is a good CPU.

1 Like

almost twice as mine in the cpu passmark (3950 vs 6295), but far from the recommended by plex

  • 4K HDR (50Mbps, 10-bit HEVC) file: 17000 PassMark score (being transcoded to 10Mbps 1080p)

I was looking for a capable mini pc, but I didn’t find any with the recommended performance by plex.

maybe I’ll buy that one you recommend and give it a shot.

thank you again!

---- edited ----

I am the one who calculated those numbers.

  1. 17.000 passmarks is for HEVC HDR in Software
  2. The i7-8xxx series can push about 750 Mbps (input) for HW transcoding.
  3. When dealing with Subtitle burning and audio conversion, yes you do want CPU passmarks.
  4. The i7-7700 (a plain KabyLake) can deliver 600 Mbps HW transcode and 3 simultaneous sub-title burning w/ audio conversion.

BE CAREFUL of raw passmark numbers.

https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i5-1340P&id=5237

  1. 21138 passmarks is nice – HOWEVER
  2. It has 12 cores
  3. Speed per core (which is what you need when burning subtitles)
    21138 / 12 = 1761 Passmarks. NOT GOOD

Now compare with an older i7-7700

https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i7-7700+%40+3.60GHz&id=2905

  • 8657 Passmarks / 4 cores = 2164 Passmarks per core . Works far better.

As prime comparison. I have a ā€œhonkingā€ Xeon E5-2690 v4
https://www.cpubenchmark.net/cpu.php?cpu=Intel+Xeon+E5-2690+v4+%40+2.60GHz

19905 Passmarks / 14 cores = 1421 Passmarks per core
This thing is so slow per-core that I cannot burn subtitles in real time on 4K media.

Idea is > 2500 passmarks per core w/ HW transcoding.

1 Like

wow! the level of this forum is off the charts!

guys you are the best!

I’ll edit my last post to avoid missleading someone who’s looking for capable hardware.

update:

I bought the exact same nuc of that link.

I’m testing it now and it has the exact same performance issue :frowning: with the same instalation (I just migrate the hard drive) and I’m testing the same movie, same tv, same configs.

I’m very disappointed.

also I bought an android tv device, it’s wonderful! (I canĀ“t believe it costs just 30usd and performs like that!)

Logs ?

I want to see what is happening because I know it will do the job.

  1. Confirm DEBUG logging is enabled. SAVE if you make changes
  2. Start the playback
  3. Let it play for 30 seconds
  4. Stop Playback
  5. Download the logs ZIP file
  6. Attach the ZIP

I have this:

root@BabyNUC:~# uname -a
Linux BabyNUC 6.1.49-Unraid #1 SMP PREEMPT_DYNAMIC Wed Aug 30 09:42:35 PDT 2023 x86_64 Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz GenuineIntel GNU/Linux
root@BabyNUC:~# cat /proc/cpuinfo | grep 'model name'  | uniq
model name      : Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz
root@BabyNUC:~# 

and this:

[chuck@lizum plex.2001]$ cat /proc/cpuinfo | grep 'model name' | uniq
model name	: Intel(R) Core(TM) i7-8809G CPU @ 3.10GHz
[chuck@lizum plex.2002]$

and don’t have issues.

IT IS POSSIBLE you’re experiencing the known regression in PMS with the subtitle fix. If that’s the case, I will give you a version to use.

Plex Media Server Logs_2023-09-07_00-49-18.zip (574.5 KB)

there!

I always have my plexmediaserver updated to the last version. (I have versionitis!)

I can see where:

  1. Subtitles are in the file
  2. It’s going to burn the subtitles (ā€˜not using zero-copy because burning’)
  3. HW transcoding is enabled ā€˜vaapi’
  4. Tonemapping is enabled. ā€˜mobius’
Sep 07, 2023 00:48:30.899 [140010733607736] DEBUG - [Req#4ee1/Transcode] Starting a transcode session w1a7o9krucgocurc6yob3mla at offset -1.0 (state=3)
Sep 07, 2023 00:48:30.899 [140010733607736] DEBUG - [Req#4ee1/Transcode] TPU: hardware transcoding: using hardware decode accelerator vaapi
Sep 07, 2023 00:48:30.899 [140010733607736] DEBUG - [Req#4ee1/Transcode] TPU: hardware transcoding: zero-copy support present
Sep 07, 2023 00:48:30.899 [140010733607736] DEBUG - [Req#4ee1/Transcode] TPU: hardware transcoding: not using zero-copy because subtitle burning is required
Sep 07, 2023 00:48:30.899 [140010733607736] DEBUG - [Req#4ee1/Transcode] [Universal] Using local file path instead of URL: /storage/Movies/Ghost.in.the.Shell.2017.4K.HDR.2160p.BDRip Ita Eng x265-NAHOM/Ghost.in.the.Shell.2017.4K.HDR.2160p.BDRip Ita Eng x265-NAHOM.mkv
Sep 07, 2023 00:48:30.899 [140010733607736] DEBUG - [Req#4ee1/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (UHD Graphics 620)
Sep 07, 2023 00:48:30.900 [140010733607736] INFO - [Req#4ee1/Transcode] Preparing driver imd for GPU UHD Graphics 620
Sep 07, 2023 00:48:30.900 [140010733607736] DEBUG - [Req#4ee1/Transcode/DriverDL/imd] Skipping download; already exists
Sep 07, 2023 00:48:30.900 [140010733607736] DEBUG - [Req#4ee1/Transcode] TPU: hardware transcoding: final decoder: vaapi, final encoder: vaapi
Sep 07, 2023 00:48:30.900 [140010733607736] DEBUG - [Req#4ee1/Transcode/JobRunner] Job running: FFMPEG_EXTERNAL_LIBS='/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/8217c1c-4578-linux-x86_64/' LIBVA_DRIVERS_PATH="/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/va-dri-linux-x86_64" X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "/usr/lib/plexmediaserver/Plex Transcoder" -codec:0 hevc -hwaccel:0 vaapi -hwaccel_fallback_threshold:0 10 -hwaccel_device:0 vaapi -analyzeduration 20000000 -probesize 20000000 -i "/storage/Movies/Ghost.in.the.Shell.2017.4K.HDR.2160p.BDRip Ita Eng x265-NAHOM/Ghost.in.the.Shell.2017.4K.HDR.2160p.BDRip Ita Eng x265-NAHOM.mkv" -filter_complex "[0:4]scale=3840:2160[0];[0:0][0]overlay[1];[1]scale=w=1920:h=1080:force_divisible_by=4[2];[2]format=p010,tonemap=mobius[3];[3]format=pix_fmts=nv12[4];[4]hwupload[5]" -map "[5]" -codec:0 h264_vaapi -b:0 6754k -maxrate:0 9006k -bufsize:0 18012k -r:0 23.975999999999999 -force_key_frames:0 "expr:gte(t,n_forced*1)" -map 0:8 -metadata:s:1 language=eng -codec:1 copy -copypriorss:1 0 -f dash -seg_duration 1 -dash_segment_type mp4 -init_seg_name 'init-stream$RepresentationID$.m4s' -media_seg_name 'chunk-stream$RepresentationID$-$Number%05d$.m4s' -window_size 5 -delete_removed false -skip_to_segment 1 -time_delta 0.0625 -manifest_name "http://127.0.0.1:32400/video/:/transcode/session/w1a7o9krucgocurc6yob3mla/b55c9bfa-3949-4eaa-879c-7284f3b1a3e2/manifest?X-Plex-Http-Pipeline=infinite" -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 dash -start_at_zero -copyts -vsync cfr -init_hw_device vaapi=vaapi:/dev/dri/renderD128 -filter_hw_device vaapi -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://127.0.0.1:32400/video/:/transcode/session/w1a7o9krucgocurc6yob3mla/b55c9bfa-3949-4eaa-879c-7284f3b1a3e2/progress
Sep 07, 2023 00:48:30.900 [140010733607736] DEBUG - [Req#4ee1/Transcode/Jo

Is the TV connected by ethernet or WiFi ? (Ethernet is only 100 Mbps. Wifi is usually gigabit)

If you wish, try this.

  1. if the subtitle is in .srt file the behavior is the same.
  2. if I disable the subtitle it works flawesly
  3. yep, enabled and working
  4. also true, and working

my tv is connected to a wifi 5ghz with good signal strength

speedtest shows 400mbps (to wan) and my PMS is local.

I’ll be happy to test anything you send me, but I use CentOS, not debian based.

thank you!

is this one?

https://downloads.plex.tv/plex-media-server-new/1.31.3.6868-28fc46b27/redhat/plexmediaserver-1.31.3.6868-28fc46b27.x86_64.rpm

I tried several releases but the behavior is the same.

1.31.3.6868 is the best one to use.

An i7-8xxx is more than enough CPU for this.

What else do you have running on the box – or otherwise limiting the CPU from burning ? Is this in a VM ?

SRT subtitles are sent as a parallel stream (whether embedded or not).
Is the player set to ā€œAlways burnā€? It should be set to automatic. Even a Samsung can play SRT

nothing else run on this nuc

the sub burning is always set in ā€œautoā€

Can you get me a big enough sample of your file to test with ?

I am asking because I have an i7-8809G (same GPU as you, plus. an AMD RADEON)

10 minute cut made with:

ffmpeg -ss 00:02:00 -i Ghost.in.the.Shell.2017.4K.HDR.2160p.BDRip\ Ita\ Eng\ x265-NAHOM.mkv -c:a copy -c:v copy  -t 00:10:00 out.mkv

https://vizcachas.orangebox.cl/out.mkv

there is a way to deactivate the sub burning without deactivating all types of reencode?

thanks!