从Lottie JSON文件制作视频并使用FFMPEG将其与原始视频覆盖时出现问题 [英] Problems in making Video from Lottie JSON File and Overlay it with original video using FFMPEG

查看:966
本文介绍了从Lottie JSON文件制作视频并使用FFMPEG将其与原始视频覆盖时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于使用FFMPEG视频处理库和MediaCodec处理Lottie动画,存在一些独特的概念.在这种情况下,我想用Lottie动画制作视频,然后将该视频叠加到其他原始视频上.

there is some unique concept about processing Lottie Animations using FFMPEG video processing library and MediaCodec. In that, I wants to make video from Lottie animation and overlay that video on other original video.

但是问题是我无法从Lottie动画制作具有透明背景的视频.因此,我使用MediaCodec和MediaMuxer从Lottie动画制作了简单的视频,它从Lottie Drawable中抽出一帧并将其附加到视频(Lottie Video)上.这是有关此概念的链接- https://engineering.21buttons.com/how-to-generate-videos-using-lottie-in-android-2db6ecceb2a

But the problem is i'm unable to make a video with transparent background from Lottie animation. So i made simple video from Lottie animation using MediaCodec and MediaMuxer, it takes one by one frame from Lottie Drawable and attach it to the video(Lottie Video). Here is the link about this concept- https://engineering.21buttons.com/how-to-generate-videos-using-lottie-in-android-2db6ecceb2a

然后我使用FFmpeg库将此视频叠加到原始视频上. FFmpeg要做两个任务,首先是在Lottie Video中制作透明背景,其次将Lottie Video覆盖在原始视频上方.

And then i overlay this video to the original video using FFmpeg library. Here FFmpeg does two task, first it makes transparent background in Lottie Video and second it overlays this Lottie Video above the original video.

真正的问题出在这里,FFmpeg在处理25秒的视频时需要花费8至9分钟以上的时间,所以我想解决这个问题,因为我的时间限制只有1至2分钟.任何人都有解决方案或实施此概念的新方法,然后告诉我,我将不胜感激.

And here the actual problem is out, FFmpeg takes more than 8 to 9 minutes in processing of video of 25 seconds, So i wants to get solution for this problem, as i have time limit of only 1 to 2 minutes. Any one has a solution for it or new ides for implementation of this concept, then please tell me i'll appreciate it.

推荐答案

这是您的解决方案,我没有使用FFMPEG库,而是使用OpenGL将Lottie帧直接覆盖到原始视频上.因此,这仅需一步,而使用FFMPEG则需要两步处理.

Here is your solution, Instead of using FFMPEG library, i used OpenGL for overlaying Lottie frames directly to the original video. So, this takes only one step while the use of FFMPEG takes two steps of processing.

因此,这节省了大量视频处理时间.例如,使用OpenGL处理​​30秒的视频只需要35-40秒.如果有人想要针对这种情况的解决方案,我已使用此链接作为参考,

So, this saves a lot of time of video processing. For instance, video of 30 seconds takes only 35-40 seconds for processing using OpenGL. I have used this link for reference, if anyone wants solution for this kind of situation,

Opengl ES 2.0在视频上绘制位图叠加

这篇关于从Lottie JSON文件制作视频并使用FFMPEG将其与原始视频覆盖时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