Show HN: Vid2gif – Convert .mp4/.mov to optimized GIFs locally using FFmpeg

4 hours ago 1

License Shell Status Demo Homebrew Tap

Convert video files into optimized GIFs using ffmpeg — perfect for README demos and lightweight previews.

I found myself using this script often, so I made it a standalone tool — something you can drop into your $PATH and run whenever you need a clean GIF from a video.

Demo GIF

  • Works entirely offline — nothing is ever uploaded
  • Ideal for GitHub project demos, bug reproductions or sharing animations
  • Easier and safer than uploading to unreliable online converters
  • Converts .mp4, .mov, .mkv, .webm, etc.
  • Uses palette generation for smaller, smoother GIFs.
  • Cleans up temporary files after use.
  • Can append timestamps to avoid overwriting output file.
  • Fully offline, no external dependencies besides ffmpeg.
  • Pure Bash implementation — portable & dependency-free (except ffmpeg)

ffmpeg must be installed and in your $PATH

brew tap mujasoft/tools brew install vid2gif

Option 2: Install globally.

chmod +x vid2gif mv vid2gif /usr/local/bin/
export PATH="$PATH:/path/to/this/repo"
./vid2gif -i input.mov ./vid2gif -i clip.mp4 -o demo.gif
Convert a video file (.mov, .mp4, etc.) to an optimized GIF using FFmpeg. Usage: ./vid2gif -i <input_file> [-o <output_basename> -t] Option(s): -h --help print this help text -i input video file (required) -o output base name (optional, default: output) -t add timestamp to output file (optional, default: false) -v --version print version Examples: ./vid2gif -i demo.mov ./vid2gif -i video.mp4 -o demo.gif -t Output: GIF will be saved as: <output>.gif or output_YYYY-MM-DD_HH-MM-SS.gif
Flag Description
-i Input video file (required)
-o Output name (optional, default: output)
-h --help Show help message
-v --version Show tool version
-t Append a timestamp to output basename (Optional, default=False)

MIT License — see LICENSE for details.

Read Entire Article