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

JohnDoe12

macrumors member
Original poster
Nov 14, 2017
71
52
iOS A-series chips have had hardware H265 encoding for years. I have heard that this hardware acceleration has finally come over to Macs with the new M1 series chips. I would like to ask someone with an M1 Mac to try out the following benchmark:

1. Download the 30MB 720p sample video from here. See post #19 for better test files
2. Open Handbrake. Try using the beta meant for M1 Macs found here
3. Drag the video file onto the Handbrake window
4. Choose the preset Matroska > H.265 MKV 720p30 (edit: apparently this uses software encoding, see discussion below)
5. Start the encode and note the average fps number at the bottom when the encode is about the finish. Alternatively you can view this average fps in the log.

On my 2020 MacBook Pro (4 ports, i5) my average encoding speed was 25.109150 fps. Of course, however, my Mac does not have a chip that hardware accelerates HEVC encoding. What is the speed on your M1 Mac?
 
Last edited:

UgoDream

macrumors newbie
Aug 16, 2009
20
17
average is about 35fps

Screen Shot 2020-12-23 at 4.17.39 PM.jpg
 
  • Like
Reactions: JohnDoe12

rui no onna

Contributor
Oct 25, 2013
14,920
13,264
iOS A-series chips have had hardware H265 encoding for years. I have heard that this hardware acceleration has finally come over to Macs with the new M1 series chips. I would like to ask someone with an M1 Mac to try out the following benchmark:

1. Download the 30MB 720p sample video from here.
2. Open Handbrake. Try using the beta meant for M1 Macs found here
3. Drag the video file onto the Handbrake window
4. Choose the preset Matroska > H.265 MKV 720p30
5. Start the encode and note the average fps number at the bottom when the encode is about the finish. Alternatively you can view this average fps in the log.

On my 2020 MacBook Pro (4 ports, i5) my average encoding speed was 25.109150 fps. Of course, however, my Mac does not have a chip that hardware accelerates HEVC encoding. What is the speed on your M1 Mac?

Is Intel QSV not supported on macOS? On the Wintel side, I believe Kaby Lake and higher support full HEVC HW encode acceleration.

By the way, that Matroska > H.265 MKV 720p30 preset uses x265 so that's software encoding.
 
  • Like
Reactions: T'hain Esh Kelch

Deccr

macrumors member
Nov 29, 2020
56
39
It’s faster than that if you enable hardware encoding.

I just ran your test on my M1 mini.

By default the MKV H265 profile is using software encoding.

With Videotoolbox selected (hardware encoding), the encode finished in about 3 seconds.
Please excuse the quality of my screenshots, I was using VNC to remotely control the mini from my phone.


DC7BC0AF-84A4-4BA0-848E-4D5BFBDDAC21.png
52902D27-AC7F-4BE0-A729-9A96D5D2886E.png
 

chrfr

macrumors G5
Jul 11, 2009
13,709
7,280
It’s faster than that if you enable hardware encoding.

I just ran your test on my M1 mini.

By default the MKV H265 profile is using software encoding.

With Videotoolbox selected (hardware encoding), the encode finished in about 3 seconds.
It's also worth noting that T2 equipped Intel Macs can use the T2 for hardware accelerated H265 encoding (8-bit only), so this sample will complete in about 10 seconds on a T2 if you use the H265 Video Toolbox encoder. The file size also grew by about 50% over the original, to 46MB.
 

rui no onna

Contributor
Oct 25, 2013
14,920
13,264
It’s faster than that if you enable hardware encoding.

I just ran your test on my M1 mini.

By default the MKV H265 profile is using software encoding.

With Videotoolbox selected (hardware encoding), the encode finished in about 3 seconds.
Please excuse the quality of my screenshots, I was using VNC to remotely control the mini from my phone.


View attachment 1699982 View attachment 1699983

Yeah, already figured that one. It took 18s to encode with H.265 (VideoToolbox) vs 2:11 x265 on my M1 MBA (240-250 fps).
 

Deccr

macrumors member
Nov 29, 2020
56
39
Yes, I thought that would be the case.

Hardware encoding on either Intel (with T2) or M1 should be similar speeds (taking into account other variables).

Unfortunately the speed increase comes at the cost of file size and quality.

Generally hardware encoding will produce larger files than software encoding and the quality may vary (I don’t want to get into a debate about that now).

Software encoding takes longer but will often produce smaller files.

At least with the M1, you know the power cost (in Watts/energy useage) will be much lower than an Intel system either way.

Running full tilt a M1 mini will only consume about 30watts. I’ve no idea what an Intel equivalent uses - but I’m sure it’s much higher!
 
  • Like
Reactions: timelessbeing

Deccr

macrumors member
Nov 29, 2020
56
39
Ignore my post above.

Looks like I was wrong about file sizes:

Hardware encode = 17MB
Software encode = 27.5MB

🤦‍♂️
 
  • Like
Reactions: matrix07

rui no onna

Contributor
Oct 25, 2013
14,920
13,264
Yeah, no idea what the quality's like yet. I'm gonna have to install VLC to actually watch. x265 was on RF 21 and it seems HB thinks rough equivalent of that is CQ 40.

VideoToolbox CQ40
Screen Shot 2020-12-23 at 2.02.28 PM.png


