Framework

Video​Toolbox

Work directly with hardware-accelerated video encoding and decoding capabilities.

Overview

VideoToolbox is a low-level framework that provides direct access to hardware encoders and decoders. It provides services for video compression and decompression, and for conversion between raster image formats stored in CoreVideo pixel buffers. These services are provided in the form of session objects (compression, decompression, and pixel transfer), which are vended as Core Foundation (CF) types. Apps that don't need direct access to hardware encoders and decoders should not need to use VideoToolbox directly.

Symbols

Data Compression

VTCompression​Session

A session object that manages the compression of incoming video data.

Data Decompression

VTDecompression​Session

A session object that manages the decompression of incoming video data.

Data Conversion

VTPixel​Transfer​Session

A session object used to copy and/or convert video data from source pixel buffers to destination pixel buffers.

Session Configuration

VTSession

An abstract object that provides the common interface to configure VideoToolbox session objects.

Multipass Compression

VTMulti​Pass​Storage

An object used for the storage of multipass video encoding metadata.

VTFrame​Silo

An object that stores a large number of sample buffers, as produced by a multipass compression session.

Utility Operations

func VTCreate​CGImage​From​CVPixel​Buffer(CVPixel​Buffer, CFDictionary?, Unsafe​Mutable​Pointer<CGImage?>)

Creates a Core Graphics bitmap image or image mask using the provided pixel buffer.

func VTRegister​Professional​Video​Workflow​Video​Decoders()

Loads decoders appropriate for the client's professional video workflows.

func VTRegister​Professional​Video​Workflow​Video​Encoders()

Loads encoders appropriate for the client's professional video workflows.

Errors

Error Code Constants

Constants for Video Toolbox operation error codes.