IOS Video Editing - Is it possible to merge (side by side not one after other) two video files into one using iOS 4 AVFoundation classes?

Yes it is possible to merge 2 videos: 1. Add both assets to an AVMutableComposition at start time 0 2. Set the preferred Transform to the tracks, in this example scale transform.

Yes it is possible to merge 2 videos: 1. Add both assets to an AVMutableComposition at start time 0. 2.

Set the preferred Transform to the tracks, in this example scale transform. - (void) mergeVideos{ ///... after getting hold or your assets....firstAsset, secondAsset AVMutableComposition* mixComposition = AVMutableComposition composition; AVMutableCompositionTrack *firstTrack = mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTracfirst:kCMPersistentTracfirst_Invalid; firstTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, firstAsset. Duration) ofTrack:firstAsset tracksWithMediaType:AVMediaTypeVideo objectAtIndex:0 atTime:kCMTimeZero error:nil; AVMutableCompositionTrack *secondTrack = mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTracfirst:kCMPersistentTracfirst_Invalid; secondTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, secondAsset.

Duration) ofTrack:secondAsset tracksWithMediaType:AVMediaTypeVideo objectAtIndex:0 atTime:kCMTimeZero error:nil; secondTrack setPreferredTransform:CGAffineTransformMakeScale(0.25f,0.25f); //... export video here... }.

Thanks, I will try it out. Unfortunately, I cannot vote on the answer as I am new to SO. – Naga Apr 27 at 14:09 But, addMutableTrackWithMediaType: preferredTracfirst: API does not exists.

Only the API addMutableTrackWithMediaType:preferredTrackID: exists. I tried with the API addMutableTrackWithMediaType:preferredTrackID itself and I am getting only the first video in the exported video. – spd Dec 14 at 8:24 Sorry for late reply.

YOu should use one MutableComposition tract instead of two. – prasanna Dec 15 at 16:08.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions