i have the following command to overlay gif above png
String command = '-y -i $path.png -i $path.gif -filter_complex '
'[1:v]scale=200:200[i1];'
'[0:v][i1]overlay=100:100'
' -q:v 1 $output.gif';
it work fine , but the problem is that my first input ($path.png) is no longer transparently as what it was before execute .
in other word : before i execute the command my path.png has rounded corners and transparently background , when i overlay the gif above it so it totally effect path.png like it remove the rounded corners and background became black .
when i overlay png instead of gif so it does not effect the path.png and everything is fine .
So how to to overlay gif with preserving the transparently of path.png and it's rounded corner too . thanks
Edit
this is the first input (png)
this is second input (gif)
Now i am trying to overlay the second input (gif) above the first input (png)
'-y -i png -i gif -filter_complex '
'[1:v]scale=$w:$h[i1];'
'[0:v][i1]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)-10'
' -q:v 1 outputGif';
OUTPUT
as you can see , it lost the black transparently and rounded corners
and the following is @Rotem command
'-y -i png -i gif -filter_complex '
'"[1:v]scale=$w:$h[i1];'
'[0:v][i1]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)-10:'
'format=auto,split[s0][s1];[s0]palettegen=reserve_transparent=1[p];[s1][p]paletteuse" -q:v 1 outputGif';
output
it became totally transparent . but i am trying to keep that black transparent background like original and not fully transparent






