【问题标题】:Slow lottie animation video rendering with AVAssetWriter and AVAssetWriterInputPixelBufferAdaptor on iPhone X在 iPhone X 上使用 AVAssetWriter 和 AVAssetWriterInputPixelBufferAdaptor 缓慢渲染动画视频
【发布时间】:2020-01-27 08:07:20
【问题描述】:

我正在使用此代码(感谢 damikdk)将彩票动画渲染到视频: https://github.com/damikdk/LottieExportDemo/blob/master/LottieExportDemo/ViewController.swift

我在前一个文件中使用 oldExport() 和这两种方法(追加和填充)来用图像填充像素缓冲区: https://github.com/damikdk/LottieExportDemo/blob/master/LottieExportDemo/Helpers.swift

它在 iphone 5s 上运行良好,大约 1 分钟即可导出 30 秒的视频。但在 iPhone X 上,以相同的分辨率设置导出相同的视频最多需要 10 分钟。有没有办法对其进行优化以在较新的设备上更好地工作?

【问题讨论】:

    标签: ios swift avassetwriter lottie


    【解决方案1】:

    这个存储库是为了演示错误而创建的,你不应该将它用作起点。抱歉,如果从描述中看不出来。

    我不确定您的情况出了什么问题,但如果您在 issues 中分享您的代码,我会检查一下。

    【讨论】:

    • 是否有任何工作方法可以将 Lottie 渲染为视频?
    • @orkenstein 自此评论以来没有任何变化。您可以逐帧导出视频,但如果您想使其超快或使用繁重的动画,lottie-ios 不是一个选项
    • 谢谢!逐帧方法的关键是什么?
    • @orkenstein 尝试this 方法。 1. 为 AnimationView 设置正确的进度 2. 捕获视图 3. 用assetwriter 编写 4. 重复
    • @orkenstein 抱歉,我错过了第一次回复中的链接:“自this comment以来没有任何变化
    猜你喜欢
    • 1970-01-01
    • 2012-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-30
    • 1970-01-01
    相关资源
    最近更新 更多