avmutablecomposition

AVMutableVideoComposition rotated video captured in portrait mode

怎甘沉沦 提交于 2019-11-26 16:23:31
I have used below code to add image overlay over video and then export the new generated video to document directory. But strangely,video gets rotated by 90 degrees. - (void)buildTransitionComposition:(AVMutableComposition *)composition andVideoComposition:(AVMutableVideoComposition *)videoComposition { CMTime nextClipStartTime = kCMTimeZero; NSInteger i; // Make transitionDuration no greater than half the shortest clip duration. CMTime transitionDuration = self.transitionDuration; for (i = 0; i < [_clips count]; i++ ) { NSValue *clipTimeRange = [_clipTimeRanges objectAtIndex:i]; if

AVFoundation + AssetWriter: Generate Movie With Images and Audio

孤街浪徒 提交于 2019-11-26 11:49:53
问题 I have to export a movie from my iPhone application which contains UIImage from an NSArray and add some audio files in .caf format that have to start at pre-specified times. Now I have been able to use the AVAssetWriter (after going through many questions and answers on this and other sites) to export the video portion containing the images but cant seem to find a way to add the audio files to complete the movie. Here is what I have gotten so far -(void) writeImagesToMovieAtPath:(NSString *)

AVMutableVideoComposition rotated video captured in portrait mode

半腔热情 提交于 2019-11-26 04:25:06
问题 I have used below code to add image overlay over video and then export the new generated video to document directory. But strangely,video gets rotated by 90 degrees. - (void)buildTransitionComposition:(AVMutableComposition *)composition andVideoComposition:(AVMutableVideoComposition *)videoComposition { CMTime nextClipStartTime = kCMTimeZero; NSInteger i; // Make transitionDuration no greater than half the shortest clip duration. CMTime transitionDuration = self.transitionDuration; for (i = 0