Contents

CompressorExtensionEncoder

An interface an extension implements to convert source media to the output format supported in your extension.

Declaration

protocol CompressorExtensionEncoder

Overview

Implement the methods in this interface to run an encoding job, support parallel processing, and send output files to a specified destination. To run an encoding job, the Compressor app calls the runTranscode(for:start:duration:toFile:startTimeCode:) method. During the encoding process, the Compressor app calls the methods in the CompressorExtensionEncoder protocol to get updates on the status and progress of an encoding job.

Users sometimes request to pause a running encoder task to free up resources. You can choose to support resuming a job where it left off by saving the extension’s state while pausing in the implementation of the cancel(forPause:) method.

Increase the encoding speed in your extension by taking advantage of distributed processing, where multiple extension instances process segments of source media concurrently. Determine individual segments of the source media to process in extension instances by implementing the splitPoints(forFrameStart:duration:serviceCount:) method. To combine the individual encoded segments into a single output file, implement the mergeSegments(_:andAudio:toFile:) method.

Topics

Determining the Source Media Segments

Encoding and Merging Segments

Providing Updates of the Encoding Process

Canceling or Pausing the Encoding Process

Setting Encoding Values

Supporting Pixel Formats