cut videos and merge them using Objective-c

2020-06-30 02:47发布

问题:

I have a doubt.I have two videos and want to cut the 0 to 10 minutes video from first video,10 to 20 minutes video from second video.After that I want to merge the two splitted videos into one video.So Kindly help me how to do this for iOS?

Any help is greatful.

回答1:

Have a look at AVFoundation reference here for general video loading with single frame access classes.

Especially at the "Creating new assets" chapter, which deals with merging two pieces of video together.

There's also a video cropping class you could use to produce the segments you want to merge later with AVMutableComposition: UIVideoEditorController

Look for the AVEditDemo sample from WWDC 2010 for some code examples.