Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

AAPLGeek

macrumors 6502a
Original poster
Nov 12, 2009
762
2,354
Got my base M4 Mini a few days ago and I'm slightly disappointed with its hardware encoding performance using handbrake.

Testing with a 4K DCI input and same preset across both machines, I get only 50-55fps max on my M4 Mini.

The 2020 Intel iMac with a basic i5 10500/Radeon Pro 5300 encodes the same input at over 75fps.

Not sure if Apple is employing AMD VCE or Intel QuickSync Video encoder on the Intel iMac, but I'm surprised it can still hold it's own compared to M4's built in hardware encoding engine.



M4 encoding.png

Intel encoding.png
 
Looks like HandBrake?

Lots of settings can slow down HandBrake, and I'm not sure if HB is optimized for Mx chipsets.


I'm using the latest version, default settings and same preset across both machines.

Handbrake uses native code and is fully optimized for Apple Silicon since the past 2 years. I'm just using the videotoolbox option that employs the built in hardware decoder, nothing fancy.
 
DCI 4K is 4096 × 2160.

Try to set them both at 4K UHD (3840 × 2160).

Also we have no idea of what your Bit9K preset are, so you should perhaps share the settings.

Did you start out with the "H.265 Apple VideoToolbox 2160p 4K" preset?
 
DCI 4K is 4096 × 2160.

Try to set them both at 4K UHD (3840 × 2160).

Also we have no idea of what your Bit9K preset are, so you should perhaps share the settings.

Did you start out with the "H.265 Apple VideoToolbox 2160p 4K" preset?

Setting them both at 4K limit makes no difference. M4's hardware encoder is still about 30% slower.

The Bit9K custom preset is basically everything else turned off with just H264 videotoolbox encoder and 9K bitrate, as you can see in that screenshot.
 
  • Haha
Reactions: progx
Setting them both at 4K limit makes no difference. M4's hardware encoder is still about 30% slower.

The Bit9K custom preset is basically everything else turned off with just H264 videotoolbox encoder and 9K bitrate, as you can see in that screenshot.
Try with the default preset.

Just did a 4096x2304 to 4K UHD with the settings I could glean from you and get ~154fps on an M2 Max and ~77fps on an M1, so clearly something is off with your settings.
 
Setting them both at 4K limit makes no difference. M4's hardware encoder is still about 30% slower.

The Bit9K custom preset is basically everything else turned off with just H264 videotoolbox encoder and 9K bitrate, as you can see in that screenshot.

Curious the results form each system with Profile=baseline or main? Maybe M4 less optimized for Profile=high? Interesting results regardless.
 
Try with the default preset.

Just did a 4096x2304 to 4K UHD with the settings I could glean from you and get ~154fps on an M2 Max and ~77fps on an M1, so clearly something is off with your settings.

Well I'm running the same version on both machines with default settings and a preset imported directly without changing anything else.

Did you test with H264 or H265 videotoolbox? When doing H265 with the same input, M4 was able to encode at 102fps, but the output quality was much worse at same bitrate than doing H264->H264.

When doing H264 at 4K UHD limit, it's actually more around 20% difference.


M4 with same preset at 4K UHD:

M4 4K1.png



Intel with same preset at 4K UHD:


Intel 4K1.png




Also tested M4 with default Apple preset modified to use H264 videotoolbox:



M4 4K Default Apple preset.png
 
Curious the results form each system with Profile=baseline or main? Maybe M4 less optimized for Profile=high? Interesting results regardless.

Makes no difference. Tested with Profile=auto as you can see in my last screenshot above.

Here's the preset code if anyone wants to try.