x265 RF21
Screen Shot 2020-12-23 at 2.03.36 PM.png
 

JohnDoe12

macrumors member
Original poster
Nov 14, 2017
71
52
Oh wow, thanks for the insight guys. I had no idea my MacBook Pro supported hardware acceleration. The main reason I'm asking this is because I was wondering how much better my encodes would be if I eventually upgraded to an M-series Mac. Currently I software encode at RF22 and I'm generally happy with the quality/size, but it's rather slow.

I'm not sure where you people are getting 17 MB for the hardware encode though. I'm getting nearly a higher value like @chrfr had. Is the 17 MB only on the M1 Mac?

This is what it's like for my intel MacBook:
  • H265 (RF22): 25.5 MB
  • H265 VideoToolbox (2000 kbps, the default): 41.7 MB
  • H265 VideoToolbox (1000 kbps): 25.3 MB
Strangely I can't discern any difference in quality between the 1Mbps and 2Mbps versions, although that may be because the source file has horrendous quality. Edit: sure enough, I tried it out on a different video. The hardware encoder has noticeably worse quality compared to software encoding when I try to make the file sizes the same
 
Last edited:

JohnDoe12

macrumors member
Original poster
Nov 14, 2017
71
52
After playing around with this a bit, I guess I'm sad to say that hardware encoding is not the way to go. I thought it would be a magical hardware addition where I could speed up all of my encoding tasks by 3-5 times, but it seems like it's not nearly as good as software encoding, so bummer there...
 

Gnattu

macrumors 65816
Sep 18, 2020
1,107
1,672
What is this CQ value you're specifying? I only have an option to change the bitrate for VideoToolbox encode.
It's available in the latest beta, and maybe only available for Apple Silicon Macs. FPS is about 10 time faster. Screen Shot 2020-12-23 at 18.23.44.png

I will attach the output file here and you can see the quality for yourself.

 

matrix07

macrumors G3
Jun 24, 2010
8,226
4,895
I had tested VideoToolbox and I was not impressed. The quality is just not there. It's either had acceptable quality at much higher file size or very low quality for less file size. x264 encoder at least gives acceptable quality at much smaller file size.
The speed is spectacular though.

If anyone has a setting that used VideoToolbox with acceptable quality that doesn't lose much but also produce acceptable file size please share.
 

Gnattu

macrumors 65816
Sep 18, 2020
1,107
1,672
x264 encoder at least gives acceptable quality at much smaller file size
You mean VideoToolBox's hevc(x265) has worse quality at the same file size of x264? This is a serious problem if it is the case.
 

matrix07

macrumors G3
Jun 24, 2010
8,226
4,895
You mean VideoToolBox's hevc(x265) has worse quality at the same file size of x264? This is a serious problem if it is the case.
I meant VideoToolBox (x264) has worse quality at the same file size of x264.

I will test x265 when I have time.
 

Deccr

macrumors member
Nov 29, 2020
56
39
I want to try using Don Melton’s Video Transcode tool on my M1 mini.

It’s command line only but built for quality. https://github.com/donmelton/video_transcoding

There are options to use hardware transcoding and H265. His Other Video Transcode is built to use the hardware encoder by default.

It’s reported to work on the M1 platform using Rosetta 2:

I’d be curious to see what quality and file size this produces in comparison to Handbrake (I know they both use ffmpeg but have different implementations for quality settings).
 

rui no onna

Contributor
Oct 25, 2013
14,920
13,264
The Big Bucky Bunny video is not a good source though. The quality of the original is already bad.

Here's some high bitrate test vids.

 

JohnDoe12

macrumors member
Original poster
Nov 14, 2017
71
52
I see the CQ option with the latest beta, but I'm unable to change it on my intel Mac. Presumably it's only for the M1 Macs.

1608767782757.png
 

JohnDoe12

macrumors member
Original poster
Nov 14, 2017
71
52
You mean VideoToolBox's hevc(x265) has worse quality at the same file size of x264? This is a serious problem if it is the case.
H.265 (VideoToolbox)'s quality is significantly worse than the quality of the same size H.264 (x264). But I thought this was to be expected? Note however that I'm on an intel Mac and I can not use the CQ slider. I am forced to use constant bitrate which affects video quality significantly.
 

rui no onna

Contributor
Oct 25, 2013
14,920
13,264
I see the CQ option with the latest beta, but I'm unable to change it on my intel Mac. Presumably it's only for the M1 Macs.

View attachment 1700105

Average Bitrate is selected on your screenshot. Have you tried if you're able to select Constant Quality? You can't adjust the CQ slider if you don't have the Constant Quality button selected.
 

JohnDoe12

macrumors member
Original poster
Nov 14, 2017
71
52
Average Bitrate is selected on your screenshot. Have you tried if you're able to select Constant Quality? You can't adjust the CQ slider if you don't have the Constant Quality button selected.
Yep, as you can see the radio button is grayed out. This happens for both H.264 and H.265 VideoToolbox, but it doesn't for the other options
 

Gnattu

macrumors 65816
Sep 18, 2020
1,107
1,672
H.265 (VideoToolbox)'s quality is significantly worse than the quality of the same size H.264 (x264)
This should not be expected. H.265 should deliver comparable quality at half of the bitrate of H.264.

If you set same bitrate on both encoder can you tell the difference of quality?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.