HW transcoding slow on live TV (synology)

I’m running plex on a Synology DS916+. The weird thing is, if I turn on HW transcoding, my cpu will only run at about 30%, but the video pauses and buffers every few seconds on live tv. If I run software transcoding, it the cpu is at about 90%, but no buffering. If I use hw transcoding on a blu ray rip (my rips are already h264, so it’s only doing h264 to h264, but I can verify on the web interface it is transcoding), cpu is at about 30%, and no buffering. I’m using hdhomerun connect.

So, I’m wondering, is there a difference in quick sync between mpeg 2 to h264, vs h264 to h264? My processor supports mpeg 2 decode for quick sync, so shouldn’t it work similarly? Would I be better off returning the connect for a extend so live tv is only doing h264 to h264? Anyone have a similar experience?

Oh, and I did check logs. Speed for live tv was around 1.1 for software transcoding, but only at 0.6 with hardware transcoding turned on. Shouldn’t hardware be faster?

Mpeg2 hardware decoding is not yet support in plex on Synology. So the synology is doing mpeg2 software decoding with h264 hardware encoding.

Based on comment from a plex employee, enabling mpeg2 hardware decoding is in the dev backlog. Hopefully, it will get added soon.

Hmm. Interesting. My synology is certainly trying to use hw to decode the mpeg 2 from my hdhomerun. It would be nice if it was smart enough to know it can’t, and would switch back to software.

Are you sure? On the webui, if you put your mouse over the transcode stream, what do you see on the overlay? on my syno ds418play, I see mpeg2 to h264 (hw). I don’t see the (hw) at the end of mpeg2. Also, software mpeg2 decoding use a single core only. You have a quad cores processor. When you enable hardware acceleration, you see you cpu usage dropping because of the encode side. Since the decoding is done only by 1 core, seeing 30% make sense there is a core running at 100% (just an assumption though)

Yeah, I’m sure. Hw transcode of mpeg 2 to h264 causes a buffering error every few seconds. If I turn off the hw transcode, it plays fine. You’re right, I don’t see(hw) after mpeg2, just after h264. On my overlay, i see what you do, but it plays terribly.

When I do any transcoding, it only says (hw) after what it is transcoding too. On your 416, does mpeg2 to h264 (hw) run well? (On the current version of plex).

I think you should ask this on synology thread. I m sure @ChuckPA can give a better explanation than I am.

@silence21

I am working with engineering (trying to encourage and assist completion of) enabling MPEG2 hardware decode. Hardware transcoding to H.264 is an almost trivial task for the GPU. The stuttering observed is seen because of the CPU load while performing MPEG2 decoding. It is just enough to cause the stuttering. As comparison, fully software transcoding MPEG2 -> H.264 isn’t possible on any of the Synology models except those which are Xeon based. Even those machines have severe limitations due to the model Xeon in use.

Edit: When MPEG2 is fully supported and enabled, You will see MPEG2VIDEO (hw) to H.264 (hw)

Thank you both, @ChuckPA and @rouq ! However, chuck, I can tell you my Synology DS916+ is able to take the mpeg 2 from an hd homerun connect and transcode in real time to h264 with software. It’s just barely fast enough, but it works.

As a follow up, if I switched out the connect for an extend, would I be able to direct play to Apple TV and Roku without transcoding? My understanding was that Plex transcodes live tv, rguardless of how it comes in, so the extend wouldnt work any faster than the connect, but maybe I’m mistaken. I’m trying to avoid adding another machine for the plex server, as I bought the 916 specifically for that purpose! Also, any sort of eta on that mpeg2 hardware transcode? I’d also like to avoid spending $100 more for an extend!

@silence21

Precisely my point.

It’s just barely fast enough, but it works.

It doesn’t need be that way.

Regarding HDHR models, I have the HDHR3-CC so there is no HW transcoding in the unit. SW decode of concurrent streams (16 Mbps video rate) on an i7-6700 (QNAP) is an appreciable (40-50%) load whereas playing three H.264 (hw) to web/tablets (hw) at 35+ Mbps each is a trivial 11% total load.

