Registry /
http-networking / pyobjc-framework-coremedia
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CoreMedia
✓ import CoreMedia
The CoreMedia framework bindings are accessed directly via the 'CoreMedia' package name.
CMTime
✓ from CoreMedia import CMTime
This example demonstrates importing the CoreMedia framework and creating a basic CMTime object, which is a fundamental structure for representing time in CoreMedia. It then prints some of its properties and converts it to seconds.
import CoreMedia
# Create a CMTime object representing 10 seconds at a 600 timescale
# CMTimeMake(value, timescale) -> CMTime
time_value = CoreMedia.CMTimeMake(10 * 600, 600)
print(f"CMTime object: {time_value}")
print(f"Value: {time_value.value}")
print(f"Timescale: {time_value.timescale}")
print(f"Seconds: {CoreMedia.CMTimeGetSeconds(time_value)}")
Debug
Known issues
breakingPyObjC 12.0 dropped support for Python 3.9. PyObjC 11.0 dropped support for Python 3.8. Users must update their Python environment to Python 3.10 or later.fixUpgrade Python to 3.10 or newer (current version 12.1 requires >=3.10).
affects: 11.0, 12.0
breakingBehavior for methods in the 'init' family changed in PyObjC 11.1 to correctly model that they steal a reference to `self` and return a new reference, aligning with `clang`'s Automatic Reference Counting documentation. This may affect custom initializers written in Python.fixReview custom `init` methods for correct reference handling according to ARC semantics, particularly if porting from older PyObjC versions.
affects: >=11.1
gotchaSeveral low-level C functions in CoreMedia, such as `CMBlockBufferAccessDataBytes` and `CMBlockBufferGetDataPointer`, are not directly usable from Python. Alternative functions like `CMBlockBufferCopyDataBytes` should be used instead.fixConsult PyObjC's API Notes for CoreMedia to identify unsupported C functions and their Python-compatible alternatives.
affects: All
gotchaWhen using `CMBlockBufferCreateWithMemoryBlock`, `CMBlockBufferCreateContiguous`, or `CMBlockBufferAppendMemoryBlock`, the `customBlockSource` argument *must* be `None` from Python. Providing a custom block source is not supported.fixAlways pass `None` for `customBlockSource` when calling these specific `CMBlockBuffer` creation/modification functions.
affects: All
gotchaFrom PyObjC 12.1, Key-Value Observing (KVO) usage is automatically disabled for subclasses of `NSProxy` defined in Python. This prevents potential `SystemError` issues.fixBe aware that KVO will not function for `NSProxy` subclasses implemented in Python. Adjust design or use alternative observation mechanisms if this behavior is critical.
affects: >=12.1
gotchaIn PyObjC 10.3, support for calling `__init__` when a class or its superclass had a user-implemented `__new__` was temporarily removed, causing breaking changes for some projects. Version 10.3.1 reinstated this functionality.fixEnsure you are using PyObjC 10.3.1 or later if your code relies on `__init__` being called after a custom `__new__` implementation.
affects: 10.3 (fixed in 10.3.1)
Upgrade
Version history
12.2.2latest on PyPI · released Aug 11, 2026
Audit
Dependencies
pyobjc-corerequiredCore runtime for the PyObjC bridge, essential for all PyObjC framework wrappers.
pyobjc-framework-CocoaoptionalOften used alongside CoreMedia for applications, provides fundamental Cocoa classes like NSObject and NSApplication. While not strictly a direct dependency of *this specific wrapper*, it's a common practical dependency for many PyObjC applications that use media frameworks.