---
title: "runTranscode(for:start:duration:toFile:startTimeCode:)"
framework: Professional Video Applications
role: symbol
role_heading: Instance Method
platforms: [provideo encoder extensions 1.0+]
path: "professional_video_applications/compressorextensionencoder/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.

## Declaration

```swift
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:

## Discussion

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.

## See Also

### Encoding and Merging Segments

- [mergeSegments(_:andAudio:toFile:)](professional_video_applications/compressorextensionencoder/mergesegments(_:andaudio:tofile:).md)
- [CompressorExtensionEncoderPtr](professional_video_applications/compressorextensionencoderptr.md)
