4

I am trying to overlay multiple images to the video at certain time interval... but the processing time is too much for a video length of 1 minute. I used VideoKit Library for it. Here is my code for adding multiple images to Video.

 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};

Is there any faster processing library for video processing.

Vivek Faldu
  • 336
  • 3
  • 19
  • If you're encoding with libx264 (H.264 video) or libx265 (H.265/HEVC) then use a faster encoding preset (`-preset` option). See FFmpeg Wiki: [H.264](https://trac.ffmpeg.org/wiki/Encode/H.264) or [H.265](https://trac.ffmpeg.org/wiki/Encode/H.265). – llogan Mar 04 '19 at 06:51
  • @llogan As you said i have used "-preset", "ultrafast" commands and it made processing faster but still i need to work more fluent same as this app : https://play.google.com/store/apps/details?id=com.newbiz.mvmaster – Vivek Faldu Mar 04 '19 at 07:29

1 Answers1

4

I just added two more tags to make processing faster.

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]",
**"-preset", "ultrafast",**  outputPath};
Osama Bin Saleem
  • 779
  • 1
  • 12
  • 24
Vivek Faldu
  • 336
  • 3
  • 19