{"library":"pyobjc-framework-avfoundation","title":"PyObjC AVFoundation Framework","description":"PyObjC-framework-AVFoundation provides Python wrappers for Apple's AVFoundation framework on macOS. It allows Python applications to interact with audio and video capture, playback, and processing capabilities. The library is actively maintained, generally seeing releases multiple times a year, often aligning with new macOS SDK updates and Python version changes. The current version is 12.1.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyobjc-framework-avfoundation"],"cli":null},"imports":["from AVFoundation import AVCaptureSession","from AVFoundation import AVCaptureDevice","from AVFAudio import AVAudioEngine","from Foundation import NSLog"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from AVFoundation import AVCaptureDevice\nfrom Foundation import NSLog\n\ndef list_capture_devices():\n    NSLog(\"\\n--- Listing Available Capture Devices ---\")\n    devices = AVCaptureDevice.devices()\n    if not devices:\n        NSLog(\"No capture devices found.\")\n        return\n\n    for i, device in enumerate(devices):\n        name = device.localizedName()\n        unique_id = device.uniqueID()\n        has_video = device.hasMediaType('vide')\n        has_audio = device.hasMediaType('soun')\n        \n        NSLog(f\"  {i+1}. Name: {name}, UniqueID: {unique_id}\")\n        if has_video: NSLog(\"     - Supports video capture\")\n        if has_audio: NSLog(\"     - Supports audio capture\")\n    NSLog(\"-----------------------------------------\")\n\nif __name__ == \"__main__\":\n    # Note: For full GUI apps, you would typically run an NSApplication event loop.\n    # For simple scripts, direct calls often work, but some operations might require\n    # a run loop for asynchronous callbacks or permissions.\n    list_capture_devices()\n","lang":"python","description":"This quickstart demonstrates how to use AVFoundation to enumerate available audio and video capture devices on macOS, printing their names and capabilities to the console. It uses `AVCaptureDevice` from `AVFoundation` and `NSLog` from `Foundation` for output.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":null,"pypi_latest":"12.1","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyobjc-framework-avfoundation","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyobjc-framework-avfoundation","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.9,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyobjc-framework-avfoundation","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyobjc-framework-avfoundation","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyobjc-framework-avfoundation","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyobjc-framework-avfoundation","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.9,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyobjc-framework-avfoundation","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyobjc-framework-avfoundation","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.5,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyobjc-framework-avfoundation","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyobjc-framework-avfoundation","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.4,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}