Intel Quick Sync transcode quality issues on Intel 12th/13th gen CPUs

@ChuckPa , I can confirm the dev build does not resolve the issue. :frowning:

image

Media Sample: (compressed from screen record, but still shows an example of the artifacting - you’ll need to download and play direct to see it - gdrive playback is terrible)

@rozzly

Please do a ls -la /dev/dri
then copy/paste the text of that console session here inside a </> code button block. It will look like this:

[chuck@lizum ~.2000]$ ls -la /dev/dri
total 0
drwxr-xr-x   3 root root        140 Apr  4 02:33 ./
drwxr-xr-x  21 root root       5260 Apr 19 13:43 ../
drwxr-xr-x   2 root root        120 Apr  4 02:33 by-path/
crw-rw----+  1 root render 226,   0 Apr  8 20:38 card0
crw-rw----+  1 root render 226,   1 Apr 22 09:18 card1
crw-rw----+  1 root render 226, 128 Apr  8 20:38 renderD128
crw-rw----+  1 root render 226, 129 Apr  8 20:38 renderD129
[chuck@lizum ~.2001]$

The installation summary is highly unusual

Also please provide a fresh set of DEBUG logs which capture a playback using this new build.

root@plex-server:/# ls -la /dev/dri
total 0
drwxr-xr-x 3 root video         100 Feb 25 20:21 .
drwxr-xr-x 9 root root          560 Mar 27 19:13 ..
drw-rw---- 2 root root           80 Feb 25 20:21 by-path
crw-rw---- 1 root video    226,   0 Feb 25 20:21 card0
crw-rw---- 1 root ssl-cert 226, 128 Feb 25 20:21 renderD128

Log Bundle: PMS Log Bundle.zip - Google Drive

Web Client Log: Web-Client-Logs-1.txt - Google Drive

I see your problem.

renderD128 is the wrong group. It should match the directory and card0

renderD128 is set by the kernel as it enumerates the inode during kernel startup & device initialization.

What have you done to the configuration? Are you changing it manually in a ‘rc’ script ?

Sample of that video please ?
Use ‘dd’ to cut a block off the front end of it (enough so I can see the artifacts you see).

I will attempt to replicate

Edit: @ChuckPa I changed group for renderD128 to match card0 and directory, restarted PMS with no difference.

I’ve done a lot of rebuilding lately and have been using this proxmox one-liner for deployment. I’m not seeing anything out of the ordinary for the configuration / passthrough commands though.

Proxmox VE Helper Scripts | Scripts for Streamlining Your Homelab with Proxmox VE (tteck.github.io) >> Media - Photo > Plex Media Server LXC.

Install Script: Proxmox/plex-install.sh at main · tteck/Proxmox · GitHub

Video Sample 1: sample-1.mkv - Google Drive
Video Sample 2: sample-2.mkv - Google Drive

@rozzly

Thanks for the samples.

  1. I get no artifacts. I do get those blue-ish moonlight reflections which do seem odd and out of place until you look a lot closer at the scenes.

  2. In another post, I saw where you listed you have all libva and ICR packages installed.
    Are you aware that , even though Plex brings its own libraries for everything, it is possible to get conflicts between the two ?
    – I’ve seen it in testing a few times . very rare but have seen it. The remedy was to remove the ICR, Beignet, and OpenCL modules from the system.

As note: Intel removed Beignet from Ubuntu 22.04 because of its incompatibility with newer hardware and newer kernels.

The packages I have currently are what were deployed through the original script -

I mis-read the logic, so beignet-opencl-icd would only be deployed if I were on 20.04.

if [[ ${PCT_OSVERSION} == "20.04" ]]; then 
  $STD apt-get install -y beignet-opencl-icd
  else
  $STD apt-get install -y intel-opencl-icd
fi

So the current installs are:

va-driver-all 
ocl-icd-libopencl1 
intel-opencl-icd

I’ve got snapshots of everything and I’m free to test - -which ones would you suggest removing?

I am advising you,

If you don’t need:

  • the VA driver for anything else – Remove it
  • ocl-icd-libopencl1 for anything else – Remove it
  • intel-opencl-icd for anything else – Remove it
  • Regenerate the initramfs if packages removed

They will cause problems on your newer hardware and newer kernel

If you look at the installer, I don’t install them for this purpose.
I used to - but with the advent of Plex including them – I do not.

Also, if you have any GUC= in the i915.conf , remove that now too please.
It’s no longer needed.

If you look closely, these are moonlight reflections.
are they what you see?

These are the only ‘out of place’ things I see until I turn up the brightness then they make sense.

