androidimagevideoffmpegeffect

Cannot set effect transition in FFmpeg


Im using FFmpeg to create a video from some image . This is my command:

val command = "-framerate 1/3 -i $photo1Path -framerate 1/3 -i $photo2Path -framerate 1/3 -i $photo3Path -i $mp3File -filter_complex \"[0:v]scale=w=min(1080\\,iw):h=min(1080\\,ih):force_original_aspect_ratio=decrease,fade=t=out:st=2:d=1[0v];[1:v]scale=w=min(1080\\,iw):h=min(1080\\,ih):force_original_aspect_ratio=decrease[1v];[2:v]scale=w=min(1080\\,iw):h=min(1080\\,ih):force_original_aspect_ratio=decrease[2v];[0v][1v][2v]concat=n=3:v=1:a=0[v]\" -map 3:a -map \"[v]\" -shortest -c:v libx264 -b:v 5000k -pix_fmt yuv420p -movflags +faststart $outputFilePath2"

I want to add effect between each image, but it's not work. I have consulted quite a few sources, such as this post

About version FFmpeg, Im using

implementation 'com.arthenica:mobile-ffmpeg-full-gpl:4.3.1'

Can anyone have any idea?


Solution

  • I found the answer for my self.

    In above command, I can't set effect transition because it contain '-framerate 1/3' field.

    This field mean set fps for the image = 1/3 per second (it mean 1 frame in 3 second). Therefore, it's not enough frame for effect transition (like fade=in, fade=out)

    The simple way to solve this is replace '-framerate 1/3' with '-loop 1 -t 3'