Problems in making Video from Lottie JSON File and Overlay it with original video using FFMPEG

谁说我不能喝 提交于 2020-08-03 04:01:10

问题


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.

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

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.

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.


回答1:


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.

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 draw bitmap overlay on video



来源:https://stackoverflow.com/questions/56536934/problems-in-making-video-from-lottie-json-file-and-overlay-it-with-original-vide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!