Mobile-ffmpeg: Mac Catalyst support

Created on 20 Feb 2020  路  12Comments  路  Source: tanersener/mobile-ffmpeg

Description
Hello! I wonder if there are any plans on supporting Mac Catalyst architecture for iOS? I'm currently using mobile-ffmpeg via cocoapods in my app and want to build a macos version using Catalyst. However it seems that having a x86_64 slice in the framework is not enough for Catalyst, which apparently wants its own slice built with specific settings. So when I try to build the app it gives me this:

Current behavior
Linker error with message:
Showing Recent Messages
ld: In /Users/user/work/app/Pods/mobile-ffmpeg-full/expat.framework/expat(xmlparse.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, file '/Users/user/work/app/Pods/mobile-ffmpeg-full/expat.framework/expat' for architecture x86_64

Environment

  • Platform: iOS, macOS
  • Architecture: x86_64, arm64, x86_64-maccatalyst
  • Xcode version 11.4b2
  • Cocoapods version 1.8.4
enhancement fixed

Most helpful comment

Mac Catalyst support is added to scripts at mac-catalyst branch. Architecture is defined as x86-64-mac-catalyst. As you've said it clashed with x86-64. You need to disable x86-64 to build it.

./ios.sh --disable-x86-64

All external libraries except sdl and libaom support Mac Catalyst too.

All 12 comments

Yes, I want to support Catalyst, and iPadOs too. But Catalyst is very new and the last time I started working on it I couldn't find the answers of some of my questions. I'll try to test it again soon.

Great! Thank you, looking forward to that!

Mac Catalyst support is added to scripts at mac-catalyst branch. Architecture is defined as x86-64-mac-catalyst. As you've said it clashed with x86-64. You need to disable x86-64 to build it.

./ios.sh --disable-x86-64

All external libraries except sdl and libaom support Mac Catalyst too.

I was able to compile and use it under Catalyst without any issues. Thank you for your work!
Any chance catalyst version would be available via CocoaPods too?

I want to do that but I don't know how projects are handling this. Both x86-64 (Simulator) and x86-64 (Mac Catalyst) share the same x86_64 architecture and it is not possible to include them in the same fat file. Do you know any libraries doing this, or any popular library on Cocoapods that has Mac Catalyst support?

Unfortunately no. Every library I know which is distributed as binaries via Cocoapods is having problems with Mac Catalyst now.

It's okay, found a way to do it. But I need to update & test the scripts on mac-catalyst branch. If everything goes as planned that branch will be merged to development and mac-catalyst architecture will be included in the next MobileFFmpeg release which is due to the first week of April.

mac-catalyst branch is merged into development. Also v4.3.1 Full-GPL Mac Catalyst Beta package is released for everyone who wants to test it. It includes x86-64 (Mac Catalyst) instead of x86-64 (Simulator) architectures.

As I said in my previous post, it is not possible to include x86-64 (Simulator) and x86-64 (Mac Catalyst) architectures in the same fat binary. Solution is to use the new xcframework format.

Current plan is to update build scripts to create xcframework packages and publish them in CocoaPods. Unfortunately, universal binaries which are based on fat libraries can't include Mac Catalyst. Maybe we should consider dropping them in the next release.

I'm absolutely ok with xcframework , using it myself, but it's supported only since xcode 11. Although mac-catalyst is too supported only since xcode 11 and this makes sense to distribute the framework like that, dropping fat libraries completely may affect people who still use mobile-ffmpeg with xcode <11.
Can cocoapods make a distinction depending on xcode version?

Can cocoapods make a distinction depending on xcode version?

It's not possible, as far as I know.

I plan to create xcframework packages for only Main releases. LTS releases which support older armv7, armv7s, i386 architectures will still use fat libraries and the old iOS framework format. Does it make sense?

Yes, that would be great imo.

Released with v4.3.2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

usmanrana07 picture usmanrana07  路  5Comments

fayte0618 picture fayte0618  路  3Comments

longkeng picture longkeng  路  4Comments

dnhyde picture dnhyde  路  5Comments

hantrungkien picture hantrungkien  路  6Comments