-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add macOS + ARM binaries from osxexperts.net #49
Comments
I'm not sure which (ARM) architecture the MacBooks will have, but AFAIK almost all new high-end processors are ARM64. It would be cool if tested this with the ffmpeg binaries and report findings here as soon as they're out. |
Thank you, I will also test from my side once I get an ARM based Mac and update any found issues here. |
There's more to this than just processor architecture. Each OS has its own executable file format, Kernel API, library format, linking system, etc. The latter 2 don't matter as much with these static builds, though I think the linux "static" builds still link to the local glibc. Linux uses the ELF executable format whereas iOS and OSX use MACH-O executable format with fat binary support. Apple used the fat binary support back when they switched from PowerPC to Intel by having developers build executable files that contained executables for both PowerPC and Intel processors. At some point they deprecated the PowerPC platform and xcode stopped building the PowerPC support. My expectation is that they'll do the same for ARM. For the next several years we'll have fat MACH-O binaries that include both ARM and Intel code and eventually they'll remove support for the Intel computers. But there's no chance that the Linux binary will run on Mac without something to provide ELF support and mapping the Linux Kernel API calls to OSX API calls. For an example of such a system, look at the WINE project which attempts to make Windows executables run on Unix systems. tl;dr - None of the existing binaries will run on OSX ARM, but there's a near 100% likelihood that there will be a single binary that runs on both OSX ARM and OSX Intel, but these can't be built until Apple ships the necessary toolchain. |
Thank you for providing this detailed information. It was very helpful. I think we could rebuild ffmpeg on ARM based Mac to have an executable compatible for only ARM Mac. But as you said, It will be great if we could compile a binary that runs on both OSX ARM and OSX Intel. Although the toolchain for this is not yet available, but do you have more information on the process that is used to make such a binary. For example - How the executable was made earlier that was compatible for both PowerPC and Intel ? |
@jack445 So at WWDC, apple announced Rosetta2 which will allow almost all x86-64 Mac binaries to run on the "Apple silicon" (aka ARM based) Macs. So the existing MacOS binaries will most likely just work. But here's more information on building a "universal binary" that contains both Intel and ARM: https://developer.apple.com/documentation/xcode/porting_your_macos_apps_to_apple_silicon Ultimately it's something that will be solved by https://evermeet.cx/ffmpeg/ and https://ffmpeg.zeranoe.com/builds/ Since the new version of XCode was released during the WWDC, I don't think it will be very long before at least one of them publishes universal binaries. |
Thank you. Your information is very helpful. I will keep an eye on the links that you have provided for the universal builds. |
Hi, do you have any new information about this topic? Thanks |
Any update on this? |
Have you tried the script mentioned on that site? I'm not sure I trust them by using their binaries for |
Why do you not trust the provided FFmpeg files? That site (and evermeet - but that one apparently is going to stop his service) is for years one of best providers for decent FFmpeg macOS builds. I did not compile myself yet because I do not have my Mac Mini M1 yet (probably end of the week). |
Okay, I didn't know that.
Let me know if it works! |
Looking at the script it should compile fine. Except you need to change the arch flag. --arch=x86_64 to --arch=arm64 |
But does it? Can someone with an M1 confirm? |
I've successfully built FFmpeg on my M1 Mac Mini, and have uploaded the build script to https://github.com/ssut/ffmpeg-on-apple-silicon.
|
Great! Can you upload the binary? I will create an |
As @stefcarlens claimed here ssut/ffmpeg-on-apple-silicon#1, it is not fully statically linked and does not support all the features that OSXExperts' build supports. I will try to build it again and let you know when it's done. |
I noticed the osxexperts now have Apple Silicon compiled version with the ARM NEON patch. This makes a huge difference in speed when converting to HEVC. Without that patch x265 is terrible slow and about unusable. |
Also, for those that download the Apple Silicon builds either with a browser (as opposed to from the Terminal), you'll want to remove the quarantine bit: xattr -r -d com.apple.quarantine ffmpeg And to check you have the correct one is in your PATH: which ffmpeg
~/.local/bin/ffmpeg file ~/.local/bin/ffmpeg
/Users/aj/.local/bin/ffmpeg: Mach-O 64-bit executable arm64 |
Is there any straight-fordward solution to make this module work on M1 arm-based machines? I'm interested in using it inside an Electron App, so any robust solution would make my Electron App more complicated. |
@kzka90 Regarding Electron: There's a long discussion in an Electron-based project that used to use Regarding M1 support: Someone needs to provide or point me towards reasonably full-featured, static |
@derhuerst I'm new to to FFMPEG stuff. What is missing from this build provided by OSX experts to add support for arm64 M1 Macs? https://www.osxexperts.net I'm happy to test it with my M1 MacBook Pro and/or submit a PR, I just need a pointer in the right direction for implementation with this library haha. |
AFAIK the osxexperts.net build script doesn't produce a statically linked binary, so you can't use it without having all the relevant libraries in places where they can be found (e.g. local directories or specific system paths). You could check if such a binary works standalone, outside of the build directory and with a system that lacks those libraries. @ssut Do you have an update on #49 (comment) ? 🙂 |
The builds from osxexperts.net are 100% static. You can use them everywhere. Not sure why you think there are not. |
Because you said so a while ago. 😉 I have never checked though. This issue is just me directing people who want to know about M1 support to comments that other people made about it. 😄 |
I just checked and the website offers two scripts for creating static builds. One for Intel and one for ARM. But they do offer an ARM build including that patch. Would be great if they share how to patch x265 though. |
Let's add the osxexperts.net binaries then! |
Any updates on this? |
No updates. Nobody has started working on this. |
I can open a PR but I will need some help with some of the details around releasing etc |
hi! do you have any indication of why that's necessary? I maintain a project on osx and we are facing the same issue with M1 releases. |
You can get some idea of what quarantine is doing and why here: |
I have heard that Apple will soon release ARM based Macbooks. Which version of FFmpeg will run in this scenario ? Will the Linux based binary for ARM64 will be compatible with ARM64 Macbooks ?
The text was updated successfully, but these errors were encountered: