1
votes

I Have a task to create video with mp4, audio and images with FFmpeg Command, and stuck in overlay issue. animation hide behind image how do i set command ?

I have creating FFmpeg command for my Android application. I have tried with given command. i do interval for 2 images and in given interval change image, till first image video working fine but when image change video will not shown actually image hide it.

ffmpeg -i samplenew.mp4 -i img.jpg -i img2.jpg -filter_complex "[1:v]format=argb,geq=r='r(X,Y)':a='0.5*alpha(X,Y)'[zork];[0:v][zork]overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2:enable='between(t,1,11)'[tmp]; [tmp][2:v]overlay=x=(main_w-overlay_w)/2:y=(main_h-Actuoverlay_h)/2:enable='between(t,11,22)'" -codec:a copy -preset ultrafast -async 1 out.mp4

In actual problem in command, there is change image in defined interval but when image is change video is hide behind image.

1
post what you actually want to achieve as videoVinesh Chauhan

1 Answers

0
votes

first of all, try to understand your command properly. Your Command is Working fine. but you are missing something in command. You have to properly understand FFmpeg command to get the prefect output. in your command you are apply format=argb,geq=r='r(X,Y)':a='0.5*alpha(X,Y) to first image and after tahat you overlay that image on video so first image works fine but check you command have you apply alpha to your second command try to add same format=argb,geq=r='r(X,Y)':a='0.5*alpha(X,Y) for second image you will get desire out what you want to archive

so your final FFmpeg command will be

ffmpeg  -i samplenew.mp4 -i img.jpg -i img2.jpg -filter_complex "[1:v]format=argb,geq=r='r(X,Y)':a='0.5*alpha(X,Y)'[zork];[2:v]format=argb,geq=r='r(X,Y)':a='0.5*alpha(X,Y)'[zork2];[0:v][zork]overlay=x='(main_w-overlay_w)/2':y='(main_h-overlay_h)/2':enable='between(t,1,11)'[tmp]; [tmp][zork2]overlay=x='(main_w-overlay_w)/2':y='(main_h-overlay_h)/2':enable='between(t,11,22)'" -codec:a copy -preset ultrafast -async 1 out.mp4

Note:- always try to understand the command first