Convert Any Video to GIF (MP4, MOV, AVI) — Guide

How to Convert Any Video to GIF (MP4, MOV, AVI) — Free Guide 2026

Seven billion GIFs are sent daily across messaging platforms (Giflytics, 2024), and 69% of Americans say GIFs communicate emotions more effectively than words alone. You've got a video clip and you need a GIF. Maybe it's an MP4 screen recording, an iPhone MOV file, an old AVI clip, or a WebM download. The good news: the conversion process is nearly identical regardless of the source format. FFmpeg doesn't care what container your video uses — it reads them all.

The bad news: each format has quirks that can trip you up. MOV files from iPhones use HEVC (H.265) which some tools can't decode. AVI files might contain ancient codecs. WebM files with alpha channels need special handling. This guide covers every format with the exact commands and gotchas for each.

Key Takeaways

  • FFmpeg converts any video format (MP4, MOV, AVI, WebM, MKV, FLV) to GIF using the same palette method
  • iPhone MOV files use HEVC — make sure your FFmpeg build includes libx265 support
  • Browser-based conversion accepts all common formats and handles codec detection automatically
  • The palette method works identically across formats: generate palette → apply palette → done
  • Optimize output with 10-12fps, 480px width, and 3-5 second duration for best results

Video Formats Explained (For GIF Conversion)

Before converting, it helps to understand what you're working with. Video formats are really two things: a container (the file extension) and a codec (the compression algorithm inside).

FormatContainerCommon CodecsWhere You Get It
MP4MPEG-4 Part 14H.264, H.265/HEVCEverywhere — most universal
MOVQuickTimeH.264, HEVC, ProResiPhone recordings, Mac apps
AVIAudio Video InterleaveMPEG-4, DivX, Xvid, MJPEGLegacy cameras, old downloads
WebMMatroska-basedVP8, VP9, AV1Web downloads, Discord, YouTube
MKVMatroskaNearly anythingRips, screen recorders
FLVFlash VideoH.264, VP6Old web videos

Why this matters for GIF conversion: The container format is mostly irrelevant — FFmpeg reads all of them. What matters is the codec inside. HEVC (common in iPhone MOV files) requires specific FFmpeg libraries. ProRes (from Final Cut Pro) produces huge files. Ancient AVI codecs might need legacy codec packs. The conversion commands are identical; the setup differs.

The Universal GIF Conversion Command

This two-step palette method works for every video format FFmpeg supports:

Step 1: Generate palette

ffmpeg -i input.VIDEO -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" palette.png

Step 2: Convert with palette

ffmpeg -i input.VIDEO -i palette.png -lavfi "fps=12,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse" output.gif

Replace input.VIDEO with your actual file — clip.mp4, recording.mov, old_video.avi, download.webm. The commands are identical.

Single-command version (no intermediate file):

ffmpeg -i input.VIDEO -filter_complex "[0:v] fps=12,scale=480:-1:flags=lanczos,split [a][b];[a] palettegen [p];[b][p] paletteuse" output.gif

Format-Specific Commands and Gotchas

MP4 to GIF

MP4 is the most common source format. H.264-encoded MP4 files work with every FFmpeg build out of the box.

ffmpeg -i clip.mp4 -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" palette.png
ffmpeg -i clip.mp4 -i palette.png -lavfi "fps=12,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse" output.gif

Gotcha: MP4 files with H.265/HEVC encoding (increasingly common from modern phones) require FFmpeg compiled with --enable-libx265. Check with ffmpeg -decoders | grep hevc.

Detailed MP4 to GIF guide with optimization tips

MOV to GIF (iPhone & Mac)

MOV files from iPhones typically use HEVC (H.265) at up to 4K resolution. Two things to watch for:

# Standard MOV to GIF
ffmpeg -i recording.mov -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" palette.png
ffmpeg -i recording.mov -i palette.png -lavfi "fps=12,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse" output.gif

Gotcha 1: HEVC decoding. If you see Decoder hevc not found, your FFmpeg doesn't support H.265. On Mac, install with Homebrew: brew install ffmpeg (includes HEVC by default). On Linux: sudo apt install ffmpeg (most recent distros include it).

Gotcha 2: iPhone 4K resolution. iPhone records at 3840x2160. Scaling to 480px is a 8x reduction. Use scale=640:-1 if you need more detail, but expect larger files.

Gotcha 3: ProRes MOV. Final Cut Pro exports use Apple ProRes, which produces massive files (a 10-second clip can be 500 MB+). FFmpeg handles ProRes fine — the palette method automatically manages the color conversion.

AVI to GIF

AVI is a legacy format that can contain almost any codec. Most issues come from old, uncommon codecs.

ffmpeg -i old_clip.avi -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" palette.png
ffmpeg -i old_clip.avi -i palette.png -lavfi "fps=12,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse" output.gif

Gotcha: Unknown codecs. If FFmpeg reports Unknown decoder, the AVI uses a proprietary codec (common with old security cameras and early 2000s video). Try converting the AVI to MP4 first:

ffmpeg -i old_clip.avi -c:v libx264 -preset fast temp.mp4
ffmpeg -i temp.mp4 -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" palette.png
ffmpeg -i temp.mp4 -i palette.png -lavfi "fps=12,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse" output.gif

Gotcha: Variable frame rate. Some AVI files have inconsistent frame timing. Add -vsync vfr if you see frame duplication or stuttering in the output GIF.

WebM to GIF

WebM files are common from web downloads, Discord, and screen recorders. VP8 and VP9 work out of the box.

