如果对av foundation 不熟悉得话,建议先看看wwdc 2010 关于avfoundation得讲座。http://blog.csdn.net/linzhiji/article/details/6752722
I have a video file and an audio file. Is it possible to merge itto one video with with sound file. I think AVMutableComposition should help me, but I still dont understand how. any advices?
AVURLAsset* audioAsset = [[AVURLAsset alloc]initWithURL:audioUrloptions:nil];AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:videoUrloptions:nil];
AVMutableComposition* mixComposition = [AVMutableCompositioncomposition];
AVMutableCompositionTrac
[compositionCommentaryTra
AVMutableCompositionTrac
[compositionVideoTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero,videoAsset.duration)
AVAssetExportSession* _assetExport = [[AVAssetExportSession alloc]initWithAsset:mixComposition
NSString* videoName = @"export.mov";
NSString *exportPath = [NSTemporaryDirectory()stringByAppendingPathCom
NSURL
if ([[NSFileManager defaultManager]fileExistsAtPath:exportPath])
{
}
_assetExport.outputFileType = @"com.apple.quicktime-movie";
DLog(@"file type %@",_assetExport.outputFileType);
_assetExport.outputURL = exportUrl;
_assetExport.shouldOptimizeForNetwork
[_assetExport exportAsynchronouslyWith