Hardware Transcoding severe video quality degradation some files - 100% repeatable

Edit: This happens w PMS on Haswell to Coffee Lake iGPU. It happens in Linux (Synology but not Ubuntu 18.10) and Windows PMS. It happens in all of the last months worth of beta versions. It is NOT the expected superiority of SW over HW image quality you see with most of these bitrate samples. It is one specific bitrate 20 combined with MAX transcode rate in the web client looks like garbage. It is an encode problem, not a decode problem. Devs please notice!

Server Version#: Synology intel 64 bit and windows 64bit 1.15.1.707
Player Version#:web 3.83.1 in chrome

This is reproducible using file jellyfish-20-mbps-hd-hevc
from http://jell.yfish.us/

Severe blocking, visual quality is far inferior to the same clip with software decode (slight is expected) quality is also far inferior to the same file in 3 or 10 mbps versions. Strangely I didn’t experience it with the 25,30,35,45, but it WAS there, to a lesser degree, with the 40mbps sample.

I confirmed this on a Synology server Linux, with Intel e3-1275 v3 HW transcode enabled, and on Windows 10 w e3-1275 v3 HW transcode enabled, as well as a Dell XPS with Intel 7200u HW transcode enabled.

I confirmed in the dashboard that the only time I saw the low-quality image there was hw encode and hw decode occurring.
Plex Media Server Logs_2019-02-24_14-25-41.zip (391.2 KB)
Plex Media Server Databases_2019-02-24_14-27-26.zip (42.5 KB)
(Edit to note the fact that PMS on ubuntu does not have the issue)

1 Like

Another day, another Plex media server version to install! I started with my newly build Windows 10 test system (1809, Lenovo TS140 w E3-1225v3 CPU) hw encoding enabled,

I updated to today’s server version 1.15.1.710.
web client seems to have been updated as well, and is now 3.87.3

-jellyfish-3-mbps-hd-h264 plays correctly as before, direct stream.
-jellyfish-3-mbps-hd-hevc plays correctly, in good quality, strangely, sometimes it uses software encode and software decode, and sometimes it uses hw for decoding and for encoding ( (hw) on both lines. )
-jellyfish-3-mbps-hd-hevc-10bit plays correctly, in good quality, it correctly uses software for decoding and for hw encoding ( (hw) on second line. ) This is correct because my CPU does not support 10-bit HEVC in hardware, thus it falls back to hardware to decode.

so far so good!

-jellyfish-20-mbps-hd-h264 plays correctly as before, direct stream.

unfortunately…
-jellyfish-20-mbps-hd-hevc plays in good quality only when it decides to use software encode and decode.

again, strangely, sometimes it uses software encode and software decode, and sometimes it uses hw for decoding and for encoding ( (hw) on both lines. )

-jellyfish-20-mbps-hd-hevc-10bit also plays correctly, in good quality, only if it uses software to ecode and decode. the same severe blockiness when it uses software for decoding and for hw encoding ( (hw) on the second line. )

since both experience the same severe quality drop and HW encode is all that is in common between them, it seems to be hw encode problem, at this bitrate.
Plex Media Server Logs_2019-02-26_17-18-17.zip (1.8 MB)

Plex Media Server Databases_2019-02-26_17-18-32.zip (97.2 KB)