ffmpeg -i download.webm -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" palette.png
ffmpeg -i download.webm -i palette.png -lavfi "fps=12,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse" output.gif

Gotcha: Alpha channel. Some WebM files have transparency (VP9 with alpha). GIF supports 1-bit transparency (pixel is either fully transparent or fully opaque). FFmpeg will convert the smooth alpha to binary — edges may look jagged. If the source has a transparent background, consider adding a solid color:

-vf "fps=12,scale=480:-1:flags=lanczos,format=rgba,colorize=color=white"

Browser-Based Conversion (Any Format)

Don't want to install FFmpeg? Our browser-based converter handles all common formats automatically.

Steps:

  1. Go to GifToVideo.net/video-to-gif
  2. Drop your video file (MP4, MOV, AVI, WebM, MKV)
  3. Adjust frame rate, width, and trim points
  4. Click Convert — download your GIF

Format support note: The browser converter uses FFmpeg.wasm which supports all major codecs including H.264, HEVC, VP8, VP9, and most legacy AVI codecs. Your file never leaves your device — everything processes locally in your browser. The tradeoff: it's slower than native FFmpeg, especially for large files (over 50 MB).

Converting iPhone and Android Videos

iPhone (MOV/HEVC)

iPhones record in MOV with HEVC by default since iPhone 7. The files are typically 30fps at 1080p or 4K.

Quick method: Drop your .mov file on GifToVideo.net/video-to-gif — it handles HEVC automatically.

FFmpeg method with trimming:

# Trim to 3 seconds starting at 00:05, then convert to GIF
ffmpeg -ss 5 -t 3 -i IMG_1234.MOV \
  -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" palette.png
ffmpeg -ss 5 -t 3 -i IMG_1234.MOV -i palette.png \
  -lavfi "fps=12,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse" output.gif

Android (MP4/H.264)

Android phones record in MP4 with H.264 — the easiest format to work with. No special handling needed.

ffmpeg -i VID_20260518.mp4 -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" palette.png
ffmpeg -i VID_20260518.mp4 -i palette.png \
  -lavfi "fps=12,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse" output.gif

Optimization Tips for All Formats

Regardless of source format, the same optimization rules apply:

SettingRecommendationImpact
Frame rate10-12 fps50-60% size reduction vs 30fps
Width480pxGood for Slack/Discord/email
Duration3-5 secondsEvery extra second adds ~20%
Colors256 (default)Reduce to 128 for another 15-20%
Post-processinggifsicle -O3 --lossy=80Additional 10-30% reduction

Target sizes by platform:

  • Slack: Under 5 MB (25 MB max)
  • Discord: Under 5 MB (8 MB max for free)
  • Email: Under 1 MB
  • GitHub README: Under 3 MB

For detailed optimization techniques, see our MP4 to GIF guide.

Batch Conversion (All Formats at Once)

Convert a folder of mixed-format videos to GIF:

for f in *.mp4 *.mov *.avi *.webm; do
  [ -f "$f" ] || continue
  name="${f%.*}"
  ffmpeg -i "$f" -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" /tmp/palette.png
  ffmpeg -i "$f" -i /tmp/palette.png \
    -lavfi "fps=12,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse" \
    "${name}.gif"
  echo "Converted: $f → ${name}.gif"
done

Frequently Asked Questions

Can I convert any video format to GIF?

Yes. FFmpeg supports virtually every video format: MP4, MOV, AVI, WebM, MKV, FLV, WMV, MPEG, 3GP, and many more. The conversion command is identical regardless of the source format — only the input filename changes. The occasional exception is a file using a proprietary or very old codec, in which case converting to MP4 first usually solves the problem.

Why does my iPhone MOV file fail to convert?

Most likely because your FFmpeg installation doesn't include HEVC (H.265) decoder support. iPhones record in HEVC by default since iPhone 7. On Mac, brew install ffmpeg includes HEVC. On Linux, install from your distribution's package manager or download a static build from ffmpeg.org that includes all codecs.

Which video format produces the best GIFs?

The source format doesn't meaningfully affect GIF quality — the palette generation step handles color reduction uniformly. What matters is the source video's resolution, frame rate, and content complexity. A 1080p MP4 and a 1080p MOV with the same content will produce identical GIFs.

How do I convert just a portion of a video to GIF?

Use FFmpeg's -ss (start time) and -t (duration) flags before the input:

ffmpeg -ss 00:01:30 -t 5 -i video.mp4 ...

This starts at 1 minute 30 seconds and captures 5 seconds. Place -ss before -i for fast seeking.

Can the browser converter handle MOV files from iPhone?

Yes. The browser-based converter at GifToVideo.net uses FFmpeg.wasm, which includes HEVC decoding support. Drop your .mov file and it will process locally in your browser — no upload, no server processing, no privacy concerns.

Conclusion

Converting video to GIF is the same process regardless of format. The universal palette method — generate a palette, then apply it — works for MP4, MOV, AVI, WebM, and everything else FFmpeg reads. The only format-specific concern is making sure your tools support the codec inside the container (especially HEVC for iPhone videos).

For quick one-off conversions, use a browser-based converter. For power users and batch processing, FFmpeg with the palette method delivers the best quality. Either way, remember the optimization basics: 10-12fps, 480px wide, 3-5 seconds, and you'll have GIFs that work everywhere.

Ready to convert? Try our free Video to GIF converter — supports MP4, MOV, AVI, WebM, and more. No signup, no upload, instant results.


Sources