JSON:
{
  "PresetList" : [
    {
      "AlignAVStart" : true,
      "AudioCopyMask" : [
        "copy:aac"
      ],
      "AudioEncoderFallback" : "ca_aac",
      "AudioLanguageList" : [

      ],
      "AudioList" : [
        {
          "AudioBitrate" : 160,
          "AudioCompressionLevel" : -1,
          "AudioDitherMethod" : "auto",
          "AudioEncoder" : "ca_aac",
          "AudioMixdown" : "stereo",
          "AudioNormalizeMixLevel" : false,
          "AudioSamplerate" : "auto",
          "AudioTrackDRCSlider" : 0,
          "AudioTrackGainSlider" : 0,
          "AudioTrackQuality" : -1,
          "AudioTrackQualityEnable" : false
        }
      ],
      "AudioSecondaryEncoderMode" : true,
      "AudioTrackSelectionBehavior" : "first",
      "ChapterMarkers" : true,
      "ChildrenArray" : [

      ],
      "Default" : false,
      "FileFormat" : "av_mp4",
      "Folder" : false,
      "FolderOpen" : false,
      "InlineParameterSets" : false,
      "MetadataPassthru" : true,
      "Mp4iPodCompatible" : false,
      "Optimize" : false,
      "PictureAllowUpscaling" : false,
      "PictureAutoCrop" : true,
      "PictureBottomCrop" : 0,
      "PictureChromaSmoothCustom" : "",
      "PictureChromaSmoothPreset" : "off",
      "PictureChromaSmoothTune" : "none",
      "PictureColorspaceCustom" : "",
      "PictureColorspacePreset" : "off",
      "PictureCombDetectCustom" : "",
      "PictureCombDetectPreset" : "off",
      "PictureCropMode" : 0,
      "PictureDARWidth" : 4096,
      "PictureDeblockCustom" : "",
      "PictureDeblockPreset" : "off",
      "PictureDeblockTune" : "medium",
      "PictureDeinterlaceCustom" : "",
      "PictureDeinterlaceFilter" : "off",
      "PictureDeinterlacePreset" : "default",
      "PictureDenoiseCustom" : "",
      "PictureDenoiseFilter" : "off",
      "PictureDenoisePreset" : "light",
      "PictureDenoiseTune" : "none",
      "PictureDetelecine" : "off",
      "PictureDetelecineCustom" : "",
      "PictureForceHeight" : 0,
      "PictureForceWidth" : 0,
      "PictureHeight" : 0,
      "PictureItuPAR" : false,
      "PictureKeepRatio" : true,
      "PictureLeftCrop" : 0,
      "PictureModulus" : 2,
      "PicturePadBottom" : 0,
      "PicturePadColor" : "black",
      "PicturePadLeft" : 0,
      "PicturePadMode" : "none",
      "PicturePadRight" : 0,
      "PicturePadTop" : 0,
      "PicturePAR" : "auto",
      "PicturePARHeight" : 1,
      "PicturePARWidth" : 1,
      "PictureRightCrop" : 0,
      "PictureRotate" : "angle=0:hflip=0",
      "PictureSharpenCustom" : "",
      "PictureSharpenFilter" : "off",
      "PictureSharpenPreset" : "medium",
      "PictureSharpenTune" : "none",
      "PictureTopCrop" : 0,
      "PictureUseMaximumSize" : true,
      "PictureWidth" : 0,
      "PresetDescription" : "",
      "PresetDisabled" : false,
      "PresetName" : "Bit9K",
      "SubtitleAddCC" : false,
      "SubtitleAddForeignAudioSearch" : true,
      "SubtitleAddForeignAudioSubtitle" : false,
      "SubtitleBurnBDSub" : true,
      "SubtitleBurnBehavior" : "foreign",
      "SubtitleBurnDVDSub" : true,
      "SubtitleLanguageList" : [

      ],
      "SubtitleTrackSelectionBehavior" : "none",
      "Type" : 1,
      "UsesPictureFilters" : true,
      "VideoAvgBitrate" : 9000,
      "VideoColorMatrixCodeOverride" : 0,
      "VideoEncoder" : "vt_h264",
      "VideoFramerate" : "auto",
      "VideoFramerateMode" : "vfr",
      "VideoGrayScale" : false,
      "VideoHWDecode" : 0,
      "VideoLevel" : "auto",
      "VideoMultiPass" : false,
      "VideoOptionExtra" : "",
      "VideoPreset" : "quality",
      "VideoProfile" : "high",
      "VideoQSVDecode" : false,
      "VideoQualitySlider" : 21,
      "VideoQualityType" : 1,
      "VideoScaler" : "swscale",
      "VideoTune" : "",
      "VideoTurboMultiPass" : true,
      "x264Option" : "",
      "x264UseAdvancedOptions" : false
    }
  ],
  "VersionMajor" : 59,
  "VersionMicro" : 0,
  "VersionMinor" : 0
}
 
Last edited:
Got my base M4 Mini a few days ago and I'm slightly disappointed with its hardware encoding performance using handbrake.

Testing with a 4K DCI input and same preset across both machines, I get only 50-55fps max on my M4 Mini.

The 2020 Intel iMac with a basic i5 10500/Radeon Pro 5300 encodes the same input at over 75fps.

Not sure if Apple is employing AMD VCE or Intel QuickSync Video encoder on the Intel iMac, but I'm surprised it can still hold it's own compared to M4's built in hardware encoding engine.



View attachment 2476319
View attachment 2476320
QuickSync is what VideoToolbox will default to, and it was always extremely fast for H264 since all the way back to the Ivy Bridge days.

However, it also tends to produce relatively large file sizes for relatively poor quality.

