{"id":5408,"library":"pyobjc-framework-coremedia","title":"PyObjC CoreMedia Framework","description":"PyObjC-framework-CoreMedia provides Python wrappers for Apple's CoreMedia framework on macOS. It is part of the larger PyObjC project, which creates a bidirectional bridge between Python and Objective-C. The library is actively maintained with frequent releases, often coinciding with new macOS SDKs and Python versions. It is currently at version 12.1 and requires Python 3.10 or newer.","status":"active","version":"12.1","language":"python","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","objective-c","coremedia","media","pyobjc","bindings"],"install":[{"cmd":"pip install pyobjc-framework-coremedia","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core runtime for the PyObjC bridge, essential for all PyObjC framework wrappers.","package":"pyobjc-core","optional":false},{"reason":"Often 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.","package":"pyobjc-framework-Cocoa","optional":true}],"imports":[{"note":"The CoreMedia framework bindings are accessed directly via the 'CoreMedia' package name.","symbol":"CoreMedia","correct":"import CoreMedia"},{"symbol":"CMTime","correct":"from CoreMedia import CMTime"}],"quickstart":{"code":"import CoreMedia\n\n# Create a CMTime object representing 10 seconds at a 600 timescale\n# CMTimeMake(value, timescale) -> CMTime\ntime_value = CoreMedia.CMTimeMake(10 * 600, 600)\n\nprint(f\"CMTime object: {time_value}\")\nprint(f\"Value: {time_value.value}\")\nprint(f\"Timescale: {time_value.timescale}\")\nprint(f\"Seconds: {CoreMedia.CMTimeGetSeconds(time_value)}\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade Python to 3.10 or newer (current version 12.1 requires >=3.10).","message":"PyObjC 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.","severity":"breaking","affected_versions":"11.0, 12.0"},{"fix":"Review custom `init` methods for correct reference handling according to ARC semantics, particularly if porting from older PyObjC versions.","message":"Behavior 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.","severity":"breaking","affected_versions":">=11.1"},{"fix":"Consult PyObjC's API Notes for CoreMedia to identify unsupported C functions and their Python-compatible alternatives.","message":"Several 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.","severity":"gotcha","affected_versions":"All"},{"fix":"Always pass `None` for `customBlockSource` when calling these specific `CMBlockBuffer` creation/modification functions.","message":"When using `CMBlockBufferCreateWithMemoryBlock`, `CMBlockBufferCreateContiguous`, or `CMBlockBufferAppendMemoryBlock`, the `customBlockSource` argument *must* be `None` from Python. Providing a custom block source is not supported.","severity":"gotcha","affected_versions":"All"},{"fix":"Be aware that KVO will not function for `NSProxy` subclasses implemented in Python. Adjust design or use alternative observation mechanisms if this behavior is critical.","message":"From PyObjC 12.1, Key-Value Observing (KVO) usage is automatically disabled for subclasses of `NSProxy` defined in Python. This prevents potential `SystemError` issues.","severity":"gotcha","affected_versions":">=12.1"},{"fix":"Ensure you are using PyObjC 10.3.1 or later if your code relies on `__init__` being called after a custom `__new__` implementation.","message":"In 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.","severity":"gotcha","affected_versions":"10.3 (fixed in 10.3.1)"}],"env_vars":null,"search_vec":"'12.1':59 '3.10':63 'activ':40 'appl':12 'bidirect':29 'bind':73 'bridg':30 'c':36,69 'coincid':46 'coremedia':2,7,14,70 'creat':27 'current':56 'framework':3,6,15 'frequent':43 'larger':23 'librari':38 'maco':17,49,66 'maintain':41 'media':71 'new':48 'newer':65 'object':35,68 'objective-c':34,67 'often':45 'part':20 'project':25 'provid':8 'pyobjc':1,5,24,72 'pyobjc-framework-coremedia':4 'python':9,32,52,62 'releas':44 'requir':61 'sdks':50 'version':53,58 'wrapper':10","created_at":"2026-04-14T01:32:34.711654+00:00","updated_at":"2026-04-16T19:13:43.050257+00:00","problems":{"verify_error":"× Failed to build `pyobjc-core==12.2.1`\n  ├─▶ The build backend returned an error\n  ╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit status: 1)\n\n      [stdout]\n      running egg_info\n\n      [stderr]\n      error: PyObjC requires macOS to build\n\n      hint: This usually indicates a problem"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"12.2.2","cli_name":"","cli_version":null,"type":"library","homepage":"https://pyobjc.github.io/","github":"https://github.com/ronaldoussoren/pyobjc","docs":"https://pyobjc.readthedocs.io/en/latest/","changelog":null,"pypi":"https://pypi.org/project/pyobjc-framework-coremedia/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","web-framework","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"failing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-05","install_tag":null}}