Anyone out there that is running HW transcoding, can you please try this file? It is publically available (http://www.jell.yfish.us/) and quite small.

I see issue under Linux (Synology) and Windows. I am also wondering in NVidia based encoding has the same problem.

Per the Intel specs for that hardare, which was released in 2013, what you have is what you’re going to get. It is 1st generation QSV. It isn’t even rated for HEVC

I’d love to get better quality out of hardware transcoding, too. I’m running hardware from a similar vintage as the OP (Haswell).

One thing about your comment confuses me:

I’ve not seen much about differences in QSV in different “generations”. I do see some differences highlighted here: Intel Quick Sync Video - Wikipedia – but Haswell architecture is labeled as using “Version 3” – which hardly seems to correlate to “first generation”. Can you clarify what you mean?

Also, the same Wikipedia entry suggests different quality settings are available – is Plex using the highest quality? Because I find h/w transcoding via Plex using my Haswell hardware to be utterly unwatchable, and would love to know if it’s using the highest quality option.

respectfully, I do not see anything in there that describes the problem I am seeing.

The 10 mbps file is fine, the 20 mbps file is terrible, the 25 mbps file is fine (when intel HW encodes each.)

A separate question, on your point about HEVC not available on my CPU. Since I often see (hw) next to the decode line and the encode line, this must be an error right? since my CPU does not support HW decode, why do I see that on an HEVC file? (hw) on the encode line is expected / appropriate because my CPU does use QSV to encode h.264 video.

image

I’d love to try to repeat your test, but I’m unclear as to what your target bitrate (or even codec) is in your tests. Can you provide more clarity about exactly what you’re transcoding to?

I am using the web viewer version listed above, under google chrome browser, current version (72?)
I have plex transcoder quality typically set at auto.
In this situation, plex chooses to transcode it to h.264. I install tautulli to get some more details on trancoding.

does this answer your question?

I can send you an invite to my plex to see it yourself off my plex if you want to PM me an email address.

You should be able to at least see the approximate end bitrate of the video by clicking the little settings icon while playing: https://screencast.com/t/i0et741G

I will confirm when I get home. My Test Windows plex server is offline at the moment.

Interestingly the move from 707 to 710 on Synology build appears to have changes things a bit.

  • the jellyfish-20-mbps-hd-hevc seems to now correctly use software for decode and SQV for encode. At least thats what it shows in the dashboard. The downside is that it crashes and will not play the file at all now!

with 707, HW encoding resulted in poor quality under windows and synology. under 710 Windows remains with the poor quality, while synology just won’t play it!

OK, the Windows server is up,
This is what I get when it is using HW, and it is set to max.
It says Convert to 1080p HD (High) (Maximum) 19.9 Mbps

image

I stand corrected on the QSV generation. It is Generation 3 QSV.

On the i7-side, HEVC decoding wasn’t available until the 6th gen (-6xxx) SkyLake processors. That was limited to SDR. It wasn’t until KabyLake and ApolloLake (7th gen -7xxx) where we got HDR capability.

If I’ve errored, which I appear to have, it’s in understanding what Xeons have differently than desktop processors because so few Xeons had QSV.

Can you tell us what “Target usage” (TU) setting Plex uses with Quicksync? I’d love to see what the results would look like with TU1 which is supposed to be the highest quality setting. It would be great for Haswell’s transcoding to at least be usable (at this point it definitely is NOT).

And do Plex’s transcoder quality settings have any impact (such as determining the target usage level) when hardware transcoding is used? From my limited testing I don’t see any visual difference between the highest quality setting and the lowest when using hardware transcoding.

The transcoder uses the 4.0 profile for video encoding by default. This is good for 20 Mbps.
I am having difficulty grasping how it has worked for everyone but isn’t working properly for you.

Is it 1.15.x specific or is this also reproducible on 1.14.x?

The biggest jump in PQ for HW trancoding using Intel QSV started with Broadwell generation. I personally have at my disposal hardware all the way back to Ivy Bridge which is 2nd gen QSV. There was very little done in terms of PQ quality by Intel with QSV between Sandy Bridge to Haswell.

I should clarify: my complaint isn’t quite the same as the OP’s. I haven’t done exhaustive checking of performance at a variety of bitrates. HW transcoding with QSV “works” for me. The quality is simply atrocious. Not just fuzzier or blockier than necessary, but with tons of weird colors and artifacts and swaths of scenes that carry over and fail to update with movement and scene changes.

I’m typically transcoding down to a pretty low target bitrate, something like 4mbps or less, and from what I’ve read QSV’s quality at a given bitrate is typically much worse than x264’s. So my bitrate being so low I’m sure just exacerbates the problem. And the forum (and internet) is littered with complaints of QSV’s quality so I’m hardly the only one complaining.

Anyhow: I would love to be able to try a higher quality TU profile to see what could be achieved. As it stands I’m unwilling to use HW transcoding at all. If TU1 were able to at least hit a 1x transcode speed it would seem like there’s no real downside to picking the higher quality profile, right?

I’m on 1.14. Haven’t tried 1.15 yet.

If the quality of the hardware is not acceptable, then buy new hardware.
NOTHING done in software can address the physical algorithms implemented in silicon.

The good changes really started coming along in the 5th and 6th generation systems.

This argument is like asking a 1980’s automobile to compete with a current model in terms of handling and performance. Not going to happen.

Nothing is free in this hobby especially when it comes to hardware acceleration. Just look at the price of video cards for gaming. Most importantly, look at the image quality spanning several product development cycles. It’s the same thing.

With the later generations of hardware, especially these last two, the difference between software and hardware transcoding is nearly indistinguishable. You must have very fine test equipment to see it. In another generation or two, as the technology is perfected, there will be no difference at all.

Out of curiousity what is the DNA of your content that you are transcoding down to 4Mbps?

This is mostly 1080p BluRay rips that I’ve transcoded down to something in the neighborhood of a 30mbps h.264 mp4 for storage.

I also see the problems when transcoding live 1080p OTA TV via Plex.

Software transcoding puts out perfectly acceptable images at my 4mbps target.

I understand that I might just need new hardware, but given that other “target usage” profiles exist I’m curious to at least see what the result of a higher-quality one would be.