AVFileTypeMPEG4
유형 파일의 메타 데이터를 설정하기 위해 AVAssetExportSession
을 사용하려하지만 으로 파일 유형을 변경하면 이 작동하지 않습니다.하지만 mp4 파일이 필요합니다. 찾을 수 없습니다. 모든 문서가 AVFileTypeMPEG4
파일에 메타 데이터를 설정할 수 없다고 말하면 누구든지 메타를 성공적으로 설정 했습니까?AVAssetExportSession을 통해 AVFileTypeMPEG4 파일의 메타 데이터를 설정하는 방법은 무엇입니까?
NSMutableArray *metadata = [NSMutableArray array];
AVMutableMetadataItem *metaItem = [AVMutableMetadataItem metadataItem];
metaItem.key = AVMetadataCommonKeySource;
metaItem.keySpace = AVMetadataKeySpaceCommon;
metaItem.value = @"Test metadata";
[metadata addObject:metaItem];
AVAssetExportSession *exportSession = [AVAssetExportSession exportSessionWithAsset:composition presetName:AVAssetExportPresetMediumQuality];
exportSession.metadata = metadata;
exportSession.audioMix = audioMix;
exportSession.videoComposition = videoComposition;
exportSession.outputFileType = AVFileTypeMPEG4;//AVFileTypeQuickTimeMovie;
NSString *outputFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"testMetadata.mp4"];
exportSession.outputURL = [NSURL fileURLWithPath:outputFilePath];
[exportSession exportAsynchronouslyWithCompletionHandler:^{
dispatch_async(dispatch_get_main_queue(), ^{
if (exportSession.status == AVAssetExportSessionStatusCompleted) {
//todo
}else{
//todo
}
});
}];
오류 메시지 란 무엇입니까? 지금은 저에게 효과적이었습니다. – gabbler
@gabbler 동영상 내보내기가 성공했지만 동영상에 메타 데이터가 없음 –
메타 데이터가 없다는 것을 어떻게 알게 되셨습니까? 어떤 종류의 메타 데이터가 누락 되었습니까? 메타 데이터가 없거나 "테스트 메타 데이터"가 누락 되었습니까? – gabbler