Skip to content

Instantly share code, notes, and snippets.

@kobelb
Created July 28, 2016 19:42
Show Gist options
  • Save kobelb/7262afb7e242b41cf4765972bd0c7024 to your computer and use it in GitHub Desktop.
Save kobelb/7262afb7e242b41cf4765972bd0c7024 to your computer and use it in GitHub Desktop.
if mediaType == AVMediaTypeVideo, let assetWriterAndInputs = self.newAssetWriterAndInputs {
let sourceTime = CMSampleBufferGetPresentationTimeStamp(sampleBuffer)
assetWriterAndInputs.assetWriter.startSessionAtSourceTime(sourceTime)
self.currentAssetWriterAndInputs = assetWriterAndInputs
self.newAssetWriterAndInputs = nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment