Using ffmpeg to convert gifs to mp4

hi all, i’d eventually like to write a plugin for r_e_c_u_r to loop gifs… but for now, I’m using this bash command to bulk convert them to MP4. using the stream_loop flag to avoid jitters

thought this might be useful to somebody!

for i in *.gif; do ffmpeg -hwaccel auto -y -stream_loop 3 -i "$i" -s 640x480 -movflags faststart -pix_fmt yuv420p -vf scale=640:-2,setsar=1:1 "$(basename "$i" .gif)".mp4 ; done

6 Likes