Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Add support for Apple Silicon on Mac Catalyst #597

Closed
wfltaylor opened this issue Nov 14, 2020 · 9 comments
Closed

Add support for Apple Silicon on Mac Catalyst #597

wfltaylor opened this issue Nov 14, 2020 · 9 comments
Assignees
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@wfltaylor
Copy link

Description
Currently MobileFFmpeg does not compile for arm64 on Mac Catalyst, only x86_64.

Environment

  • Platform: iOS (Mac Catalyst)
  • Architecture: arm64
@Neil20170220
Copy link

any one help?

@zapsleep
Copy link

Until the pod is updated by @tanersener you can build the xcframework with M1 arm64 slice locally by using ios.sh -x script with XCode 12.2 toolchain installed. It should create xcframework with proper naming for maccatalyst and including arm64 slice.
The only problem with that is current master appears to fail when building giflib on my macbook.
I have a Catalyst project too, haven't updated it to arm64 mac yet - waiting for mobile-ffmpeg xcframework to include arm64-maccatalyst binary. If you have trouble building the project on XCode 12.2 even for x86_64 only - renaming slices inside the mobile-ffmpeg xcframework manually could help.

@Neil20170220
Copy link

I think should add some code like ARCH_ARM64_MAC_CATALYST=7

mobile-ffmpeg/ios.sh

Lines 3 to 10 in 195a809

# ARCH INDEXES
ARCH_ARMV7=0
ARCH_ARMV7S=1
ARCH_ARM64=2
ARCH_ARM64E=3
ARCH_I386=4
ARCH_X86_64=5
ARCH_X86_64_MAC_CATALYST=6

@tanersener tanersener added the enhancement New feature or request label Dec 20, 2020
@confucious
Copy link

I've done some experimentation on this and I think the build / packaging scripts will need to be reworked to support the arm64 simulator and arm64 Mac catalyst targets.

I've been focusing on the arm64 simulator target and I've reached a point where I can build a framework for the arm64-simulator.

The problem is that when I try to package it with the x86_64-simulator framework into the xcframework, xcodebuild returns an error Both ios-x86_64-simulator and ios-arm64-simulator represent two equivalent library definitions.

From this post: https://developer.apple.com/forums/thread/666335 it appears that simulator (and Mac catalyst) frameworks need to be delivered as a fat binary in the xcframework.

The cleanest way to do this probably is to add a preprocessing step before xcodebuild --create-framework to look for targets with *-simulator or *-maccatalyst and combine them to a fat binary (using lipo) and then pass that result to xcodebuild.

@tanersener
Copy link
Owner

tanersener commented Feb 19, 2021

I completed refactoring the build scripts to support new apple architectures and macos. They are being tested at the moment. Also a new macos test app is on the way. I'll push those changes when they're stable enough. The plan was to publish them on January but I had issues during testing. I'll need 1-2 weeks more to complete the tests.

@hongfeiyang
Copy link

Any news on the progress?

@tanersener
Copy link
Owner

I implemented these changes under FFmpegKit, which is the continuation of MobileFFmpeg. I suggest switching to FFmpegKit if you want to use newer Apple architectures.

@tanersener tanersener added the wontfix This will not be worked on label Mar 22, 2021
@hongfeiyang
Copy link

I implemented these changes under FFmpegKit, which is the continuation of MobileFFmpeg. I suggest switching to FFmpegKit if you want to use newer Apple architectures.

Thanks, also is there any plan to migrate to swift in the future?

@tanersener
Copy link
Owner

Unfortunately, merging the Swift API implemented in #599 wasn't possible. However, if someone implements a new Swift API identical to Objective-C API we have in FFmpegKit then we can merge it and use it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

6 participants