在设备上将GIF转换为MP4

是否可以使用遥控器(但我可以先下载它,如果需要)GIF序列并在设备上制作MPMoviePlayerViewController可播放的mp4?

我尝试过使用http://api.online-convert.com/ ,但API不适用,免费版本太受限制了我们的需求。

适用于iOS的Imagemagick似乎也不包含GIF支持。

这并不容易。 这里有一个解决方案的要点。

Swift 3.0版。

https://gist.github.com/powhu/00acd9d34fa8d61d2ddf5652f19cafcf

用法

let data = try! Data(contentsOf: Bundle.main.url(forResource: "gif", withExtension: "gif")!) let tempUrl = URL(fileURLWithPath:NSTemporaryDirectory()).appendingPathComponent("temp.mp4") GIF2MP4(data: data)?.convertAndExport(to: tempUrl, completion: { }) 

1st – 将所有图像与GIF分开。 第二 – 从单独的图像创建video。

请检查一下。 我认为你可以解决你想要的问题。 使用此链接,您可以轻松地将GIF文件转换为MP4。 单击https://github.com/dennygajera/gifToMp4