PyObjC VideoToolbox Framework

12.1 · active · verified Tue Apr 14

This library provides Python wrappers for the macOS VideoToolbox framework, enabling access to its functionalities for video compression, decompression, and processing. It is part of the larger PyObjC project, which bridges Python and Objective-C, and typically sees releases aligned with macOS SDK updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and use a basic function from the VideoToolbox framework to list available video encoders on the system.

import objc
from VideoToolbox import VTCopyVideoEncoderList

# Get a list of available video encoders
# VTCopyVideoEncoderList takes a CFDictionaryRef as an argument, or None for default
encoder_list = VTCopyVideoEncoderList(None)

if encoder_list:
    print(f"Found {len(encoder_list)} video encoders:")
    for encoder in encoder_list:
        # encoder is an NSDictionary (bridged to Python dict)
        print(f"  - {encoder.get('kVTVideoEncoderComponentDisplayName', 'Unknown Encoder')}")
        print(f"    Type: {encoder.get('kVTVideoEncoderComponentType', 'Unknown')}")
else:
    print("No video encoders found.")

view raw JSON →