@ChuckPa No, if you were getting the same artifacting I am, you’d see it right away. It happens for about 1 second at multiple points in both samples. Here is an example screenshot that shows the kind of full-screen artifacts I get. After about 1 second, it clears up, but happens again frequently.

Blocky

Normal

I’ve removed the packages, confirmed no GUC entry, rebooted, no change :frowning:

What time index in the movie is that.

I have the BluRay rip. I will see what the original looks like.

This is approximately 1:05:30 of the film 1917. Here’s another really short example of the artifacting I’m talking about. It happens at the 8 second mark very briefly. (download the file and play back for better quality) – this is not in the source content.

I can only get this to happen on plex web with or without subtitles, and samsung TV with subtitles enabled – The subtitles from anime is why this originally came to my attention since subtitles are required for me – the artifacting stops if subtitles are turned off on the samsung app.

I’ve been using a temporary roku stick to get around this issue on my tvs.

Edit I deployed a fresh LXC container manually with Ubuntu 22.10 - passed /dev/dri through from the proxmox host - mapped my nas - installed the latest dev PMS package - did not install any extra packages. I can still replicate this issue.

Have you tried the Tteck Proxmox LXC script? He automates all the needed GPU acceleration LXC config. Don’t have to lift a finger. I wrote a how-to guide using his script: https://www.derekseaman.com/2023/04/proxmox-plex-lxc-with-alder-lake-transcoding.html

I have a 12th Gen Intel G7400 and I was able to replicate your issue with the same episode of The Fruit of Evolution.

It seems Quick Sync is terrible at transcoding low bitrate files. The exact same pixelation as your example occurred on a 1.7Mbps HEVC bitrate file.

I had no pixelations when I was transcoding a 2.3Mbps HEVC bitrate file of the same episode.

I’m using Ubuntu 22.04 with Plex in docker.

Yep! This is exactly what I’ve been using. The script actually installs three packages that Chuck recommended removing since they’re bundled with Plex now and installing separately can create conflicts in rare cases. Removing the packages did not help my issue though.

Specifically:

va-driver-all
ocl-icd-libopencl1
intel-opencl-icd

Edit: The step where you perform:

ls -l /dev/dri
  • Chuck recommended matching the group membership of renderD128 to that of the card0 as a best practice. In my case this did not make a difference to the issue, but still worth noting.
/bin/chgrp video /dev/dri/renderd128
1 Like

@happytaz , What client were you using for playback? I pulled up the original file again and have confirmed the following:

  • This episode file is 1,800~ kbps - pretty low and very similar to what you tested with.
  • The issue can be replicated on Plex Web Client, but does not occur on the Windows Desktop App via transcoding.
  • The issue does occur on Samsung TV app, however it does not occur when subtitles are disabled.

I’ve also been testing with an x265 movie file – I’ve provided short snippets just above for troubleshooting with Chuck. With the file, I can confirm:

  • The movie file is 6,600~ kbps
  • The issue appears via Plex Web Client during playback, but does not occur on the Windows Desktop App via transcoding.
  • The issue does not appear on Samsung TV app, but it does happen when subtitles are enabled.

Because the issue does not occur in the plex windows desktop app during the same transcoding process, this appears to be a problem with quality when burning subtitles. I’d be interested to hear if the higher bitrate file that did not give you problems had different subtitle formatting that did not require burning?

Either way, very excited to hear someone was able to replicate this!

I used the Plex Web Client in Chrome.

For both files, only the video was transcoding 1080P HEVC to 1080P H264 using Quick Sync. AAC Audio and ASS Subtitles were Direct Streaming. Just to clarify, subtitles were not burned in for both files. I used Tautulli to verify.

Would you be willing to confirm the issue goes away with the Plex Windows Desktop app? Also, not sure if you have a samsung TV to test with. The same should also be able to be replicated via the Plex Web Client with the movie snippet.

I have subtitle burn set to automatic and confirmed via tautulli as such.
image

I made a mistake in my earlier post. I just played both files again with the Chrome Web Client and they both have pixelation. The higher bitrate file has a lot less pixelation which may have caused me to miss it the first time.

I’m unable to replicate the exact test in the Plex Windows app because there’s no option to automatically transcode 1080p to 1080p like in the Web Client. I have to manually transcode it to 480p due to the low bitrate of the file. When manually transcoding to 480p, there is no pixelation on the Web Client or the Windows app. Sorry, I don’t have a Samsung TV.

As for your burned subtitles, does Edge support Direct Streaming ASS subtitles?

By the way the pixelated file is 1.8Mbps and less-pixelated file is 2.5Mbps according to Plex. I was going by the numbers reported by MediaInfo in my earlier post.

1 Like