Skip to content
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

Include ffmpeg suitable for Apple Silicon macos arm64 platform #114

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions imageio_ffmpeg/_definitions.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import platform
import struct
import sys

__version__ = "0.5.0"


def get_platform():
bits = struct.calcsize("P") * 8
if sys.platform.startswith("linux"):
if platform.system().lower().startswith("linux"):
GenevieveBuckley marked this conversation as resolved.
Show resolved Hide resolved
architecture = platform.machine()
if architecture == "aarch64":
return "linuxaarch64"
return "linux{}".format(bits)
elif sys.platform.startswith("freebsd"):
elif platform.system().lower().startswith("freebsd"):
return "freebsd{}".format(bits)
elif sys.platform.startswith("win"):
elif platform.system().lower().startswith("win"):
return "win{}".format(bits)
elif sys.platform.startswith("cygwin"):
elif platform.system().lower().startswith("cygwin"):
return "win{}".format(bits)
elif sys.platform.startswith("darwin"):
return "osx{}".format(bits)
elif platform.system().lower().startswith("darwin"):
if platform.processor().lower().startswith("arm"): # Apple Silicon
return "osx-arm{}".format(bits)
else:
return "osx-{}".format(bits)
else: # pragma: no cover
return None

Expand All @@ -34,7 +36,8 @@ def get_platform():

# Platform string -> ffmpeg filename
FNAME_PER_PLATFORM = {
"osx64": "ffmpeg-osx64-v4.2.2", # 10.10+
"osx-arm64": "ffmpeg-osx-arm64-v7.0", # Apple Silicon
"osx64": "ffmpeg-osx-x86-v7.0", # 10.9+
"win32": "ffmpeg-win32-v4.2.2.exe", # Windows 7+
"win64": "ffmpeg-win64-v4.2.2.exe",
# "linux32": "ffmpeg-linux32-v4.2.2",
Expand All @@ -43,12 +46,14 @@ def get_platform():
}

osxplats = "macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64"
GenevieveBuckley marked this conversation as resolved.
Show resolved Hide resolved
osxarmplats = "macosx_11_0_arm64.macosx_12_0_arm64.macosx_13_0_arm64.macosx_14_0_arm64"
GenevieveBuckley marked this conversation as resolved.
Show resolved Hide resolved
GenevieveBuckley marked this conversation as resolved.
Show resolved Hide resolved

# Wheel tag -> platform string
WHEEL_BUILDS = {
"py3-none-manylinux2010_x86_64": "linux64",
"py3-none-manylinux2014_aarch64": "linuxaarch64",
"py3-none-" + osxplats: "osx64",
"py3-none-" + osxplats: "osx64", # Apple Intel
"py3-none-" + osxarmplats: "osx-arm64", # Apple Silicon
"py3-none-win32": "win32",
"py3-none-win_amd64": "win64",
}