<!--
{
  "availability" : [
    "ProVideo Encoder Extensions: 1.0.0 -",
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "professional_video_applications",
  "identifier" : "/documentation/professional_video_applications/CompressorExtensionEncoder/runTranscode(for:start:duration:toFile:startTimeCode:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Professional Video Applications"
    ],
    "preciseIdentifier" : "c:objc(pl)CompressorExtensionEncoder(im)runTranscodeFor:start:duration:toFile:startTimeCode:"
  },
  "title" : "runTranscode(for:start:duration:toFile:startTimeCode:)"
}
-->

# runTranscode(for:start:duration:toFile:startTimeCode:)

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

```
func runTranscode(for decoder: CompressorMediaDecoderPtr!, start startFrame: Int64, duration numFrames: Int64, toFile file: URL!, startTimeCode timeCodeDictionary: [AnyHashable : Any]!)
```

## Parameters

`decoder`

A pointer to the decoder interface object.

`startFrame`

The frame at which to start encoding.

`numFrames`

The number of frames to encode.

`file`

The destination file URL to put the encoded file into.

`timeCodeDictionary`

A dictionary that contains timecode information about the source media. This dictionary has the following keys:

- `hours`, `minutes`, `seconds`, `frames`: Integer
- `frameRate`: Double
- `isDrop`: Bool
- `reelName`: NSString

## Discussion

The Compressor app invokes this method to run an encoding job. Implement this method to transcode media files from the source format into an output format your extension supports. Inside the implementation, call the decoder interface methods to get individual video frames and audio samples to encode.

---

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)