Created
January 20, 2017 23:37
-
-
Save xcadaverx/4ed43cf209cdef4e138569ab1334fb92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let fullRange = CMTimeRange(start: kCMTimeZero, duration: CMTime(value: 30, timescale: 1)) | |
let emptyComposition = AVMutableComposition() | |
let track = emptyComposition.addMutableTrack(withMediaType: AVMediaTypeVideo, preferredTrackID: 1) | |
let initialSegment = AVCompositionTrackSegment(url: sourceURL, trackID: 1, sourceTimeRange: fullRange, targetTimeRange: fullRange) | |
track.segments = [initialSegment] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment