<!--
{
  "availability" : [
    "ProVideo Encoder Extensions: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "professional_video_applications",
  "identifier" : "/documentation/professional_video_applications/CompressorExtensionEncoder",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Professional Video Applications"
    ],
    "preciseIdentifier" : "c:objc(pl)CompressorExtensionEncoder"
  },
  "title" : "CompressorExtensionEncoder"
}
-->

# CompressorExtensionEncoder

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

```
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:)`](/documentation/professional_video_applications/CompressorExtensionEncoder/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:)`](/documentation/professional_video_applications/CompressorExtensionEncoder/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:)`](/documentation/professional_video_applications/CompressorExtensionEncoder/splitPoints(forFrameStart:duration:serviceCount:)) method. To combine the individual encoded segments into a single output file, implement the [`mergeSegments(_:andAudio:toFile:)`](/documentation/professional_video_applications/CompressorExtensionEncoder/mergeSegments(_:andAudio:toFile:)) method.

## Topics

### Determining the Source Media Segments

[`func splitPoints(forFrameStart: Int64, duration: Int64, serviceCount: Int32) -> [Any]!`](/documentation/professional_video_applications/CompressorExtensionEncoder/splitPoints(forFrameStart:duration:serviceCount:))

Determines the source media segments based on the number of available encoder services.

### Encoding and Merging Segments

[`func runTranscode(for: CompressorMediaDecoderPtr!, start: Int64, duration: Int64, toFile: URL!, startTimeCode: [AnyHashable : Any]!)`](/documentation/professional_video_applications/CompressorExtensionEncoder/runTranscode(for:start:duration:toFile:startTimeCode:))

Encodes the source media files to an output format based on the encoder settings.

[`func mergeSegments([Any]!, andAudio: URL!, toFile: URL!)`](/documentation/professional_video_applications/CompressorExtensionEncoder/mergeSegments(_:andAudio:toFile:))

Merges multiple encoded video segments with an encoded audio segment.

[`typealias CompressorExtensionEncoderPtr`](/documentation/professional_video_applications/CompressorExtensionEncoderPtr)

The type alias to use for referencing the `CompressorExtensionEncoder` object.

### Providing Updates of the Encoding Process

[`func statusMessage() -> String!`](/documentation/professional_video_applications/CompressorExtensionEncoder/statusMessage())

Returns the status of an encoding job.

[`func percentDone() -> Double`](/documentation/professional_video_applications/CompressorExtensionEncoder/percentDone())

Returns the completion percentage of an encoding job.

### Canceling or Pausing the Encoding Process

[`func cancel(forPause: Bool) -> [AnyHashable : Any]!`](/documentation/professional_video_applications/CompressorExtensionEncoder/cancel(forPause:))

Pauses or cancels an encoding job.

[`func setStateFromPause([AnyHashable : Any]!)`](/documentation/professional_video_applications/CompressorExtensionEncoder/setStateFromPause(_:))

Sets the extension to a previously saved state.

[`func percentLostOnPause() -> Double`](/documentation/professional_video_applications/CompressorExtensionEncoder/percentLostOnPause())

Returns the percentage of the encoding job lost on pausing.

### Setting Encoding Values

[`func setSettings(CompressorExtensionSettingsPtr!)`](/documentation/professional_video_applications/CompressorExtensionEncoder/setSettings(_:))

Sets the current encoding settings based on the given setting values.

[`func setAnnotations([AnyHashable : Any]!)`](/documentation/professional_video_applications/CompressorExtensionEncoder/setAnnotations(_:))

Adds annotations to an encoded media file.

[`func setChapters([[AnyHashable : Any]]!)`](/documentation/professional_video_applications/CompressorExtensionEncoder/setChapters(_:))

Sets chapter markers of an encoded file from the contents of the input dictionary.

### Supporting Pixel Formats

[`var supportedPixelFormats: [NSNumber]!`](/documentation/professional_video_applications/CompressorExtensionEncoder/supportedPixelFormats)

The supported pixel formats in an encoder extension.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)