Does the future MPEG2 hardware decoding will improve channel switching too?

With PMS on Synology 918+ i tried:

  • TVHeadhend with TVHProxy and IPTV
  • TVHeadhend with TVHProxy and DVB-S
  • DVB-S without TVHeadend (directly attached to PMS)

All the same with round about 20 seconds for channel switching.
Other Apps (TVHClient, SAT-IP, Kodi) will switch immediately (i suppose all this apps just direct play)…

@ChuckPA:

Edit: When MPEG2 is fully supported and enabled, You will see MPEG2VIDEO (hw) to H.264 (hw)

Unfortunately I don’t see it. I have Version 1.11.0.4666 64bit Plex installed on my DS916+ and only hardware encoding is show up: Transcoding MPEG2VIDEO to H264(hw)

No verbose logging, no debug logging.

Is there a way to enable it?

Please re-read. When MPEG2 is fully supported…

At this point in time, Engineering has not enabled it for us.

@ChuckPA said:
As comparison, fully software transcoding MPEG2 → H.264 isn’t possible on any of the Synology models except those which are Xeon based.

I’m seeing the same thing as @silence21on my DS916+ . mpeg2 to h264 with full software transcode DOES work (albeit with 98% CPU), but mpge2 to h264 (hw) cannot keep up even though CPU is at ~25%. Since both are decoding mpeg2 with software and the only difference is the re-encoding using hw when hw transcoding is enabled, shouldn’t it work better and not worst than full software transcoding? Unless perhaps its an issue of one end going too fast for the other? And I’m sorry to question this, my understanding of transcoding is for sure very limited but it’s not quite adding up to me.

MPEG2 is software decoded. This is the CPU load you’re seeing.
The encoding is done in hardware.

On Now Playing you will see:

MPEG2VIDEO to H.264 (hw)

Engineering is working on MPEG2 (hw) decode right now. I have no feel for when it will be ready to test

@ChuckPA thanks. What I was trying to say is that when disabling hw transcoding, mpeg2 is also software decoded but works. Regardless Ill look forward to full transcoding capabilities. If you need any testers Ill be here :slight_smile:

Thanks, we have plenty but when it hit’s Plex Pass, please do jump in !

There will be NTSC and PAL formats to test too

@jpirotte I’m convinced that when HW Transcoding is enabled, Plex attempts to use only one core to do both MPEG2 (SW) and H.264 (HW). HW transcoding uses one core for Quick Sync, but a NAS attempting to SW decode MPEG2 with only one core is never, ever going to happen, that’s why it’s such an issue.

I’m glad @ChuckPA says MPEG2 HW transcoding is finally being worked on by engineering, I wish Plex was more up front with that, I would have bought a different HD Homerun, had I known about this problem. I assumed when they sayd HW Transcoding was supported, they meant all the features of Quick Sync.

@silence21

If MPEG2 software decode were single-threaded, the CPU would not be running at near 100% as 100% indicates all 4 cores are being fully utilized. 25% would be single core of a quad core machine.

HW encoding can only use one thread/core for the video because the CPU only has one iGPU. The point is moot because it’s so fast it doesn’t matter. Audio encoding and subsequent remux for output occurs on separate threads.

The initial release did specifically state H.264 -> H.264. It didn’t include MPEG2 in the decoding list.

@silence21 that makes perfect sense, I was wondering why the hw->sw option wouldnt just use more CPU to keep up, not thinking that the remaining CPU were actually the different cores.

@ChuckPA I can completely understand releasing it in stages, and glad to know MPEG2 is coming, it’s worth the wait and I’m sure will be useful to lots of people for DVR’d shows.

Has anyone on this thread tried the new hw transcoding preview? I posted some feedback on there but wondering if anyone else tried it specifically on Synology. While the new preview shows mpeg2video (hw) to h264 (hw), I find I have the same buffering/cpu as mpeg2 to h264(hw). It almost seems like while it says it’s doing hw -> hw it may not be as there does not seem to be any difference in performance (whether it be good vs bad, quality or speed)