mergeSegments(_:andAudio:toFile:)
Merges multiple encoded video segments with an encoded audio segment.
Declaration
func mergeSegments(_ videoSegments: [Any]!, andAudio audioSegment: URL!, toFile file: URL!)Parameters
- videoSegments:
An array of encoded video segment URLs.
- audioSegment:
An encoded audio segment URL.
- file:
The destination file URL at which to place the merged segments.
Discussion
During a distributed encoding process, the encoder extension processes audio and video segments separately on the available encoder instances. Once the encoding job completes, the Compressor app invokes mergeSegments(_:andAudio:toFile:): on one of the encoder instances with an audio segment URL, a list of video segment URLs, and the desired output file URL. Implement this method to merge multiple encoded video segments in order, with a complete audio segment, into a single output file.
Install an encoder extension on each node of the cluster that is participating in the encoding process.