Search code examples
androidffmpegencodingrenderingvideo-encoding

FFMPEG android reduce the video rendering time


cmd = "-y "+"-i "+ inputVideo.getAbsolutePath()+" -i "+ inputImage.getAbsolutePath()+  " -filter_complex [1:v]scale=50:200[ovr1],[0:v][ovr1]overlay=5:5:enable='between(t\\,"+0+"\\,"+20+")' -preset ultrafast -c:a aac " + outputVideo.getAbsolutePath();

I'm using this command in FFMPEG to render an image to a video in android. And using this > https://github.com/tanersener/ffmpeg-kit library.

But the thing is either I use preset "ultrafast" or "veryslow" as mentioned in trac.ffmpeg.org, it doesn't show any difference (rendering speeds are same in both instances). No any errors are shown either. So am I doing something wrong here or is there any other way to reduce the rendering time?


Solution

  • Needed to specify the ffmpeg-kit package that support H 264 commands. could achieve it by adding below to the build gradle

        ext {
            ffmpegKitPackage = "min-gpl"
        }