To Merge Images And Videos to One Video with Transition To Merge Images And Videos to One Video with Transition objective-c objective-c

To Merge Images And Videos to One Video with Transition


Apple Provides library for video and audio editing library that is AVFoundation Please Refer that library

You can check the sample code for merging videos and also adding images on video on the below link

https://github.com/darcyliu/SampleCode/tree/master/AVSimpleEditoriOS

I the class AVSEAddWatermarkCommand you will find watermarkLayerForSize method which add text layer in the same way you can add image. use below method to add image.

you also need to understand the AVMutableCompositionTrack class this which is used in AVSEAddMusicCommand this will help you. you can use the same class to merge videos.

- (CALayer*)imageLayerForSize:(CGSize)videoSize{    // Create a layer for the title    CALayer *imageLayer = [CALayer layer];    imageLayer.bounds = CGRectMake(0, 0, videoSize.width, videoSize.height);    imageLayer.contents = (id)[UIImage imageNamed:@"myimage.png"];    return imageLayer;}

I hope you will get your answer. still if you have any problem please comment it.