I am woking with audio and video merge . I am getting crash in
[[AVURLAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]
because of empty array AVURLAsset tracksWithMediaType.
I set .mp4 to .mov still its not working.
Following is the code
NSURL *video_url = [NSURL fileURLWithPath:[UserDefaultsClass getVideoFile]];
NSLog(@"video_url:%@",video_url);
videoAsset = [[AVURLAsset alloc]initWithURL:video_url options:nil];
CMTimeRange video_timeRange = CMTimeRangeMake(kCMTimeZero,audioAsset.duration);
AVMutableCompositionTrack *a_compositionVideoTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];
Here i set fileURLWithPath: still its not working.
In console video_url print : video_url:file:///Users/indecommglobal/Library/Developer/CoreSimulator/Devices/35638854-89D1-429A-A01F-994A34F4E8B3/data/Containers/Data/Application/B5E2DA7E-E8F6-4078-B584-A0335FEEA84F/Documents/RecordedVideo/output03.mov
Really appreciated your help. Thanks.
Aucun commentaire:
Enregistrer un commentaire