Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2021 Photos & CameraAudio & Video

WWDC21 · 20 min · Photos & Camera / Audio & Video

Explore low-latency video encoding with VideoToolbox

Supporting low latency encoders has become an important aspect of video application development process. Discover how VideoToolbox supports low-delay H.264 hardware encoding to minimize end-to-end latency and achieve new levels of performance for optimal real-time communication and high-quality video playback.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 2 snippets

VTCompressionSession creation objectivec · at 5:03 ↗
CFMutableDictionaryRef encoderSpecification =
            CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, NULL);

CFDictionarySetValue(encoderSpecification,
                     kVTVideoEncoderSpecification_EnableLowLatencyRateControl,
                     kCFBooleanTrue)

VTCompressionSessionRef compressionSession;

OSStatus err = VTCompressionSessionCreate(kCFAllocatorDefault, 
                                          width, 
                                          height,
                                          kCMVideoCodecType_H264, 
                                          encoderSpecification,
                                          NULL, 
                                          NULL, 
                                          outputHandler, 
                                          NULL,
                                          &compressionSession);
New profiles objectivec · at 7:35 ↗
// Request CBP

VTSessionSetProperty(compressionSession, 
                     kVTCompressionPropertyKey_ProfileLevel, 
                     kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel);

// Request CHP

VTSessionSetProperty(compressionSession, 
                     kVTCompressionPropertyKey_ProfileLevel, 
                     kVTProfileLevel_H264_ConstrainedHigh_AutoLevel);

Resources