2 years ago

#9438

test-img

Joan Cardona

Slice and merge videos in AVFoundation

I have a big video file and I want to make a new video from pieces of that big one.

I have an array of seconds like: [20, 35, 100, 267, 490, 699] and an offset like 2 and I would love to make a mew video that contains:

From second 20 to 22 to 35 to 37 to 100 to 102 to 267 to 269 to 490 to 492 to 699 to 701. How can I achieve something like this in AVFoundation?

This should be as efficient as possible since I will do that many times on device and the files are big.

So far the only idea I've seen with a bit of potential is to trim the video to the desired seconds and then merge them all.

Thanks

ios

swift

avfoundation

avkit

0 Answers

Your Answer

Accepted video resources