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

jfx-2021

macrumors newbie
Sep 1, 2021
27
1
Hello, im new here. And I am new in the M1 World. Have the iMac 16/1TB Version since 3 weeks.

Normal I think the M1 is really nice to have. Not slow in Photo things etc.

But video encoding is very slow. I think my MBPr 2013 (i7 2,3 Ghz / GT 750 M / 16/512) is in some ways same fast or faster. I use 264/265 Videotoolbox in Handbrake and I must really say it is slow. In iVI5 is the same. Super slow. 2/3 times slower than the 8 year old MBPr. And yes. When I use Cinebench or Geekbench the system works really great. Fast as the benchmarks in the Internetl. So I think the system is working really great. But not the Software. And it runs not with Rosetta2. It is the M1 Software of Handbrake and iVI5Pro.

Do you have the same issues?

Thank you very much
 

Aleksid1

macrumors member
Nov 14, 2017
94
51
Hi,

The most likely you installed Intel version of Handbrake. You need to to download a native version for Apple Silicon. If I remember rightly it was available as Beta version 1.4. Check their website.

Intel version with Rosetta emulation works painfully slow for video encoding.
 
  • Like
Reactions: SWAON and Botts85

jfx-2021

macrumors newbie
Sep 1, 2021
27
1
Hi and thx.

I have installed Version Version 1.4.1 (2021081500)
It is the M1 Version. Speed is around 40-50 fps. But on my old 8 year old System the speed is nearly the same. Maybe 5 frames slower.

BTW. Handbrake works with around 460 % in the activity app.
 

Aleksid1

macrumors member
Nov 14, 2017
94
51
Yes, I see that 1.4.1 is now Universal App.

VideoToolbBox mode means that you encode video with GPU hardware encoder. Try H.264 (libx264) encoder to honestly compare speed of the old and new Macs using only CPU based video encoding.

By the way, VideoToolBox (GPU encoder) provides a bit worse visual quality than CPU encoder (libx264).

When I compared only CPU encoder (libx264) the speed of my Mac Mini M1 was exactly the same as desktop PC with AMD Ryzen 3500X (6 cores).
 

jfx-2021

macrumors newbie
Sep 1, 2021
27
1
I have there only H.264, Than 10 Bit and Videotoolbox Which one u mean with libx264?
And do u use 264 or better 265?

Thx
 

Aleksid1

macrumors member
Nov 14, 2017
94
51
I meant H.264 (x264), it's CPU based encoder. Personally I prefer H.264 for a reasonable quality and faster speed of encoding.
 

Aleksid1

macrumors member
Nov 14, 2017
94
51
H.264 (x264) on 20% slower than VideoToolBox H.264 GPU encoder, but visual quality is better in x264 encoder.

I use VideoToolBox only to encode a draft of my videos.
 

jfx-2021

macrumors newbie
Sep 1, 2021
27
1
I try it in example now. It runs extreme at the moment. 100 % Processing is loading. The Van's running in max. Ok an Mac mini has a bit more space for fresh cool air.
 

Aleksid1

macrumors member
Nov 14, 2017
94
51
Compare two or more test videos to find the best option for you.

With H.264 (x264) I also use CRF (constant uality) mode which reduces bitrate automatically in simple scenes. I set about 20-22 CRF for my videos. It optimizes file size keeping good quality.
 

Admiral

macrumors 6502
Mar 14, 2015
402
978
Here's some exciting news: Apple has contributed a patch for ffmpeg to the Handbrake project which enables the use of ARM NEON optimizations (don't ask me what NEON means; I've looked all over and can't find a reference). With the Apple patch, x265 encoding performance is tripled. The M1 is already not so bad at encoding. With base M1 performance tripled, and improved again by M1X/M2 generational advances, Apple Silicon will be beastly at this. Five times faster seems to be nigh.
 
Last edited:

JimmyjamesEU

Suspended
Jun 28, 2018
397
426
Here's some exciting news: Apple has contributed a patch for ffmpeg to the Handbrake project which enables the use of ARM NEON optimizations (don't ask me what NEON means; I've looked all over and can't find a reference). With the Apple patch, x265 encoding performance is tripled. The M1 is already not so bad at encoding. With base M1 performance tripled, and improved again by M1X/M2 generational advances, Apple Silicon will be beastly at this. Five times faster seems to be nigh.
This sounds very promising. Is there somewhere I can read more about this development?
 

jfx-2021

macrumors newbie
Sep 1, 2021
27
1
Hello,

what mean this with Apples patch? When it will be release it?

--------

I have seen on screenshot that Handbrake in Windows version has a Slider for Slow to Fast or so. Named Encorder Preset. But in Mac Version I can't find this. Maybe this is a reason for the slow performance or?
 

Botts85

macrumors regular
Feb 9, 2007
229
175
Here's some exciting news: Apple has contributed a patch for ffmpeg to the Handbrake project which enables the use of ARM NEON optimizations (don't ask me what NEON means; I've looked all over and can't find a reference).
Where did you see this? ffmpeg has had neon support for a while.

I haven't found a patch by anyone who works for Apple at the FFMpeg or HB GitHub repos. Based on my testing, the current version isn't any faster than the proper version of the beta with Neon from months ago.

Neon is an extension set implementing SIMD.
 
  • Like
Reactions: T'hain Esh Kelch

Botts85

macrumors regular
Feb 9, 2007
229
175
I have seen on screenshot that Handbrake in Windows version has a Slider for Slow to Fast or so. Named Encorder Preset. But in Mac Version I can't find this. Maybe this is a reason for the slow performance or?
That slider affects which tunes HB uses to encode the file. Typically slower equals better quality for a given file size.

The same slider is under the video tab on MacOS handbrake.
 

bcse

macrumors newbie
Oct 17, 2021
1
3
I haven't found a patch by anyone who works for Apple at the FFMpeg or HB GitHub repos. Based on my testing, the current version isn't any faster than the proper version of the beta with Neon from months ago.
The patch is here: https://github.com/HandBrake/HandBrake/tree/master/contrib/x265

If you want to build this. Here's a build script: https://github.com/Vargol/ffmpeg-apple-arm64-build

I tried to encode a 1080p video and M1 is actually faster than i9-8950HK
 

Admiral

macrumors 6502
Mar 14, 2015
402
978
The patch is here: https://github.com/HandBrake/HandBrake/tree/master/contrib/x265

If you want to build this. Here's a build script: https://github.com/Vargol/ffmpeg-apple-arm64-build

I tried to encode a 1080p video and M1 is actually faster than i9-8950HK

Now all we need is for Handbrake to properly incorporate this version of ffmpeg into a release. The faster Apple Silicon is nearly upon us. I'm eager to test out my assumption about the speed increase.

It actually seems like encoding performance on Apple Silicon, which is already strong, has a lot of improvement yet to unlock — what about leveraging the Neural Engine and/or GPU? I'm glad Apple is devoting some energy to this.
 

Botts85

macrumors regular
Feb 9, 2007
229
175
The patch is here: https://github.com/HandBrake/HandBrake/tree/master/contrib/x265

If you want to build this. Here's a build script: https://github.com/Vargol/ffmpeg-apple-arm64-build

I tried to encode a 1080p video and M1 is actually faster than i9-8950HK
That patch is in the current HB nightly builds as far as I know. I'm still not sure it came from Apple although the notes say it did.

That ffmpeg build is interesting since that patch never got integrated into mainline ffmpeg. I'm going to build that now.
 

sephstyler

macrumors newbie
Jul 13, 2010
16
0
Hi guys. PC user contemplating a switch over to a new M1 pro / Max Mac.

However, I have a very specific use case, I usually use handbrake to encode 1080p 265 video at a specific bitrate. The bitrate is very low, circa 2200 to 2500kbps.

Of course there are some artifacting especially in dark scenes, but in general, its quite watchable, and for most people, at TV distance, visually indistinguishable from a 5000kbps 265 video at 1080p.

On my PC atm (RTX 2060 MaxQ), on handbrake, on Slower encoder speed (H.265 Nvenc), it can do the encode at circa 150fps.

Given the M1 Pro and Max chip GPUs seem linearly scalable to M1, for me, to qualify whether I should change over:

1. Handbrake on M1 now, using videotoolbox if set to an extremely low bitrate, say, 2500kbps. How are the visuals? If someone is happy to provide a test file somewhere for me to download and view, Id be happy to buy you a week's coffee!

