Apple's T2 chip makes a giant difference in video encoding for most users

13»

Comments

  • Reply 41 of 56
    cgWerkscgWerks Posts: 2,952member
    lorin schultz said:
    It's not impossible that could happen, but the odds weigh in your favour by using the T2 preset. You stand a MUCH higher chance of causing compatibility problems by messing around with encoding settings in Handbrake.
    True, though just for clarity, there is no T2 preset in Handbrake. You actually have to set your own settings or use another preset and then just change 'Video Encoder:' on the video tab to use "H.265 (VideoToolbox)" and then play with the bitrate until you're happy.

    Screenflow has an actual preset. You just switch to manual (instead of automatic) and then pick the "HEVC" preset.

    I guess this quote (while marketing speak) from Apple on the mini's pages support the idea it's for pro work:
    "T2 also features HEVC video transcoding that’s up to an incredible 30 times faster, enabling pro users to work more quickly with higher resolution video throughout their workflow."

    Since I'm mostly working with 1080p output, I guess I'm not even realizing most of the benefits. From a bit of reading I've done, the real benefits start showing up at 4K and above.
  • Reply 42 of 56
    cgWerks said:
    [...] there is no T2 preset in Handbrake. You actually have to set your own settings or use another preset and then just change 'Video Encoder:' on the video tab to use "H.265 (VideoToolbox)" and then play with the bitrate until you're happy.
    I don't yet have either a T2-equipped Mac or even a current OS so I can't check myself:

    Do I understand correctly that selecting the "H.265 (VideoToolbox)" encoder in Handbrake disables some of the parameters that can be adjusted with other encoders? I suspect the controls it hides are the ones that could cause compatibility problems.

    I haven't had occasion to work in 4K yet either, so I wonder whether or not I should be using H.265 at all. An article on this site many months ago gave me the impression that the picture quality is not as good as H.264, but it's important to note that I haven't tried it myself and may even have misread or misunderstood what the article was saying. Also, I don't know whether or not H.265 decoders are as ubiquitous as H.264. I assume support must be pretty widespread, but will clients with older systems be able to play it without having to manually install a CODEC?
  • Reply 43 of 56
    tipootipoo Posts: 1,141member
    I'm curious then - with the right settings, would there be areas the new Macbook Air is faster than the T1 Macbook Pros or prior? 

    Everyone was just finding it way slower than the nontouchbar Pro, but given that there are specific encode settings you need to hit T2, I wonder if that was it. 


    cgWerks said:
    MacPro said:
    Great article.  The new Mac Pro will be tricked out for the fastest encoding I am quite sure ... 🤞🏻
    Yes, for sure... great article. Yeah, I'm sure the new Mac Pro will have the T2 chip. :) Maybe even a bunch of them? I wonder if they could run them in parallel somehow.


    I bet Apples style would rather be fitting the performance they were aiming for in a monolithic T3. 

    If T2 is a derivative of A10, T3 being based on A12 would make it faster at Javascript than many macs which is kind of funny haha...I wonder if they would move more user facing loads that could benefit from it onto it. Hey, run this helper thread, these background downloads, etc.

    Also for lower end macs like the Air, using that A12 GPU rather than Intels would be interesting. 
    edited April 2019
  • Reply 44 of 56
    thttht Posts: 5,420member
    tipoo said:
    cgWerks said:
    MacPro said:
    Great article.  The new Mac Pro will be tricked out for the fastest encoding I am quite sure ... 🤞🏻
    Yes, for sure... great article. Yeah, I'm sure the new Mac Pro will have the T2 chip. :) Maybe even a bunch of them? I wonder if they could run them in parallel somehow.

    I bet Apples style would rather be fitting the performance they were aiming for in a monolithic T3. 

    If T2 is a derivative of A10, T3 being based on A12 would make it faster at Javascript than many macs which is kind of funny haha...I wonder if they would move more user facing loads that could benefit from it onto it. Hey, run this helper thread, these background downloads, etc.

    Also for lower end macs like the Air, using that A12 GPU rather than Intels would be interesting. 
    If the next gen Macs stay Intel and have a “T3”, having a built-in GPU in a T3 is a really good idea imo. It frees them from getting a discrete GPU for most models, like the iMac 21.5, MBP15 and lower. 

    They will need to have something like 20 of those A12 GPU cores though, and probably fuse off cores to tailor for certain Mac models. 20 of those A12X cores, with appropriate memory subsystem, will be about 70% more performant than a Vega 20, basically in Radeon Pro 580 territory. So, suitable for the MBP15 and iMac 21.5 models in 2020. Fuse off 8 of the cores, it would be able Vega 20 performance and suitable for the MBP13 and Mac mini. I suppose the MBA and the MB, if it is still around, sticks with the T2 and Intel processors graphics.

    There are a lot of wins with having a built-in GPU in a “T3”, it would be amazing if Apple hasn’t thought of it. Just from the perspective of the MBP15, it would free up PCIe I/O, which could be used for another set of TB3 ports or faster NAND storage.
    cgWerks
  • Reply 45 of 56
    cgWerkscgWerks Posts: 2,952member
    lorin schultz said:
    I don't yet have either a T2-equipped Mac or even a current OS so I can't check myself:

    Do I understand correctly that selecting the "H.265 (VideoToolbox)" encoder in Handbrake disables some of the parameters that can be adjusted with other encoders? I suspect the controls it hides are the ones that could cause compatibility problems.

    I haven't had occasion to work in 4K yet either, so I wonder whether or not I should be using H.265 at all. An article on this site many months ago gave me the impression that the picture quality is not as good as H.264, but it's important to note that I haven't tried it myself and may even have misread or misunderstood what the article was saying. Also, I don't know whether or not H.265 decoders are as ubiquitous as H.264. I assume support must be pretty widespread, but will clients with older systems be able to play it without having to manually install a CODEC?
    Hmm, I haven't noticed any parameters that can't be adjusted when selecting it, but I might just not have noticed. I picked and/or setup the preset first, and then just changed that video codec selection from h.264 to the h.265 one. Then, I think I upped the bitrate a bit too, based on some forum posts I read.

    Yeah, I've also seen some posts about the quality thing, but don't understand it. I don't really see the difference, but I'm not comparing them side-by-side, frame-by-frame or anything like that. They just look decent to me. :) And, yes, I've also read that you don't start really getting the benefits until somewhere around 4k, but the benefits for me are more on the encoding-time/power side of things, not the storage/quality side of the output. (I think most of the talk is more about the size/quality things for the end results for people storing their ripped movies and such.)

    Yes, compatibility is a thing. For example, YouTube just started allowing it as a format not too long ago. I think most relatively new Mac and iOS devices support it. I don't know outside of that. But, everything in my home pretty much does, so that covers my uses so far (YouTube production and home media).

    My only big disappointment at the moment, is that Plex seems to think the iOS devices don't support it, so it wants to transcode movies a family member might want to 'sync' to their device (vs stream). So, say you're heading out on a road-trip and the kiddo wants to pull a few movies to the iPad... well, Plex starts converting them which might take hours. But, that's more a stupid Plex thing which they will hopefully fix one day (though, there have been tickets open on it since 2013... so maybe I shouldn't hold out too much hope?).

    tipoo said:
    I'm curious then - with the right settings, would there be areas the new Macbook Air is faster than the T1 Macbook Pros or prior? 
    Everyone was just finding it way slower than the nontouchbar Pro, but given that there are specific encode settings you need to hit T2, I wonder if that was it. 
    I can't run a test, but I'm guessing that yeah... if the MB Air w/T2 crunches HEVC videos anywhere near as quickly as my 2018 mini (which, I don't see why it wouldn't, unless a T2 isn't the same between machines) it is probably faster than pretty much any non-T2-equipped Mac at encoding h.265. It would be interesting to put like a 12 or more core machine up against it using the CPUs, but I think the T2 would beat that.

    As I think I posted earlier (in this thread even?), using the T2 on my mini vs the i7 6-core yields the following results:

    h.264 = 8 min 32 sec ; h.265 = 2 min 55 sec

    Of course, I don't know what would happen if both were h.265, but I don't know how to turn the T2 off, and from what I've read, non-T2 equipped machines get even more glacially slow trying to do h.265 than h.264... so if a non-T2 machine did my example above, it might be like 20-40 minutes or something.

  • Reply 46 of 56
    DuhSesameDuhSesame Posts: 1,278member
    tipoo said:
    I'm curious then - with the right settings, would there be areas the new Macbook Air is faster than the T1 Macbook Pros or prior? 

    Everyone was just finding it way slower than the nontouchbar Pro, but given that there are specific encode settings you need to hit T2, I wonder if that was it. 


    cgWerks said:
    MacPro said:
    Great article.  The new Mac Pro will be tricked out for the fastest encoding I am quite sure ... ߤﻦlt;/div>
    Yes, for sure... great article. Yeah, I'm sure the new Mac Pro will have the T2 chip. :) Maybe even a bunch of them? I wonder if they could run them in parallel somehow.


    I bet Apples style would rather be fitting the performance they were aiming for in a monolithic T3. 

    If T2 is a derivative of A10, T3 being based on A12 would make it faster at Javascript than many macs which is kind of funny haha...I wonder if they would move more user facing loads that could benefit from it onto it. Hey, run this helper thread, these background downloads, etc.

    Also for lower end macs like the Air, using that A12 GPU rather than Intels would be interesting. 
    We didn’t know what frequency the T2 runs on, nor how many cores it have.  It’s possible just one Fusion core.

    I think T2 also served as a test platform for the company, and when they finally rolls out the true processors, it will served as a chipset, that combines all necessary controllers.
    edited April 2019 cgWerks
  • Reply 47 of 56
    Mike WuertheleMike Wuerthele Posts: 6,858administrator
    Mb1011 said:
    Any chance of testing the h.264 videotoolbox encoder via ffmpeg on the 2018 Mac Mini to see if thats taking advantage of the T2. Here's a simple Terminal command to test h.264 video encode speed:

    input=path/to/file/input.mov
    output=path/to/file/output.mov
    TIMEFORMAT='%0lR'
    time ( ffmpeg -hide_banner -i $input -c:v h264_videotoolbox -b:v 10000k -pix_fmt yuv420p -an $output)

    Is there a way to know if this is happening on the T2 or the iGPU?
    FWIW, there's an explicit Handbrake videotoolbox option for H.264 encoding, and a quick Google about it says that it works for acceleration there too. I'll see if I can't get this done in the next few days.
  • Reply 48 of 56
    cgWerkscgWerks Posts: 2,952member
    Mb1011 said:
    The H.264 VideoToolbox encoder will take advantage of Intel Quicksync enabled iGPU's, but the T2 chip would have no effect when using this codec. The H.265 VideoToolbox encoder will use the T2 chip for significantly faster encoding.
    That would be interesting to try. I haven't gotten around to trying the H.264 VideoToolbox vs other H.264. But, the T2 does greatly accelerate H.265 VideoToolbox, yes. Good questions though.
  • Reply 49 of 56
    cgWerkscgWerks Posts: 2,952member
    Mb1011 said:
    If you do have time to test this it would be much appreciated. h264_videotoolbox via ffmpeg is already extremely fast on my 2015 MacBookPro with the integrated Intel Iris Pro GPU, so I would be very interested to see if this now gets offloaded and further bumped by the T2 - perhaps having the 'GPU History' window up in Activity Monitor during encode will confirm this.
    I'll see what I can do... hopefully soon. So, basically compare h.264 non-videotoolbox against h.264 video toolbox against h.265 video toolbox for the same source? Part of my problem is that I don't know enough to know I've got everything else (settings wise) pretty much equal.

    Also, I don't have a machine w/o the current CPU/Intel chipset to determine what the T2 is doing vs something about the CPU/chipset. (Also, note that I have a Blackmagic eGPU... but I don't think that impacts these kind of encoding jobs).
    Mb1011
  • Reply 50 of 56
    cgWerkscgWerks Posts: 2,952member
    Mb1011 said:
    ... with a 24fps 1080p ProResHQ clip ...
    If you happen to know of some good sample clip out there I could download and run... otherwise I’ll just pick some screen recorded source material or something like that (but it probably won’t be those specs).

    If we had the same source-clip we all ran, I suppose other people could chime in with other systems if they like, too.

    I run most of my work out of ScreenFlow or Handbrake, so I just use the various settings in those and tweak them. But, using the CL is a good idea to be sure about the settings. :)
  • Reply 51 of 56
    cgWerkscgWerks Posts: 2,952member
    So, here are the results I got...

    h264_videotoolbox

    speed= 3.1x (no TB 3.09x)    
    video:48660kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.016011%
    GVA encoder info: deleteSCDMetalContext : texture cache hits: 2700, misses: 6
    0m18s (no TB 0m18s)
    50.3 MB output file
    (Turbo Boost) CPUs 164% - Radeon 580 100% (on GPU history graph)
    (no Turbo Boost) CPUs 216% - Radeon 580 100% (on GPU history graph)

    hevc_videotoolbox

    speed=6.37x (no TB 6.32x)    
    video:35695kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.021351%
    0m8s (no TB 0m8s)
    37.2 MB output file
    (Turbo Boost) CPUs 345% - Radeon 580 (0% - not visible on GPU history graph)
    (no Turbo Boost) CPUs 461% - Radeon 580 (0% - not visible on GPU history graph)

    You mentioned you got '188fps / 7.8x realtime with the h264_videotoolbox' so that is quite a bit faster than mine, but maybe the non Intel GPU. Also, I wonder if the HEVC was using the T2, as it used quite a bit more CPU than I'd have expected, though the time did drop.

    If you have a CL for a non-videotool box version of either, that might be interesting to try. I also didn't have ffmpeg installed, so I found a DMG binary version and put it in my /usr/local/bin which seemed to work. But, I don't know if there are any other tricks.

    Just out of curiosity, I ran it through my Handbrake HEVC preset, and got: 34.6 MB output, ~12s (but a bit hard to tell exactly), 125 fps (or about 5.2x). It didn't use the GPU, but did run the CPUs up to 700-800%.

    Update:

    Hmm, so I got curious and decided to disconnect the eGPU and use the internal Intel 630. Oddly, I actually got better numbers (for the h.264), so the QuickSync stuff must have to do with the iGPU, not the CPU? I got a bit better numbers for the HVEC... which didn't seem to run the iGPU/eGPU in either case, but must have a slight impact.

    Intel 630 - h264_videotoolbox

    speed=10.1x  (8.73x no Turbo Boost)    
    video:48625kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.015902%
    0m5s (0m6s no Turbo Boost)
    (Turbo Boost) CPUs 740% - Intel 630 50% (on GPU history graph)
    (no Turbo Boost) CPUs 760% - Intel 630 50% (on GPU history graph)

    Intel 630 - hevc_videotoolbox

    speed=5.75x (5.72x no Turbo Boost)
    video:35695kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.021351%
    0m9s (0m9s no Turbo Boost)
    (Turbo Boost) CPUs 309% - Intel 630 (not visible on GPU history graph)
    (no Turbo Boost) CPUs 421% - Intel 630 (not visible on GPU history graph)

    Also, just for note, this is a 2018 Mac mini - i7 (6-core) - 16 GB of RAM - 256 GB SSD
    edited June 2019 Mb1011
  • Reply 52 of 56
    cgWerkscgWerks Posts: 2,952member
    Mb1011 said:
    It actually will be very interesting to see the CPU encode speeds on the 2018 i7 MacMini with these default commands.
    Again, thank you so much for doing this.
    And, thank you for the analysis of what is probably going on! I think I'm learning some stuff, lol. :smile: 

    So, here are those CPU-encode numbers (note: I ran with the eGPU. It didn't show any use on the graph):

    h264 (NON-videotoolbox)

    Turbo Boost
    1.82x - 0m31s CPUs 1150%

    no Turbo Boost
    1.66x - 0m33s - CPUs 1140%


    hevc (NON-videotoolbox)

    Turbo Boost
    0.777x - 1m12s CPUs 1030%
    (cpu jumped around a good bit, so just rough average... fans spun up good)

    no Turbo Boost
    0.725x - 1m17s - CPUs 1030%
    (again, cpu jumped around, less fan noise)


    So, this is why people w/o a T2 chip DON'T use HEVC, heh (Take your pick... 1m12s or 0m8s ?). I was in a thread on the Screenflow forum where someone was talking about how glacially slow the HEVC preset was... and I was like, no, it's super-speedy. It's the T2. Again, I'd like to see if the new MacBook Air gets these kinds of numbers, but I suspect it would (maybe slightly less). Also, for people who might do HEVC, debating an older used Mac vs new (like say a cylinder MP vs mini, like I originally was) this could be very important.

    Is there a downside to using HEVC? (I can't tell much difference between the output quality of those various test runs. They all 'softened' it a bit, but the input footage isn't the kind of video that makes it easier to tell. They all look pretty good, especially given the size differences. orig 3.33 GB; h264 50 MB; hevc 36 MB)

    Also, I think this shows why I just run with Turbo Boost off most of the time. I love the more cores, but Turbo Boost doesn't help much and runs the fans up more. I don't quite get why the fans run up more with so little difference in actual output. I guess maybe Turbo Boost just tips it over the edge of thermal capabilities (ie: thermal throttling)? So, it's trying harder but being brought back in-line by thermals? Anyway, I just like a quieter machine, especially for so little gain. I'm sure other workflows would show a bigger difference, or would they? (Like Cinebench r20, I get 2759 cb w/TB, 2591 cb w/o TB... so not that huge, but my eGPU might have impacted that too much. I didn't try without.)

  • Reply 53 of 56
    cgWerkscgWerks Posts: 2,952member
    Mb1011 said:
    HEVC's biggest advantage is same quality at lower data rates. Interesting note about Turbo Boost. I've never played with that. Just gave it a go and I see about a 20% drop in encode performance on this old system with TB off. Fans do go nuts with TB on!
    re: HEVC - good to know about quality. What I was afraid of, is that maybe I was trading off something I wasn't aware of, to get that speed increase. I'm mostly using it to encode DVD/Bluray rips, as well as encoding videos to upload to YouTube.

    re: TB - Yeah, it seems to be less than 20% most of the time for me. But, since turning it off, I hardly ever hear the fans spin up (I know they are on, but the city 'noise floor' is high enough to drown them out below a certain level). When TB was enabled, it seemed like the system was quite touchy as to spinning them up and down for any little thing that took some CPU power. With it off, they only spin up when I'm doing a longer encoding job.
    Mb1011
  • Reply 54 of 56
    cgWerkscgWerks Posts: 2,952member
    Mb1011 said:
    That should have said "With your Intel GPU and T2 chip I should think you can happily choose between h264_videotoolbox and hevc_videotoolbox without too much issue! Its a great little box." 
    Yeah, I wonder if there is a way to pick the Intel GPU when I'm running the Blackmagic eGPU. It is a pain to switch (shutdown, switch cables, etc.). That said, unless I'm doing h264 for some specific reason, I'll probably do nearly everything now in HEVC.
  • Reply 55 of 56
    cgWerkscgWerks Posts: 2,952member
    Mb1011 said:
    At the app level, can't you choose the preference to use eGPU from the Info menu in Finder?

    For more obscure system components maybe you can get this done using the "set-egpu" tool. I can't link to it (I don't think) as forum seems not to accept external links, just search for that name, its on GitHub. Imagine you'll need to play around with the setup to get in affecting macOS frameworks, if it's even possible.
    Hmm, interesting. I hadn't thought about that setting. I'll have to try that some day. Though, as mentioned, I doubt I'll even do much h264 anymore for my needs.
Sign In or Register to comment.