0

Is it possible to create a video composed of separate videos of different resolutions? I'm taking two different AVAssets that are MPEG4 videos of different resolution (one 300x300 and another 600x600) and using AVMutableComposition to compose them together:

let composition = AVMutableComposition()

composition.insertTimeRange(CMTimeRangeMake(kCMTimeZero, asset1.duration), ofAsset: asset1, atTime: kCMTimeZero)

composition.insertTimeRange(CMTimeRangeMake(kCMTimeZero, asset2.duration), offset: asset2, atTime: asset1.duration)

When I play back the composition, the part where asset2 should start playing is blank. However, if I change asset2 to a video that has the same resolution as asset1, the composed video works as expected (video from asset1 plays followed by video from asset2).

Joe
  • 384
  • 3
  • 13
  • It is, but you'll need to look into using a transform on the track to make sure that the videos are scaled into the same output window correctly. – Tim Bull Apr 20 '16 at 16:32
  • @TimBull ok, thanks for confirming -- is there some sample code you can point me to that does that? – Joe Apr 20 '16 at 18:51

0 Answers0