1

I want to merge two videos, it look likes:

  • Video A: enter image description here

  • Video B: enter image description here

  • Last video: enter image description here

This is a very interesting deal, you could try this on app named SHOOT.I want to implement a similar effect, but how? Can GPUImage or AVAnimator help me implement it?

I had try GPUImage like this:

let movieURL = URL(
    string: "sample_iPod.m4v",
    relativeTo: Bundle.main.resourceURL!
    )!
let specialMovieURL = URL(
    string: "cartoon_watermark.mov",
    relativeTo: Bundle.main.resourceURL!
    )!
let writerURL = URL(
    fileURLWithPath: NSTemporaryDirectory().appending("last.mov")
)
print("Writer URL: \(writerURL)")

do {
    try FileManager.default.removeItem(at: writerURL)
} catch let error {
    print(error.localizedDescription)
}

self.movie = GPUImageMovie(url: movieURL)
self.movie.delegate = self
self.movie.playAtActualSpeed = true

self.specialMovie = GPUImageMovie(url: specialMovieURL)
self.specialMovie.playAtActualSpeed = true

self.filter = GPUImageScreenBlendFilter()

self.movie.addTarget(self.filter)
self.specialMovie.addTarget(self.filter)
self.filter.addTarget(self.renderView)

self.movie.startProcessing()
self.specialMovie.startProcessing()

It didn't works...Or if I could use AVFoundationKit to get it done?

Thank you for your answer :)

Leo
  • 1,545
  • 13
  • 24
  • look at these links https://www.raywenderlich.com/13418/how-to-play-record-edit-videos-in-ios https://stackoverflow.com/questions/35859872/how-to-merge-multiple-videos-using-avasset-in-ios I have never used them but should be useful for you. – Gagan_iOS May 26 '17 at 07:58
  • @Gagan_iOS Thank you but this post couldn't help me in this case... – Leo May 26 '17 at 08:50
  • See the Fireworks example app on the AVAnimator page, it shows how to overlay one video on top of 1 to N other videos. – MoDJ Sep 01 '17 at 18:11

0 Answers0