Ubuntu 24.04 & HW transcoding

H.264 (AVC), by default, is 8 bit color.
HDR is 10 bit color.

There is an extension in the AVC specification to support H.264 10-bit but nobody uses it (HEVC is better at 10 bit color)

When you transcode H.264 → H.265, you don’t automatically get HDR because the source material is SDR but H.265 SDR (with balanced colors) is smaller file size / better quality at the same bit rate.

1 Like

Ah, that makes so much more sense. OK, I eagerly await HVC encoding, lol.

The issue with SRT subtitles is many players, they look super low resolution and really distract from the movie, sometimes having SUPER high contrasted and cheap-looking Comic Sans or Ariel fonts… They also tend to be super huge, sometimes with multiple lines that are not split evenly for easier reading (like cutting one line directly after a preposition instead of before, etc)

I’d rather have the subtitles that were designed by the team that made the BluRay. Yes, it has caveats, but they generally more visually pleasing and less distracting from the movie.

@ChuckPa Any updates on the burn-in subtitle issue? Not sure if it fixed along with the same commits.

I have no update on HW burn-in subtitles.
We are working through some issues.

  1. This release got 6.8 kernel HW transcoding and tonemapping for most CPUs

  2. I’m working on package signing for Redhat
    ( I would like some RPM users to jump in and ping me because I think it’s super close / maybe ready but I’ve been away from redhat too long )

  3. Also fixing NAS packaging (one of the vendors has a firmware update in the works which is kludgy at best. … you have to stop PMS first… which isn’t how it should work … that’s what I’m fixing.

I appreciate the information. Sorry that I keep bothering. Trying to wait patiently as best I can. Wish you and your team well.

No need to apologize…

wearing both support and development hats can be “interesting” :joy:

example:

  1. 1.40.3.8555 works perfectly on Ubuntu GeminiLake CPU J4125
  2. On synology, with same CPU, it fails.

:scream_cat:

Hey @ChuckPa to confirm… H.265 HW encode will be the new default… and AV1 HW encoding is in the works with a “selectable option” in Plex later down the road?

I have a 36 core ProxMoxBox with an Intel Arc A750 that HW encodes AV1 up to 8K 10-bit HDR and would love to stream my library to my new Walmart Google TV with dedicated AV1 HW decoding!

If you configure it yourself then VAAPI works.

We currently do not include any drivers for Arc GPUs (hence, no official support)

1 Like

I am still having troubles with the transcoder. My GPU shows up in Transcoder settings but logs says can’t find hardware.


Full Logs:

@happykharoud

You’ve created a private paste.

Q: Do you have the nvidia encode & decode packages installed ?

ii  libnvidia-decode-535-server:amd64      535.161.08-0ubuntu2.22.04.1              amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-535-server:amd64      535.161.08-0ubuntu2.22.04.1              amd64        NVENC Video Encoding runtime library

If you do, you can attach your logs in the PM I opened for you.

1.40.3.8555 on Synology w/ J4125, using docker with graphics device handle passed in. Confirming that accelerated PGS subtitle encoding is not working here (which you already know). Happy to test if you need.

Also, looking forward to HEVC encoding in the future. Do you happen to know if we’ll get 10 bit HDR HEVC encoding on this platform eventually?

@joshastein

1.40.3.8555 was all about, which didn’t quite get everything, fixing kernel problems (6.8 Linux kernel).

We’ve been so busy with that, we’ve not finished PGS sub burning or HEVC encoding.

There will be a forum preview when we’re at that point.

4 Likes

@ChuckPa Chiming in here again with stuff you probably are already aware of. On my Meteor Lake based system I tried 1.40.3.8555 on my Proxmox LXC container with the latest Intel Media Drivers installed on the Proxmox host and hardware transcoding only works with tone-mapping disabled. Let me know if there’s anything you’d like me to test or if logs would be helpful.

@jakemauer

We’re finding (looking deep into the Intel Compute Runtime debug output) that this looks like an Intel problem with their current ICR version (1.40.3.8555 includes it).

You can experiment by downgrading to 1.40.2 which uses the previous ICR.

Betware of the 6.8 kernel (only used in Ubuntu 24.04)

Personal note: I can’t wait until 24.04.1 is released and fixes all the broken crap.

2 Likes

I´ve been testing the new Unraid 7.0.0 beta 1(kernel 6.8.12) since yesterday and can confirm that HW HDR tone mapping works with Intel N100.

hi, i have updated my plex server to 1.40.3.8555 but it is still not using hw transcoding, anyone know what i could be doing wrong please? my server CPU is an i5-8500t.

i am running it via docker on my ubuntu server (24.04) which is on linux kernel 6.8.0-35.

i have the dev/dri line in my compose and selected the igpu in the transcoder settings. hw transcoding worked fine when i was running plex on my synology nas (which had a celeron CPU) but for some reason refuses to run on my dell optiplex, with the exact same docker compose setup etc

this was in the plex console:

Jun 27, 2024 23:22:24.878 [131618178083640] Debug — [Req#1bbe/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 27, 2024 23:22:24.879 [131618178083640] Debug — [Req#1bbe/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 27, 2024 23:22:24.879 [131618178083640] Debug — [Req#1bbe/Transcode] Could not create hardware context for hevc
Jun 27, 2024 23:22:25.215 [131618152917816] Debug — [Req#1bd3/Transcode] TPU: hardware transcoding: enabled, but no hardware decode accelerator found
Jun 27, 2024 23:22:25.217 [131618152917816] Debug — [Req#1bd3/Transcode] TPU: hardware transcoding: final decoder: , final encoder:

@Epir

Can you restart PMS, wait 3 minutes, download the server logs ZIP file, and attach it here please?

@Epir

Thanks. I found what I was looking for.

When you have subtitles in the file, PMS will suppress using HW to avoid a full transcoder restart if you happen to enable subtitles --and-- when burning subtitles.

Jun 28, 2024 21:00:00.296 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] Subtitles: Found a candidate subtitle language [] for a foreign film
Jun 28, 2024 21:00:00.296 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] Audio Stream: -1, Subtitle Stream: -1
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] MDE: Selected protocol hls; container: mpegts
Jun 28, 2024 21:00:00.297 [123530335234872] ERROR - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] Unable to find title for item of type 5
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] MDE: analyzing media item -1
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] MDE: : no direct play video profile exists for http/mpegts/
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] MDE: : no direct play video profile exists for http/mpegts//
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] MDE: : selected subtitle stream  has no codec
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] MDE: : codec is unavailable for analysis
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] MDE: : codec is unavailable for analysis
Jun 28, 2024 21:00:00.297 [123530335234872] ERROR - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] Unable to find title for item of type 5
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] MDE: : selected media 0 / -1
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] Cleaning directory for session 62592f53-407e-48df-aaf4-b0d836c332bd ()
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] Starting a transcode session 62592f53-407e-48df-aaf4-b0d836c332bd at offset -1.0 (state=3)
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] Streaming Resource: Added session 0x7059b1153058:62592f53-407e-48df-aaf4-b0d836c332bd
Jun 28, 2024 21:00:00.297 [123530393955128] DEBUG - Request: [172.18.0.6:43910 (WAN)] GET /library/metadata/16983 (7 live) #3540a GZIP Signed-in Token (khils) (Chrome (Overseerr))
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] TPU: hardware transcoding: enabled, but no hardware decode accelerator found
Jun 28, 2024 21:00:00.297 [123530335234872] DEBUG - [Grabber/281932fe75e58305bfe0f6d591c92ee9276bea3f] TPU: hardware transcoding: final decoder: , final encoder: 

