Created
November 26, 2011 21:39
-
-
Save stuffmc/1396335 to your computer and use it in GitHub Desktop.
AVAssetExportSession
This file contains hidden or 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
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