2. If the trade off for decent quality and low bitrate is slower encode - (which is the case on windows too), setting the encode to slow, or slower (which is the terminology in windows handbrake). what is the FPS you get on an M1?

3. if this approach is not practical on M1, and X.265 software based encoding is the only way to get decent visuals & low bitrate, then whats the FPS expected here?


Thank you in advance! I know its super specific!
 

Botts85

macrumors regular
Feb 9, 2007
229
175
The M1 generally does about 240fps at 8-bit H265 encoding of 1080p content.

NVENC looks visibly better than the M1's VideoToolbox X265 for static scenes, the M1's output is notably better in motion, but for most content it looks worse. The more compression you run, the more encoder quality matters.

2500kbps isn't bad for H265 with software X265 though.

1. Handbrake on M1 now, using videotoolbox if set to an extremely low bitrate, say, 2500kbps. How are the visuals? If someone is happy to provide a test file somewhere for me to download and view, Id be happy to buy you a week's coffee!
I believe you will be much happier with X265 instead of VideoToolbox. If you have the time to go software encode, do it. If you send me a PM, I'll run you some samples in VTB, X265, and varying encode quality settings. I've got an M1 now, but my M1 Max is on the way, so I could show the speed of both.
2. If the trade off for decent quality and low bitrate is slower encode - (which is the case on windows too), setting the encode to slow, or slower (which is the terminology in windows handbrake). what is the FPS you get on an M1?
That'll depend on source material. I can run your stuff for an example if you want. It's quicker than one would think on Medium, slow is not fantastic though. X265 encodes are one of the areas where my 9900k iMac still beats my M1.
3. if this approach is not practical on M1, and X.265 software based encoding is the only way to get decent visuals & low bitrate, then whats the FPS expected here?
That really depends on what X265 settings you pick. It can go from faster than real time, to 3-4fps.
 

stuartfuk

macrumors member
Sep 24, 2020
35
60
On a just received M1 Max MacBook Pro 32Gb 24GPU I am seeing an average of 57 FPS for H.265 1080p

With the exact same source file and preset on my M1 Mac Mini both using VideoToolBox I am getting around 190 FPS

The M1 Max is almost 4x slower

Something is not quite optimised in Handbrake?

This is on the lastest Apple Silicon build. I also tried a nightly build with just 1-2 FPS improvement on M1 Max
 

Botts85

macrumors regular
Feb 9, 2007
229
175
On a just received M1 Max MacBook Pro 32Gb 24GPU I am seeing an average of 57 FPS for H.265 1080p

With the exact same source file and preset on my M1 Mac Mini both using VideoToolBox I am getting around 190 FPS

The M1 Max is almost 4x slower

Are you running any filters that are CPU bound like Decomb or Deinterlace?

Could you try running two or four simultaneous VTB encodes? I found on my M1 I could get some extra performance by simultaneously encoding.

And it's possible Apple tuned VideoToolbox for quality not speed on M1 Max. I don't have my M1 Max yet, but I'd take half the encode speed of my M1 in exchange for quality that beats NVENC.
 

Botts85

macrumors regular
Feb 9, 2007
229
175
To preserve an additional data point for the Macrumors crowd, I got to test an M1 Pro today.

The M1 Pro's H265 videotoolbox encoder is visibly identical to the M1's.

I did get 221fps encode speed on Tears of Steel with the M1 Pro vs 190fps with the M1 though.
 

Admiral

macrumors 6502
Mar 14, 2015
402
978
That patch is in the current HB nightly builds as far as I know. I'm still not sure it came from Apple although the notes say it did.

That ffmpeg build is interesting since that patch never got integrated into mainline ffmpeg. I'm going to build that now.

I am now using Handbrake nightly, which you report includes the Apple-contributed NEON patch, and can report that the speed of x265 encode is quite a bit faster. Not three times, in all cases, but 50% to 200% faster in most. Amazing. I'm really looking forward to picking up an M1 Pro or Max Mac mini in the spring, and comparing their encode blocks to the quality of CPU-based x265. Now my Mac mini encodes at about the same speed as an eight-core AMD Ryzen 4750G — getting 70% more from an M1 Pro or Max will blow away AMD's x86.
 
Last edited:
  • Like
Reactions: Botts85
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.