• Home
  • Posts
  • Projects
  1. Posts
  2. Converting gif files to mp4

Converting gif files to mp4

How I converted the Opus Magnum replay files to mp4.

for f in *.gif
    ffmpeg -i $f -movflags faststart -pix_fmt yuv420p \
        -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" $f.mp4
end

Further reading

  • https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/replace-animated-gifs-with-video