what can you play which doesn’t have subtitles in it?

thanks, i played a movie which had no subs but it still didn’t hw transcode. it’s strange because it worked fine on my synology nas regardless of which subs

Jun 28, 2024 23:22:04.743 [135036030430008] DEBUG - [Req#150d] Play progress on 18354 'Philomena' - got played 110000 ms by account 1!
Jun 28, 2024 23:22:04.743 [135036030430008] DEBUG - [Req#150d] [Now] User is (ID: 1)
Jun 28, 2024 23:22:04.744 [135036030430008] DEBUG - [Req#150d] [Now] Device is windows (PC).
Jun 28, 2024 23:22:04.744 [135036030430008] DEBUG - [Req#150d] [Now] Profile is Plex Desktop
Jun 28, 2024 23:22:04.744 [135036030430008] DEBUG - [Req#150d] [Now] Updated play state for /library/metadata/18354.
Jun 28, 2024 23:22:04.744 [135036030430008] DEBUG - [Req#150d] Statistics: (233iolm7w7iuyajg8p19scby) Reporting active playback in state 0 of type 1 (scrobble: 0) for account 1
Jun 28, 2024 23:22:04.747 [135036128996152] DEBUG - Completed: [192.168.1.97:65333] 200 GET /:/timeline?ratingKey=18354&key=%2Flibrary%2Fmetadata%2F18354&playbackTime=6008&playQueueItemID=94234&state=playing&hasMDE=1&context=home%3Ahub.continueWatching&row=0&col=0&time=110000&duration=5863000 (9 live) #150d TLS GZIP 8ms 409 bytes (pipelined: 3)
Jun 28, 2024 23:22:05.141 [135035936058168] DEBUG - Request: [192.168.1.97:65333 (Subnet)] GET /video/:/transcode/universal/decision?hasMDE=1&path=%2Flibrary%2Fmetadata%2F18354&mediaIndex=0&partIndex=0&protocol=http&fastSeek=1&directPlay=0&directStream=0&subtitleSize=100&audioBoost=100&location=lan&maxVideoBitrate=2000&addDebugOverlay=0&autoAdjustQuality=0&directStreamAudio=1&advancedSubtitles=text&mediaBufferSize=157286&session=0irg2zcmg3i5m1axqx0gpm96&offset=110&subtitles=auto&copyts=1&Accept-Language=en-GB (9 live) #151c TLS GZIP Signed-in Token (khils) (KHILAN-PC)
Jun 28, 2024 23:22:05.141 [135035936058168] DEBUG - [Req#151c/Transcode] Found session GUID of 0irg2zcmg3i5m1axqx0gpm96 in session start.
Jun 28, 2024 23:22:05.141 [135035936058168] DEBUG - [Req#151c/Transcode] TranscodeUniversalRequest: using profile Plex Desktop
Jun 28, 2024 23:22:05.141 [135035936058168] DEBUG - [Req#151c/Transcode] Downloading document http://127.0.0.1:32400/library/metadata/18354?includeBandwidths=1&offset=110&X-Plex-Incomplete-Segments=1&X-Plex-Session-Identifier=rqui6ruvhutoo9erlksqb4u1
Jun 28, 2024 23:22:05.148 [135035936058168] DEBUG - [Req#151c/Transcode] We're going to try to auto-select an audio stream for account 1.
Jun 28, 2024 23:22:05.148 [135035936058168] DEBUG - [Req#151c/Transcode] Selecting best audio stream for part ID 26196 (language: en)
Jun 28, 2024 23:22:05.148 [135035936058168] DEBUG - [Req#151c/Transcode] We're going to try to auto-select a subtitle for account 1.
Jun 28, 2024 23:22:05.148 [135035936058168] DEBUG - [Req#151c/Transcode] Audio Stream: 178824, Subtitle Stream: -1
Jun 28, 2024 23:22:05.149 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: testing h264_vaapi (encoder)
Jun 28, 2024 23:22:05.149 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 28, 2024 23:22:05.150 [135035936058168] ERROR - [Req#151c/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Jun 28, 2024 23:22:05.150 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 28, 2024 23:22:05.150 [135035936058168] DEBUG - [Req#151c/Transcode] Could not create hardware context for h264_vaapi
Jun 28, 2024 23:22:05.150 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 28, 2024 23:22:05.151 [135035936058168] ERROR - [Req#151c/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] Could not create hardware context for h264
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Selected protocol http; container: mkv
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: analyzing media item 21674
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): Direct Play is disabled
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): no direct play video profile exists for http/mp4/h264
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): no direct play video profile exists for http/mp4/h264/aac
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): Direct Streaming is disabled, so video stream will be transcoded
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): no remuxable profile found, so video stream will be transcoded
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Cannot direct stream video stream due to profile or setting limitations
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jun 28, 2024 23:22:05.151 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 28, 2024 23:22:05.151 [135035936058168] ERROR - [Req#151c/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Jun 28, 2024 23:22:05.152 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 28, 2024 23:22:05.152 [135035936058168] DEBUG - [Req#151c/Transcode] Could not create hardware context for h264
Jun 28, 2024 23:22:05.152 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): selected media 0 / 21674
Jun 28, 2024 23:22:05.152 [135035936058168] DEBUG - [Req#151c/Transcode] Streaming Resource: Required bandwidth unknown (media requires deep analysis) Changing decision parameters provided by client to fit bandwidth limit of 2000kbps
Jun 28, 2024 23:22:05.152 [135035936058168] DEBUG - [Req#151c/Transcode] Streaming Resource: Determining preferred transcode encoders through transcode only decision.
Jun 28, 2024 23:22:05.152 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jun 28, 2024 23:22:05.152 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 28, 2024 23:22:05.152 [135035936058168] ERROR - [Req#151c/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Jun 28, 2024 23:22:05.153 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 28, 2024 23:22:05.153 [135035936058168] DEBUG - [Req#151c/Transcode] Could not create hardware context for h264
Jun 28, 2024 23:22:05.153 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jun 28, 2024 23:22:05.153 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 28, 2024 23:22:05.153 [135035936058168] ERROR - [Req#151c/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Jun 28, 2024 23:22:05.153 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 28, 2024 23:22:05.153 [135035936058168] DEBUG - [Req#151c/Transcode] Could not create hardware context for h264
Jun 28, 2024 23:22:05.154 [135035936058168] DEBUG - [Req#151c/Transcode] Streaming Resource: Reducing playback quality for 1904kbps stream bitrate: video resolution to 720x390, audio channels to 2, quality to 44, disable audio DS as 2147483647kbps is > the 167kbps available
Jun 28, 2024 23:22:05.154 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jun 28, 2024 23:22:05.154 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 28, 2024 23:22:05.154 [135035936058168] ERROR - [Req#151c/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Jun 28, 2024 23:22:05.154 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 28, 2024 23:22:05.154 [135035936058168] DEBUG - [Req#151c/Transcode] Could not create hardware context for h264
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Selected protocol http; container: mkv
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: analyzing media item 21674
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): Direct Play is disabled
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): no direct play video profile exists for http/mp4/h264
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): no direct play video profile exists for http/mp4/h264/aac
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] Philomena - video.width limitation applies: 1920 > 720
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] Philomena - audio.channels limitation applies: 6 > 2
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): Direct Streaming is disabled, so video stream will be transcoded
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): no remuxable profile found, so video stream will be transcoded
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Cannot direct stream video stream due to profile or setting limitations
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 28, 2024 23:22:05.155 [135035936058168] ERROR - [Req#151c/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] Could not create hardware context for h264
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Philomena (2013): Audio Direct Streaming is disabled, so video's audio stream will be transcoded
Jun 28, 2024 23:22:05.155 [135035936058168] DEBUG - [Req#151c/Transcode] MDE: Cannot direct stream audio stream due to profile or setting limitations

Please show me the output of

  1. ls -la /dev/dri
  2. groups plex (or whichever username you run Plex as)

Having taken down your logs, I can’t remember if this is in Docker or not.
If it is, is the docker UID a member of the same groups as user plex ?