MPEG2 QSV Hardware Transcoding Weirdness: 480i works, 720p fails, 1080i sporadic

I’ve run into a quick sync transcoding issue with MPEG2. My server is running a i5-4570s (Haswell). I have previously seen other sporadic errors with hardware transcoding, so I tested this problem with an entirely different CPU/motherboard. It’s a stock Windows 10 1803 x64 install with the public channel of PMS. It has a monitor attached, and is not running as a service.

These issues were reproducible on my Windows 10 1803 Kaby Lake PMS. But I wanted to remove it from testing just in case I was having a hardware issue.

These are being seen on Plex Web, but I’ve seen similar problems on a 2017 Roku Streaming Stick.

Partial logs for 480i MPEG2 video:

! May 18, 2018 21:19:39.642 [3184] DEBUG - MDE: E21 - Shape Hunt: Direct Play is disabled
! May 18, 2018 21:19:39.642 [3184] DEBUG - MDE: E21 - Shape Hunt: media must be transcoded in order to use the dash protocol
! May 18, 2018 21:19:39.642 [3184] DEBUG - MDE: E21 - Shape Hunt: no direct play video profile exists for http/mpegts/mpeg2video
! May 18, 2018 21:19:39.642 [3184] DEBUG - MDE: E21 - Shape Hunt: no direct play video profile exists for http/mpegts/mpeg2video/ac3
! May 18, 2018 21:19:39.642 [3184] DEBUG - MDE: E21 - Shape Hunt: no remuxable profile found, so video stream will be transcoded
! May 18, 2018 21:19:39.642 [3184] DEBUG - MDE: Cannot direct stream video stream due to profile or setting limitations
! May 18, 2018 21:19:39.642 [3184] DEBUG - Codecs: hardware transcoding: testing API dxva2
! May 18, 2018 21:19:39.642 [3184] DEBUG - Scaled up video bitrate to 4042Kbps based on 1.500000x fudge factor.
! May 18, 2018 21:19:39.783 [13620] DEBUG - TranscodeUniversalRequest: using profile Web
! May 18, 2018 21:19:39.783 [13620] DEBUG - TPU: hardware transcoding: using hardware decode accelerator dxva2
! May 18, 2018 21:19:39.783 [13620] DEBUG - [Universal] Using local file path instead of URL: D:\Kids TV\Sesame Street (1969)\Sesame Street (1969) - S48E21 - Shape Hunt.ts
! May 18, 2018 21:19:39.783 [13620] DEBUG - TPU: hardware transcoding: zero-copy support not present
! May 18, 2018 21:19:39.783 [13620] DEBUG - TPU: hardware transcoding: final decoder: dxva2, final encoder: qsv

[It then transcoded successfully, with (hw) listed on both sides in the Now Playing window]

Partial logs for 720p MPEG2 video:

! May 18, 2018 21:19:02.754 [13620] DEBUG - MDE: E28 - Bert and Ernie Make a Movie (repeat): Direct Play is disabled
! May 18, 2018 21:19:02.754 [13620] DEBUG - MDE: E28 - Bert and Ernie Make a Movie (repeat): media must be transcoded in order to use the dash protocol
! May 18, 2018 21:19:02.754 [13620] DEBUG - MDE: E28 - Bert and Ernie Make a Movie (repeat): no direct play video profile exists for http/mpegts/mpeg2video
! May 18, 2018 21:19:02.754 [13620] DEBUG - Bert and Ernie Make a Movie (repeat) - video.bitrate limitation applies: 11849 > 3676
! May 18, 2018 21:19:02.754 [13620] DEBUG - MDE: E28 - Bert and Ernie Make a Movie (repeat): no remuxable profile found, so video stream will be transcoded
! May 18, 2018 21:19:02.754 [13620] DEBUG - MDE: Cannot direct stream video stream due to profile or setting limitations
! May 18, 2018 21:19:02.754 [13620] DEBUG - Codecs: hardware transcoding: testing API dxva2 [Note: Repeatedly appears]
! May 18, 2018 21:19:02.785 [10556] DEBUG - Scaled up video bitrate to 17773Kbps based on 1.500000x fudge factor.
! May 18, 2018 21:19:02.879 [13620] DEBUG - TPU: hardware transcoding: using hardware decode accelerator dxva2
! May 18, 2018 21:19:02.879 [13620] DEBUG - TPU: hardware transcoding: zero-copy support not present
! May 18, 2018 21:19:02.879 [13620] DEBUG - TPU: hardware transcoding: final decoder: dxva2, final encoder: qsv
! May 18, 2018 21:19:03.410 [6764] ERROR - [Transcoder] [h264_qsv @ 01f18340] Error during encoding: device failed (-17)
! May 18, 2018 21:19:03.410 [10108] ERROR - [Transcoder] Video encoding failed
! May 18, 2018 21:19:03.457 [0232] DEBUG - Jobs: ‘C:\Program Files (x86)\Plex\Plex Media Server\PlexTranscoder.exe’ exit code for process 5036 is 1 (failure)
! May 18, 2018 21:19:03.457 [5376] DEBUG - Streaming Resource: Changing client to use software decoding

I tested with two other 720p MPEG2 videos, and the logs are pretty similar. It’s consistent. I can PM full logs and/or video samples if needed. But it seems to be happening with any 720p MPEG2 TS file.

Not shown here: 1080i: It has failed repeatedly, but then will randomly work as well. I can get more logs for that, if desired.

Is anyone else seeing these problems with Intel QSV transcoding? I don’t know if this is a current transcoding limitation, a bug, or problem I’m just seeing on multiple machines.

Is there any reason why u r not streaming MP4 files.
TS files.? Really
Does anyone/ anywhere say that is a good idea with plex?