When you look at the output files, make sure to compare both the quality and more importantly from a benchmarking point of view the file sizes.
 
Try the handbrake from the snapshot below.

M4 may not be optimized for your version of hand brake. You will probably have better luck on handbrake Reddit, where the handbrake developers are active.
 
It might just be that it IS faster. Power vs. PPW are very different things. Power usually translates to faster while PPW usually translates to energy efficiency. A gallon of gas in a Moped will probably get a person much further than a gallon of gas in a heavy duty truck. But if you need to haul a big load of whatever up a hill, that truck is going to do that far better than the moped.

I too am suspicious given the many years between the 2 Macs but I'll be more open minded that it could just be a fair and true head-to-head measure where old Intel is superior to latest Silicon in this way.

And if I'm someone that needs Apple to win all contests, I'll encourage you to check power draw to illustrate how much more efficiently M4 does it vs. how much faster Intel gets it done. If I can make it about power usage instead of speed, Apple can win (in my mind anyway) even if your task gets done slower.

When I embraced Silicon, I knew I would need to buy a PC too for "old fashioned bootcamp" as ARM Windows emulation is not full Windows. What I've found myself doing since is tossing more and more heavy duty loads to that PC even when they can get done on Mac. Why? Because the PC can do them faster. Yes, it uses more power to do so but not so much power that I notice a difference in the electric bill. When we spin 100watts-300watts, etc to put down PC, we're talking about 1-3 traditional lightbulbs we used to all use to light our homes. Bonus: no personal nuclear reactor required (something else so commonly slung about a topic like this). Yes, the PC will feel a little warmer but no, I can't actually cook breakfast on it.

If you don't find some missed settings and/or some future HB upgrade doesn't resolve the difference, keep using that old iMac for that task. You might even want to install Windows 11 via bootcamp and just generally give the old iMac all heavy load tasks. You may find- as I have- that power > PPW in some computing tasks.
 
Handbrake is a CPU monster, with little impact from RAM and GPU. Even so, a 6 core i5 should not be able to hold with 4 “performance” cores (and 6 efficiency cores) of the M4. If you, or anyone, figures out what the problem is (or just why it works that way) I am all ears… well, eyes I suppose…
 
QuickSync is what VideoToolbox will default to, and it was always extremely fast for H264 since all the way back to the Ivy Bridge days.

However, it also tends to produce relatively large file sizes for relatively poor quality.

When you look at the output files, make sure to compare both the quality and more importantly from a benchmarking point of view the file sizes.

It produces large files when compared to software encoding, but when compared to Apple Silicon's videotoolbox encoder, the file sizes produced are nearly identical in my testing.

8.4GB 25Mbps 4K DCI input encoded to 9Mbps using the preset above produces ~3.3GB on both Intel or Apple M4.

The video quality of the output is also pretty much identical across both machines on my 5K iMac. It also degrades in mostly identical artifacts when I try to push the bitrate further down though.


Try the handbrake from the snapshot below.

M4 may not be optimized for your version of hand brake. You will probably have better luck on handbrake Reddit, where the handbrake developers are active.

I'm using the latest version 1.9.0 that was recently updated to support M4 release, but thanks for the suggestions. I'll try the snapshot version.
 
Handbrake is a CPU monster, with little impact from RAM and GPU. Even so, a 6 core i5 should not be able to hold with 4 “performance” cores (and 6 efficiency cores) of the M4. If you, or anyone, figures out what the problem is (or just why it works that way) I am all ears… well, eyes I suppose…

It's a CPU monster only when you're using software encoding. Videotoolbox only engages the hardware encoder and unless you're using any filters, the CPU isn't used at all.
 
Are you sure you are not just reading from 1 disk and writing to another on the intel, while maybe reading and writing from/to the same useless external non-SSD on the M4?
 
Are you sure you are not just reading from 1 disk and writing to another on the intel, while maybe reading and writing from/to the same useless external non-SSD on the M4?

On Intel iMac, I'm reading and writing to the same external 5Gbps SSD.

On M4 Mini everything is done on the internal volume that's almost 5x as fast.
 
It produces large files when compared to software encoding, but when compared to Apple Silicon's videotoolbox encoder, the file sizes produced are nearly identical in my testing.

8.4GB 25Mbps 4K DCI input encoded to 9Mbps using the preset above produces ~3.3GB on both Intel or Apple M4.

The video quality of the output is also pretty much identical across both machines on my 5K iMac. It also degrades in mostly identical artifacts when I try to push the bitrate further down though.




I'm using the latest version 1.9.0 that was recently updated to support M4 release, but thanks for the suggestions. I'll try the snapshot version.

