Skip to content

Instantly share code, notes, and snippets.

@stuffmc
Created November 26, 2011 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuffmc/1396335 to your computer and use it in GitHub Desktop.
Save stuffmc/1396335 to your computer and use it in GitHub Desktop.
AVAssetExportSession
AVAsset *asset = [AVAsset assetWithURL:inputURL];
NSLocale *locale = [[asset availableChapterLocales] lastObject];
NSArray *keys = [NSArray arrayWithObjects:AVMetadataCommonKeyTitle, nil];
NSArray *chapters = [asset chapterMetadataGroupsWithTitleLocale:locale containingItemsWithCommonKeys:keys];
// Yes, we do have chapters ;-) 8... ;-)
AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetAppleM4A];
exportSession.outputURL = outputURL;
exportSession.outputFileType = AVFileTypeAppleM4A;
[exportSession exportAsynchronouslyWithCompletionHandler:^{
DLogI(exportSession.status); --> 3 (Succeeded) but lost the chapters.
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment