iMac Pro iMac Pro HEVC / H265

Discussion in 'iMac' started by Trebuin, Jan 15, 2018.

  1. Trebuin macrumors 65816

    Trebuin

    Joined:
    Jun 3, 2008
    Location:
    Central Cali
    #1
    So I've noticed VLC has done a horrible job playing HEVC, & that led me to assume there's no hardware decoding support of HEVC on the iMac. For grins, I tried Blu-Ray Player Pro & found that has no problems playing HEVC at all...IOW, VLC stinks at decoding HEVC right now by default. There may be a setting, but I don't know yet.
     
  2. BeatCrazy macrumors 68000

    Joined:
    Jul 20, 2011
    #2
    Reposting myself from the MacBook sub forum, but here is my recent experience:

    I downloaded this 10-bit 4K HDR HEVC "Sony camp" video. It plays back on this machine perfectly smooth, using ~8% CPU. Since this machine has Xeon processors with no Intel Quick Sync Video, I have to assume that Apple has optimized the built-in AMD Radeon Pro Vega 56 to support decoding of 10-bit HEVC?
     
  3. gian8989 macrumors regular

    Joined:
    Oct 23, 2015
    #3
    VLC is horrible regardless. Just use IINA.
     
  4. joema2 macrumors 65816

    joema2

    Joined:
    Sep 3, 2013
    #4
    I assume you mean it plays back smoothly with low CPU load using QuickTime Player 10 running on High Sierra on an iMP?

    Yes that implies Apple is using some kind of hardware acceleration on the iMP, whether that be a custom Xeon with Quick Sync or they are calling the decode/encode logic in AMD's GPU, called UVD and VCE.

    Re VLC, it does not currently use Quick Sync on Mac, but they plan to add this (playback only) for version 3. The current Mac VLC version is 2.2.8, so ver. 3 might be pretty far out.

    However even if VLC adds this it might not help on an iMP (or future Mac Pro) if those don't have Quick Sync. In that case VLC would have to add calls to AMD's UVD/VCE logic. I'm not sure what the chance of that happening is.

    A similar situation exists with HandBrake. There is currently no support for Quick Sync on Mac versions, although there's an experimental source code tree you theoretically could build yourself using xcode. Like VLC even if HandBrake eventually added Quick Sync calls to released builds, if the iMP or future Mac Pro don't have Quick Sync it would not help. HandBrake would also have to add API calls to AMD's UVD/VCE logic.
     
  5. BeatCrazy, Jan 15, 2018
    Last edited: Jan 15, 2018

    BeatCrazy macrumors 68000

    Joined:
    Jul 20, 2011
    #5
    Correct.

    Seems like they'd be using the AMD vs. have Intel re-engineer the Xeon? Plus, since this Xeon is Skylake-based, it technically wouldn't/shouldn't have 10-bit HEVC decode support, even if it had Quick Sync.

    I wonder if there's anything I can do to test if the Vega is doing the HEVC decode?
     
  6. joema2 macrumors 65816

    joema2

    Joined:
    Sep 3, 2013
    #6
    I don't know of a utility to inspect this, but the Intel CPU info site doesn't list any CPU with eight or more cores as having Quick Sync: https://ark.intel.com/Search/

    IF that is correct then the Xeon-W in the iMP doesn't have it, which by process of elimination means any Mac software exhibiting accelerated encode/decode performance on the iMP is probably using the specialized logic on the Vega GPU.
     
  7. h9826790 macrumors G4

    h9826790

    Joined:
    Apr 3, 2014
    Location:
    Hong Kong
    #7
    Can you post the video link and may be with some screen capture to show the resource usage during playback?

    At this moment, this is the only post that shows Apple may activated Vega's video engine.
     
  8. BeatCrazy macrumors 68000

    Joined:
    Jul 20, 2011
    #8
    Videos are here: http://www.4ktv.de/testvideos/

    I used: Camp (Nature) 4K HDR Demo (Sony) h.265 (HEVC) 3.840 x 2.160 Ja 75.8 Mbit/s 59.94 10 bit 2:07

    I can post a screen grab of Activity Monitor later today, as I'm at work now.

    I tried the same video on my Late 2013 Mac Pro with dual D300s. Video was practically unwatchable on that machine, even with High Sierra.
     
  9. h9826790 macrumors G4

    h9826790

    Joined:
    Apr 3, 2014
    Location:
    Hong Kong
    #9
    Thanks for the reply. Will wait for your update, please take your time. This may be interesting for cMP users (or eGPU users) if can get any HEVC hardware acceleration from the Vega.
     
  10. BeatCrazy macrumors 68000

    Joined:
    Jul 20, 2011
    #10
    Based on some digging I was doing a few weeks ago, the HEVC hardware acceleration was not enabled via eGPU. That could obviously change "this Spring" with whatever further enhancements Apple is doing to better support eGPUs.
     
  11. mikeboss macrumors 65816

    mikeboss

    Joined:
    Aug 13, 2009
    Location:
    switzerland
  12. h9826790, Jan 15, 2018
    Last edited: Jan 15, 2018

    h9826790 macrumors G4

    h9826790

    Joined:
    Apr 3, 2014
    Location:
    Hong Kong
    #12
    Just did some test with that video. I think there is nothing to do with the GPU acceleration, but just because the iMac Pro has a stronger CPU.

    When I use Preview and QuickTime Player. The CPU usage is low anyway. And this is on my ancient Mac Pro 5,1 with the old Xeon. The video is definitely not smooth, but it plays.

    Preview: The CPU load history shows that the CPU is intermittently used, every time when the usage drop to zero, the video will be freeze for a moment (choppy).
    Screen Shot 2018-01-16 at 00.53.41.jpg

    QuickTime Player: Basically the same as Preview (of course, preview is actually using the QuickTime player in the background)
    Screen Shot 2018-01-16 at 00.55.15.jpg

    IINA: playable, not smooth, and high CPU usage.
    Screen Shot 2018-01-16 at 00.57.04.jpg

    VLC: Low CPU usage, but there is no "video" at all, it's always stay at the same frame. Click on the time line will move to a new frame, music normal, but no video.
    Screen Shot 2018-01-16 at 00.58.38.jpg

    Even on my W3690, the average CPU usage to play this video (in QuickTime) is just above 20%. I can imagine on the iMac Pro, the CPU usage can further lower to about 10%. Which actually match your observation.

    Also, it seems this video is actually not that demanding (In QuickTime), but it's the 10bit causing trouble in the old system. I downloaded the little bit higher bitrate but 8bit video sample. My Mac can actually play it smoothly with more or less the same CPU usage (except VLC, still no "video" at all).

    Up to this stage, I tend to believe that there is no hardware video acceleration (H264 and H265) on the iMac Pro (in MacOS). But simply because the CPU is "too strong", and QuickTime is coded to "use less resource", but not "smooth playback". Therefore, create an illusion that looks like iMac Pro has H265 hardware decode.
    --- Post Merged, Jan 15, 2018 ---
    Thanks, just tried the latest V4 nighty build. Still no joy with the 10 bit sample.

    But 8bit can play smoothly with around 600% CPU, better then IINA actually.
     
  13. Trebuin thread starter macrumors 65816

    Trebuin

    Joined:
    Jun 3, 2008
    Location:
    Central Cali
    #13
    I've check out HVEC decode, VLC4 is using about 15% of my GPU (istats menu will show you). My Blu-ray player only uses about 5% & doesn't decode well...probably why the performance seems better.
     
  14. joema2 macrumors 65816

    joema2

    Joined:
    Sep 3, 2013
    #14
    It's very likely the iMac Pro has some kind of hardware acceleration and FCPX is using that, at least for 1080p H264. It's definitely not just more/faster CPU cores. In my tests the entry-level 8-core Vega 56 iMac Pro was about 3x faster at encoding 1080p H264 video than a top-spec 12-core D700 Mac Pro. The only way to get that much speed increase is hardware acceleration.

    On HEVC/H265 I haven't tested that but HEVC is much more compute-intensive than H264 and without some kind of hardware acceleration I'd expect it to be quite sluggish.

    You can't meaningfully accelerate long-GOP encode/decode (like H264 or H265) with normal CPU methods or with normal GPU parallel methods. The processing within each GOP cannot be parallelized due to the sequential algorithm. In theory each GOP can be processed separately, and most software will dispatch those to multiple cores, but there are often hundreds or thousands of GOPs in a file so 8 cores vs 12 cores doesn't make much difference. Normal GPU methods also cannot be used because a single lightweight GPU thread isn't effective processing one GOP and you can't use multiple GPU threads per GOP because of the algorithm. The only way to speed it up is using hardware, whether that's Intel's Quick Sync, AMD's UVD/VCE or nVidia's NVDEC/NVENC.

    The problem is whichever of those is available, both operating system and each separate application must write to the relevant APIs using the proper software development framework. On Windows that is Intel's Media SDK and on Mac it is the VideoToolBox framework.
     
  15. BeatCrazy macrumors 68000

    Joined:
    Jul 20, 2011
    #15
    So what could I do to test/confirm these theories? I don't use Boot Camp, but I'm mainly concerned on how macOS would/could support this anyways.
     
  16. Outsiderdude26 macrumors regular

    Joined:
    Jul 29, 2005
    Location:
    New England
    #16
    To my recollection High Sierra decodes/encoded HEVC through AVfoundation. IINA, VLC and Handbrake tend not to use closed source API/Libraries in their project as they tend to be multiplatform.

    This is also one of the reasons why Handbrake doesn't use the videotoolbox API (Quicksync). Last time they tried to incorporate it is was having a negative effect on their encoder, the was over a year ago and no one has tried to fix it.

    So for now Quicktime does hardware HEVC decoding. VLC and Handbrake will probably never use AVfoundation, so it's going to be all software encoding/decoding. IINA is based on MPV, so it might AVfoundation but won't hold my breath.

    There might be other media players that are build on AVfoundation the could salve this.
     
  17. BeatCrazy macrumors 68000

    Joined:
    Jul 20, 2011
    #17
    If that is the case, then why would 10-bit HEVC be decoded/perform so well just via the Xeons? Do we think the Xeon W-2140B is just really that strong?
     
  18. Trebuin thread starter macrumors 65816

    Trebuin

    Joined:
    Jun 3, 2008
    Location:
    Central Cali
    #18
    Surprisingly, I already mentioned that it is hardware accelerated. I'll post a test of the proof in a few mins.
     
  19. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #19
    This is just a though and I have no sources for this, but could the T2 be providing hardware decoding for it? It's been speculated that the T2 is based on the A10 or A11, both of which have hardware support for HEVC and H264. If that's true, Apple could be using it in the iMac Pro.
     
  20. Trebuin thread starter macrumors 65816

    Trebuin

    Joined:
    Jun 3, 2008
    Location:
    Central Cali
    #20
    Nice point!
     
  21. h9826790 macrumors G4

    h9826790

    Joined:
    Apr 3, 2014
    Location:
    Hong Kong
    #21
    This is what I am thinking as well. I tried some search in the last few days, but couldn't get any answer.

    In fact, this is the best way for Apple to provide hardware video acceleration to the iMac Pro, and at the same time, no need to activate the Vega's video engine. Therefore, all Mac Pro or eGPU users has no way to benefit from it (even Apple can make some artificial lock, but as long as the function is there, people may figure out how to activate it. The best way to avoid it is by not using it at all)
     
  22. Outsiderdude26 macrumors regular

    Joined:
    Jul 29, 2005
    Location:
    New England
    #22
    It could be that. Or as Intel suggested that the T2 could be providing hardware decoding. Apple has not stated that the T2 has any h.264/HEVC hardware. We might have to wait and see until someone, either iFixit or Chipworks finds out.
     
  23. Trebuin thread starter macrumors 65816

    Trebuin

    Joined:
    Jun 3, 2008
    Location:
    Central Cali
    #23
    Ok, if the T2 is doing some of the work, it's helping the GPU. My confirmation would not have produced a significant GPU hike. To produce this, you need a very large 4k HEVC video. The CPU was not even bumped by playing the video. Likely, VLC is pretty poor at playing this. Also, quicktime does not recognize HEVC files of any container for me.
    Samsung.jpg

    fixed
     
  24. BeatCrazy macrumors 68000

    Joined:
    Jul 20, 2011
    #24
    IFixit thinks the T2 die size is too small to be a modified A10/A11.
     
  25. h9826790 macrumors G4

    h9826790

    Joined:
    Apr 3, 2014
    Location:
    Hong Kong
    #25
    There is no doubt that the GPU need to do something when playing 4K video, but not necessary means the GPU is doing hardware decoding.

    On my Mac Pro, 100% no hardware acceleration available when using VLC to play 4K HEVC video, but the GPU still has ~20% loading. It may be just because need to drive the pixels.
    Screen Shot 2018-01-16 at 06.26.40.jpg

    From your CPU usage, I totally agree that there should be some hardware decoding, but can't tell if it's from the GPU. If it's really from the Vega, that will be a great news.
     

Share This Page