for i in .mp4; do ffmpeg -i "$i" "${i%.}".gif; done

we can loop through file is

for i in *

loop through mp4

for i in *.mp4

loop through folder

for i in */

Another example from Afnan Sami,

for i in *.png; do ffmpeg -i "$i" "${i%.*}.webp"; done

Image to AVIF with imagemagick

for i in *; do magick "$i" "${i%.*}".avif; done
for i in *; do magick "$i" "${i::-4}.avif"; done

credit - Fazle Rabbi bro