FFMPEG fade out image overlay issue on windows 10 sorry if my question is not exactly the correct format, this is my first post here
I have created  a ffmpeg one line code that will  fade in and fade out a transparent .png as a overlay
here is my code:
bin\ffmpeg -t 10 -i &quot;video w bottom.mp4&quot; -i &quot;utube watermark.png&quot; -filter_complex &quot;[1:v]format=rgba,geq=r='r(X,Y)':a='0.75*alpha(X,Y)',scale=150:150,zoompan=d=25*4:d=125:s=150x150,fade=in:st=2:d=1:alpha=1,fade=out:st=4:d=1:alpha=1[im];[0][im]overlay=10:10:enable='between(t,0,5)'&quot; -c:a copy preview.mp4

now this works great!  BUT...  the issue i am having is if i try and change up the here:
fade=out:st=4  and enable='between(t,0,5)
then it no longer fades out correctly if say i change it to:
fade=out:st=5  and enable='between(t,0,6)
EDIT:
Here is the final code with with the info i got from @Gyan (I am sure can be cleaned up better)
SET /A overlayStart=2
SET /A overlayLength=6
SET /A fadeInDuration=1
SET /A fadeOutDuration=1
SET /A fps=30

SET /A startOverlayFadeIn=%overlayStart%
SET /A startOverlayFadeOut=%overlayStart%+%overlayLength%
SET /A betweenEnding=%startOverlayFadeOut%+%fadeInDuration%
SET /A overlayFullLength=%overlayStart%+%overlayLength%+%fadeInDuration%+%fadeOutDuration%
SET /A dur=%overlayFullLength%+4

bin\ffmpeg -t %dur% -i &quot;video w bottom.mp4&quot; -i &quot;utube watermark.png&quot; -filter_complex &quot;[1:v]format=rgba,geq=r='r(X,Y)':a='0.75*alpha(X,Y)',scale=150:150,zoompan=d=%fps%*%overlayFullLength%:s=150x150,fade=in:st=%startOverlayFadeIn%:d=%fadeInDuration%:alpha=1,fade=out:st=%startOverlayFadeOut%:d=%fadeOutDuration%:alpha=1 [im];[0][im]overlay=10:10:enable='between(t,0,%dur%)'&quot; -c:a copy preview.mp4

Hope this helps someone else out and/or they can expand on this
In zoompan, you have set d=125 so @ 25 fps, zoompan will create a 5-second stream.
Thus there are no frames after 5s for the fade to be applied to. The duration of the stream should be enough to cover the end of the fade transition. For st=5:d=1, total duration should be 5+1=6 or more.
Change to d=150.
P.S. In d=25*4:d=125 the first d=VALUE is overridden by the 2nd one, so it is useless.