@spikemixture said:
Is there any reason why u r not streaming MP4 files.
TS files.? Really
Does anyone/ anywhere say that is a good idea with plex?

MPEG2 TS files are used for recording TV from local networks over an antenna. They don’t use MP4 files (or more specifically, H264 files). Plex records the TS files directly to the hard drive via their Live TV/DVR feature. They’re quite common for DVR purposes.

@“Cafe Diem” said:

@spikemixture said:
Is there any reason why u r not streaming MP4 files.
TS files.? Really
Does anyone/ anywhere say that is a good idea with plex?

MPEG2 TS files are used for recording TV from local networks over an antenna. They don’t use MP4 files (or more specifically, H264 files). Plex records the TS files directly to the hard drive via their Live TV/DVR feature. They’re quite common for DVR purposes.
I understand but Everyone (almost) converts to mp4 as that is the best format for the most number of clients.
Convert convert convert

Bumping up for the weekday crowd. I’m completely stumped on why Quick Sync can’t handle a 720p MPEG2 video, I’m hoping someone else has ideas (besides transcoding all my live TV recordings).

@“Cafe Diem” said:
Bumping up for the weekday crowd. I’m completely stumped on why Quick Sync can’t handle a 720p MPEG2 video, I’m hoping someone else has ideas (besides transcoding all my live TV recordings).

Transcoding or converting?

Converting your TS file to mp4 will stop the need to transcode.
Try 1 or 2 !!

@spikemixture said:

@“Cafe Diem” said:
Bumping up for the weekday crowd. I’m completely stumped on why Quick Sync can’t handle a 720p MPEG2 video, I’m hoping someone else has ideas (besides transcoding all my live TV recordings).

Transcoding or converting?

Converting your TS file to mp4 will stop the need to transcode.
Try 1 or 2 !!

I’m aware of the option to convert all the files to h264. Thanks. I use my Plex server in different ways than you do. I’m discussing a possible bug in the Intel Quick Sync transcoding engine on the Windows 10 platform, and hopefully a developer or similar type is reading the forum. I can provide them samples if necessary.

Ok - lets see what happens.
You are streaming TS files - there is the bug.

Highways and roads are built to drive on !
What do you do? Drive next to the road and complain it is rough and slow!!

You want a fix - Convert
That’s enough from me so no need to reply… o:)

Is there anyone visiting this forum with transcoder experience? Apologies for pinging you @sa2000, but I’m hoping someone with transcoding experience could at least confirm if this is the proper behavior for the Plex hardware transcoder using QSV for MPEG2.

I am seeing the same thing on 720p mpeg2 ts streams. Weirdly enough, the 1080i streams work fine. I have an i3-7100u nuc with all drivers up to date. PMS 1.13.2.5154. hdhr dual, wired network.

@viplob said:
I am seeing the same thing on 720p mpeg2 ts streams. Weirdly enough, the 1080i streams work fine. I have an i3-7100u nuc with all drivers up to date. PMS 1.13.2.5154. hdhr dual, wired network.

I’m still seeing it too. Really frustrating. This seems to be a Windows-specific problem because I ran some tests this weekend on Ubuntu 18.04, and Plex accelerated nearly everything, including 720p MPEG2. I’m not switching full-time to Linux for a number of reasons, but the test was illuminating.

I can’t seem to get anyone at Plex to look into it so far, unfortunately.

@“Cafe Diem” : I agree. The main reason I got plex pass was to be able to stream OTA captures of live sports events when I am away from home. I did capture clips of the problematic 720p streams and transcoded it manually with handbrake using quicksync and had no errors. One difference was handbrake was not using dxva to decode. I think the trouble maybe the interface between dxva decode -> quicksync encode. Especially since dxva decode and rendering of the same stream works fine. To summarize:

  1. dxva decode (plex media player) : OK
  2. sw decode -> quicksync encode (h…264, handbrake) : OK
  3. dxva decode -> quicksync encode (plex transcoder) : FAILS

@viplob said:
@“Cafe Diem” : I agree. The main reason I got plex pass was to be able to stream OTA captures of live sports events when I am away from home. I did capture clips of the problematic 720p streams and transcoded it manually with handbrake using quicksync and had no errors. One difference was handbrake was not using dxva to decode.

You might want to keep close watch over transcoding events, too. I’ve written up a separate post about issues with PMS sometimes failing to “kick in” hardware encode/decode on AVC and HEVC too. I’ve seen it on two different machines with different generation Intel processors. It’s a sporadic problem, so unless you’re watching the Now Playing console regularly, you may never see that it’s happening. Unlike that, the 720p MPEG2 problem is seemingly constant and easily reproducible.

https://forums.plex.tv/discussion/320550/hardware-transcoder-fails-on-first-use-after-plex-server-idle

Just bumping this to the top, on the chance someone may notice it. I have never seen hardware acceleration work with 720p MPEG2 files and Quick Sync on Windows. It works fine on Ubuntu 18.04. Is this a known problem with Windows PMS? A bug?

One-month-later bump. I was just testing this on Windows 10 with a different Kaby Lake CPU, and same problem: Unreliable hardware acceleration for transcoding overall. And it never works for 720p.

Is this really working properly for everyone else? It’s not easy to see in the logs, much easier to watch live in the Now Playing window.

Two-month-later bump, even though I’m sure it doesn’t matter. I just updated to the latest Intel drivers, and no change. Still works fine on Ubuntu other than the frustrating lack of support for deinterlacing (which makes it useless for recorded HDTV from an antenna).

I don’t suppose a dev is reading today, by any chance?

Plex Media Server beta release 1.17.0.1709 which has an updated Plex Transcoder ffmpeg should resolve the following error
[h264_qsv @ xxxxxx] Error during encoding: device failed (-17)

Release Notice here Plex Media Server