I don't know why the M4 would be slower than that iMac but one thing to note it appears that when you use VTB on a late model Intel Mac to encode H.264 or H.265, it uses the T2 chip not Intel or AMD's hardware.

FYI, here are posting of results where someone only gets ~ 30% improvement of an M2 over a 2019 MBP (note older Handbrake, older hardware, etc):

FYI here is a guide to benchmarking Handbrake which may be useful so that you can create results that be compared with those already created by others:

Last, here is previous discussion of Handbrake on Apple Silicon versus previous Macs:

Again, doesn't explain why the M4 is slower than that iMac but it's also possible the M4 isn't going to be substantially better for hardware transcoding. If the H.264/H.265 encoder used in the first Apple Silicon was more or less unchanged from the one in last of the T2 used on Intel Macs, the M4 may only end up being somewhat faster for this.
 
QuickSync is what VideoToolbox will default to, and it was always extremely fast for H264 since all the way back to the Ivy Bridge days.

However, it also tends to produce relatively large file sizes for relatively poor quality.

When you look at the output files, make sure to compare both the quality and more importantly from a benchmarking point of view the file sizes.

Did some more digging and it seems that for 2020 iMac or any other T2 equipped Macs, Intel QuickSync isn't used at all. The T2 chip handles all the hardware video encoding, which is basically the Apple A10 chip.

Edit: User bzgnyc2 basically confirms my findings in the above post.
 
Last edited:
Did some more digging and it seems that for 2020 iMac or any other T2 equipped Macs, Intel QuickSync isn't used at all. The T2 chip handles all the hardware video encoding, which is basically the Apple A10 chip.


Makes no sense that A10 would be faster than M4 chip at H264 hardware encoding.

Ah, that makes sense in terms of the T2. I stand corrected (never had a Tx Mac myself).

But equally this is fixed function ultra low power hardware and isn’t likely to have changed much in the intervening years. I don’t think H264 optimisation is much of a target these days and I doubt Apple felt the encoder needed much by way of changes.

As for why it would perform better on your iMac, I have no idea, but it wouldn’t surprise me if the encoder blocks were largely similar on both machines and we’re seeing some kind of software quirk.
 
  • Like
Reactions: AAPLGeek
Try to set the encoder preset to "performance".
VideoToolbox on Apple Silicon has got two quality settings, while on Intel setting "performance" or "quality" will make zero difference, another difference is that on Apple Silicon supports the constant quality mode, and on Intel it doesn't.
Plus those are still two totally different hardware encoder, the resulting quality might vary a lot.

Anyway, the bottleneck might be in the decoder, some things are still not optimized for ARM yet.
 
It's a CPU monster only when you're using software encoding. Videotoolbox only engages the hardware encoder and unless you're using any filters, the CPU isn't used at all.
Using the Handbrake 1.9.0 that reckons is upto date

Encoding an FCP X master file output .mov file with the H.265 Apple VideoToolBox 1080P default preset and ALL filters are Off.
Encoding at 340fps on M1 Studio Base System
HandbrakeXPCService is using 868% CPU
Handbrake itself is 0.4%
VTEncoderXPCService is using 8.4%
96.11Gb Source File 1080 resolution
Activity Monitor shows around 90%+ for CPU Load

Take the original .mpg file tv record file and then the same preset

Encodes at 467fps
HandbrakeXPCService is 336%
Handbrake itself is 0.5%
VTEncoderService is 13.6%
4.75Gb Source File 1080 resolution
System floating around 30% CPU in Activity Monitor for CPU Load

Is definitely using my CPU Cores when encoding with the VideoToolBox

Tried the Production Max preset as no filters set there and H.264 (x.264) so no hardware

And the same FCP X output file is 40fps and HandbrakeXPCService is 950%+ and CPU in activity is topping out.
Handbrake Service is 0.2
VTEncoderXPCService not showing up as being used of if is so low that not populating onto the screen.

And yes it is showing as Apple as the Kind for the Program Core so don't have an Intel Mac version installed by mistake.

The larger source file definitely takes a lot more CPU to service into the VTEncoderXPCService

But my CPU Cores definitely seem to be in use even with the VideoToolBox Encoder set and no Filters in Handbrake.
 
Useful article comparing transcoding times and what's happening using Quicksync alone, Quicksync and T2 together and neither Quicksync nor T2 at: https://appleinsider.com/articles/1...t-difference-in-video-encoding-for-most-users

This suggests "VideoToolbox taps into the T2 if available, and any Intel QuickSync support that any given machine has". This may go some way towards explaining how both processes used together in the older system may be so effective against just the T2-like hardware encoder built in to newer M series media engine(s).
 
  • Like
Reactions: john123 and bzgnyc2
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.