Inserting slowMo AVComposition into AVMutableComposition

97 views Asked by At

PHPhotoLibrary gives an AVComposition rather than an AVURLAsset for a video recorded in SlowMo. I want to insert slowMo videos into another AVMutableComposition, so this means I need to insert this AVComposition into AVMutableComposition which is my editing timeline. The hack I used before was to load the tracks and segments and find the mediaURL of asset.

                    AVCompositionTrack *track = [avAsset tracks][0];
                    AVCompositionTrackSegment *segment = track.segments[0];
                    mediaURL = [segment sourceURL];

Once I had mediaURL, I was able to create a new AVAsset that could be inserted into AVMutableComposition. But I wonder if there is a cleaner approach that allows the slowMo video composition to be directly inserted into the timeline AVMutableComposition?

0

There are 0 answers