我想合并两个视频,看起来像:
这是一个非常有趣的交易,你可以在名为SHOOT的应用程序上尝试这个。我想实现类似的效果,但是如何? GPUImage或AVAnimator可以帮助我实施吗?
我尝试过像这样的GPUI:
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()
它不起作用......或者我是否可以使用AVFoundationKit来完成它?
感谢您的回答:)