加速视频处理时间FFMPEG,同时将多个图像添加到视频

问题描述 投票:2回答:1

我试图以特定的时间间隔将多个图像叠加到视频上......但是对于1分钟的视频长度,处理时间太长。我使用了VideoKit图书馆。这是我为视频添加多个图像的代码。

 String[] command = {"-i", inputPath, 
                "-i", imagePath1,"-i", imagePath2,"-i",imagePath3,
                "-filter_complex",
                "[0][1]overlay=y=H-h:enable='between(t,2,10)'[v1];
                 [v1][2]overlay=y=H-h:enable='between(t,10,20)'[v2];
                 [v2][3]overlay=y=H-h:enable='between(t,20,30)'[v3]",
                "-map", "[v3]",  outputPath};

是否有更快的处理库用于视频处理。

android ffmpeg video-processing android-ffmpeg
1个回答
1
投票

我只需添加两个标签,以便加快处理速度。

String [] command = {“ - i”,inputPath,“ - i”,imagePath1,“ - i”,imagePath2,“ - i”,imagePath3,“ - filter_complex”,“[0] [1] overlay = y = Hh:enable ='between(t,2,10)'[v1]; [v1] [2] overlay = y = Hh:enable ='between(t,10,20)'[v2]; [v2] [ 3] overlay = y = Hh:enable ='between(t,20,30)'[v3]“,” - map“,”[v3]“,” - preset“,”ultrafast“,outputPath};

© www.soinside.com 2019 - 2024. All rights reserved.