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

tanelpoder

macrumors newbie
Original poster
Jan 26, 2023
2
0
Hi,

So back in 2021 I returned my 14" MBP M1 as it had much worse hardware-accelerated H.264 encoding performance than my M1 Air from 2020. I mainly record/encode apps on my screen, command line, etc (so all that ProRres stuff is not interesting to me). h.265 / HEVC is not ideal either as people with (enterprise) Windows 10 machines may not even be able to play this new format. I use ScreenFlow to record, edit and encode the videos. There's a whole thread (with other people with similar problems) about the issue, supposedly it's an AppleMac OS/VideoToolbox bug or shortcoming that causes hardware-accelerated h.264 encoding to be much slower than even software/CPU-based encoding:


So I got the MBP M2 Max now, which has 2 x media engines, which both have h.264 hardware acceleration and I still see no improvement. Exporting a 60-minute 2880x1800 @ 30 Hz screencast takes:

- 11 minutes with software x264 encoding (both CPU and GPU are used according to Activity Monitor)
- 11 minutes with hardware HEVC encoding
- 22 minutes with hardware h.264 encoding

Before I dive in (again) and start isolating the problem & troubleshooting, what is your experience - specifically when using hardware-accelerated H.264 encoding (not HEVC or ProRes) on the new M2 machines?

Thanks,
Tanel Poder
 

adamw

macrumors 6502a
Sep 22, 2006
841
2,230
I posted a thread on the Screenflow support forum about this same issue. On a Mac Mini M1 or a Mac Mini M2 (Non Pro model) Hardware Encoding rips at a fast speed in Screenflow Export when using the Hardware Accelerated Apple H.264 option. My new Mac Mini M2 is really fast at H.264 Hardware Encoding, but my Mac Studio M1 Ultra (and reportedly any Mac M1 Pro, M1 Max, M1 Ultra, M2 Pro, or M2 Max models) runs extremely slow (perhaps 20-40X slower) with H.264 hardware encoding in Screenflow, compared to a Mac with a regular M1 or M2 chip (like the Mac Mini base models that do not use M2 Pro chips). Same should apply to MacBooks and MacBook Pro M1 or M2 models. Pro, Max, and Ultra chips seem to not be optimized for H.264 Hardware Encoding (Hardware Accelerated Apple H.264 option) used by Screenflow, which uses the Apple VideoToolbox for Hardware Accelerated Apple H.264 encoding, like many other apps use, such as Handbrake, for H.264 hardware encoding.

Here is the thread on the Screenflow Forum with their tech support staff's reply about this issue:

 

tanelpoder

macrumors newbie
Original poster
Jan 26, 2023
2
0
Thank you for your info. Yep, that was my conclusion back in the M1 testing days, that since M1 (non-pro/max/ultra) didn't have the new media engine (?), ScreenFlow/VideoToolbox ended up using something else for hardware-accelerated encoding (like a flavor of the T2 chip like back in the Intel Macs?). And my guess is that in the new M1/M2 Pro/Max/Ultra media engines the x264 acceleration part is not highest priority. Perhaps Apple just added the minimum capability for x264 acceleration for some mainstream video uses (watching videos and encoding/decoding for Zoom/Skype/FaceTime calls). And the rest of the chip's real estate for the media engine went under accelerating ProRes & H265/HEVC.

What kind of export speed do you get for the 1 hour 1080 @ 30hz HW accelerated encoding on the M2 Mini? Now I'm thinking if I should send my MBP back and get a Mini + another display instead.
 

dasjati

macrumors regular
Sep 24, 2020
189
412
Has anyone gained some insights on this? The link to the ScreenFlow forums gives me a blank page.

What I've learned: When I use "Normal" instead of "Fastest" it's much quicker. Current example: 8 min ScreenFlow video, 1920x1080, with "Fastest" around 3 min, with "Normal" it's 1 min.

I mean, it works, I'm just wondering how fast it could be if the hardware acceleration would actually work as expected …
 

galad

macrumors 6502a
Apr 22, 2022
610
492
the x264 software encoder is really fast on current hardware, it can easily beat an hardware encoder at the same speed and quality. The H.264 hardware encoder in the M1 can encode up to ~180 FPS at 1080p when using the optimise for speed setting. The HEVC hardware encoder is a bit faster, ~300 FPS at 1080p. Unless you need the video in H.264, it's always better to use HEVC. (I did these test connected remotely to an M1, screen sharing might have affected the performance a bit).

These are the theoretical speed of the encoder. There might be so many factors before the encoder that can slow down things anyway.
 
  • Like
Reactions: sauria and dasjati
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.