October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Cupertino desk4 min

How to Convert Video to an Optimized GIF on macOS with FFmpeg

Use FFmpeg’s palette filters on macOS to convert a trimmed video excerpt into a GIF, then adjust frame rate, dimensions, dithering, and transparency for your clip.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a compact, cleaner-looking GIF on a Mac, trim the video to the moment you need, choose an output frame rate and width, then use FFmpeg’s palettegen and paletteuse filters to build and apply a palette from those frames. A two-pass conversion makes it straightforward to adjust the settings and inspect the result.

Install FFmpeg on macOS

If FFmpeg is not already installed, Homebrew documents this installation command:

As an Amazon Associate I earn from qualifying purchases.

brew install ffmpeg
ffmpeg -version

The first command installs FFmpeg; the second prints the installed version. Homebrew’s formula and macOS bottle availability can change, so check the FFmpeg Homebrew formula if you need current package or platform details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Convert a trimmed video with a two-pass palette workflow

This example starts five seconds into input.mp4, converts three seconds at 12 frames per second, and scales the output to 480 pixels wide while preserving the aspect ratio. Replace the filename and adjust the timing and dimensions for your clip.

#1 Best Overall
Sale
Apple 2025 MacBook Pro Laptop with Apple M5 chip with 10‑core CPU and 10‑core GPU: Built for AI, 14.2-inch Liquid Retina XDR Display, 16GB Unified Memory, 1TB SSD Storage; Space Black
  • SUPERCHARGED BY M5 — The 14-inch MacBook Pro with M5 brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. Featuring all-day battery life and a breathtaking Liquid Retina XDR display with up to 1600 nits peak brightness, it’s pro in every way.*
  • HAPPILY EVER FASTER — Along with its faster CPU and unified memory, M5 features a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance. So you can blaze through demanding workloads at mind-bending speeds.
  • BUILT FOR APPLE INTELLIGENCE — Apple Intelligence is the personal intelligence system that helps you write, express yourself, and get things done effortlessly. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
  • ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.
  • APPS FLY WITH APPLE SILICON — All your favorites, including Microsoft 365 and Adobe Creative Cloud, run lightning fast in macOS.*
ffmpeg -ss 5 -t 3 -i input.mp4 
  -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" 
  palette.png

ffmpeg -ss 5 -t 3 -i input.mp4 -i palette.png 
  -lavfi "fps=12,scale=480:-1:flags=lanczos[x];[x][1:v]paletteuse" 
  -loop 0 output.gif
  1. Generate the palette. The first command selects the excerpt, sets the frame rate and width, then writes a palette image named palette.png.
  2. Encode the GIF. The second command processes the same excerpt with the same frame-rate and scaling settings, applies the palette, and writes output.gif. The -loop 0 option requests continuous looping.

Matching frame selection, frame rate and scaling in both passes helps ensure that the palette is generated for the frames used in the GIF. These are adjustable example settings, not universal quality or size recommendations. FFmpeg documents this palette workflow in its filter reference.

Use a one-command alternative

FFmpeg can generate and apply the palette within one filter graph:

Rank #2
Sale
Apple 2026 MacBook Pro Laptop with Apple M5 Pro chip with 18-core CPU and 20-core GPU: Built for AI, 16.2-inch Liquid Retina XDR Display, 24GB Unified Memory, 1TB SSD, Wi-Fi 7; Space Black
  • FAST RUNS IN THE FAMILY — The 16-inch MacBook Pro with the M5 Pro or M5 Max chip brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. With all-day battery life, double the starting storage,* and a breathtaking Liquid Retina XDR display, it’s pro in every way.*
  • BUCKLE UP — Along with a next-generation CPU, faster unified memory, and up to 2x faster SSD storage,* M5 Pro and M5 Max feature a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance and on-device training capabilities. So you can blaze through demanding workloads at mind-bending speeds.
  • BUILT FOR AI — Apple silicon, and every major component that powers it, is designed to run demanding on-device AI workloads like LLM inference and training. And Apple Intelligence helps you write, express yourself, and get things done effortlessly with groundbreaking privacy protections at every step.*
  • ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.*
  • MACOS RUNS APPS FAST — All your go-to apps run lightning fast in macOS, including built-in apps like FaceTime and Messages. Plus, built-in virus protection and free software updates help keep your Mac running smoothly and securely.
ffmpeg -ss 5 -t 3 -i input.mp4 
  -filter_complex "[0:v]fps=12,scale=480:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse" 
  -loop 0 output.gif

The split filter sends the selected, scaled frames down two paths: one generates the palette, and the other uses it to create the GIF. If you are troubleshooting filter-graph quoting or want to change settings in stages, use the two-pass commands first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose settings for the right balance of size and appearance

There is no single setting that minimizes file size while preserving every detail. Compare the resulting file’s size and appearance at its intended display size.

Rank #3
Sale
Apple 2026 MacBook Pro Laptop with Apple M5 Pro chip with 18-core CPU and 20-core GPU: Built for AI, 16.2-inch Liquid Retina XDR Display, 48GB Unified Memory, 1TB SSD, Wi-Fi 7; Space Black
  • FAST RUNS IN THE FAMILY — The 16-inch MacBook Pro with the M5 Pro or M5 Max chip brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. With all-day battery life, double the starting storage,* and a breathtaking Liquid Retina XDR display, it’s pro in every way.*
  • BUCKLE UP — Along with a next-generation CPU, faster unified memory, and up to 2x faster SSD storage,* M5 Pro and M5 Max feature a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance and on-device training capabilities. So you can blaze through demanding workloads at mind-bending speeds.
  • BUILT FOR AI — Apple silicon, and every major component that powers it, is designed to run demanding on-device AI workloads like LLM inference and training. And Apple Intelligence helps you write, express yourself, and get things done effortlessly with groundbreaking privacy protections at every step.*
  • ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.*
  • MACOS RUNS APPS FAST — All your go-to apps run lightning fast in macOS, including built-in apps like FaceTime and Messages. Plus, built-in virus protection and free software updates help keep your Mac running smoothly and securely.
Setting What it changes How to tune it
Clip duration The amount of motion and number of frames in the GIF. Keep only the essential action; a shorter excerpt generally contains fewer frames.
Frame rate Motion smoothness and frame count. Use the lowest rate that still communicates the action. Reduce it to cut frames, or raise it if motion looks too choppy.
Dimensions Pixel detail and output data. In scale=480:-1, 480 sets the width in pixels and -1 lets FFmpeg calculate a proportional height. Choose a width appropriate for the display destination.
Palette How source colors are mapped into the GIF’s limited palette. palettegen builds a palette from the video frames. Its max_colors option can lower the color count, at the cost of color detail.
Dithering How color transitions and texture appear after palette mapping. Compare the result on your clip. FFmpeg documents several methods, including Bayer, Floyd–Steinberg, Sierra, Atkinson, Burkes and no dithering; its documented default is sierra2_4a.

For a smaller-dimension, lower-frame-rate starting point, use fps=8,scale=320:-1:flags=lanczos in both passes. Smaller dimensions or fewer frames usually reduce output data, but can make motion less smooth or details harder to read. Check the encoded file rather than assuming a specific size reduction.

Adjust palette behavior for changing scenes

For clips with substantial movement or changing areas, FFmpeg offers palette options that alter how frames contribute to palette generation and application. palettegen=stats_mode=diff gives more weight to areas that change between frames. paletteuse=diff_mode=rectangle limits processing to the changing rectangle; FFmpeg notes that this can help speed and compression in relevant clips, particularly with error-diffusion dithering. Neither setting is guaranteed to improve every GIF, so compare the output with and without them.

Rank #4
Sale
Apple 2025 MacBook Pro Laptop with Apple M5 chip with 10‑core CPU and 10‑core GPU: Built for AI, 14.2-inch Liquid Retina XDR Display, 24GB Unified Memory, 1TB SSD Storage; Space Black
  • SUPERCHARGED BY M5 — The 14-inch MacBook Pro with M5 brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. Featuring all-day battery life and a breathtaking Liquid Retina XDR display with up to 1600 nits peak brightness, it’s pro in every way.*
  • HAPPILY EVER FASTER — Along with its faster CPU and unified memory, M5 features a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance. So you can blaze through demanding workloads at mind-bending speeds.
  • BUILT FOR APPLE INTELLIGENCE — Apple Intelligence is the personal intelligence system that helps you write, express yourself, and get things done effortlessly. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
  • ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.
  • APPS FLY WITH APPLE SILICON — All your favorites, including Microsoft 365 and Adobe Creative Cloud, run lightning fast in macOS.*
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Understand color and transparency limits

GIF uses a palette of up to 256 colors. FFmpeg describes its palette as a 256-pixel image; unused palette entries are black. By default, palettegen reserves the last entry for transparency, which limits generated colors to 255. If transparency matters, paletteuse also provides an alpha_threshold setting to determine which alpha values become transparent or opaque.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

GIF transparency is not continuous, full-range partial transparency. Soft translucent edges from a source video may therefore look different when converted. Inspect edges against the background where the GIF will be displayed.

Best Value
Sale
Apple 2025 MacBook Pro Laptop with Apple M5 chip with 10‑core CPU and 10‑core GPU: Built for AI, 14.2-inch Liquid Retina XDR Display, 16GB Unified Memory, 1TB SSD Storage; Silver
  • SUPERCHARGED BY M5 — The 14-inch MacBook Pro with M5 brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. Featuring all-day battery life and a breathtaking Liquid Retina XDR display with up to 1600 nits peak brightness, it’s pro in every way.*
  • HAPPILY EVER FASTER — Along with its faster CPU and unified memory, M5 features a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance. So you can blaze through demanding workloads at mind-bending speeds.
  • BUILT FOR APPLE INTELLIGENCE — Apple Intelligence is the personal intelligence system that helps you write, express yourself, and get things done effortlessly. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
  • ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.
  • APPS FLY WITH APPLE SILICON — All your favorites, including Microsoft 365 and Adobe Creative Cloud, run lightning fast in macOS.*

Check the output before sharing it

  • Confirm that the GIF shows the intended excerpt and loops as expected.
  • Check that text, faces or other important details remain readable at the intended display size.
  • Compare file size, dimensions, frame rate, motion smoothness, color banding and dithering texture.
  • If the file is too large, shorten the excerpt, lower the frame rate or reduce the width, changing one setting at a time so you can see the trade-off.
  • If gradients or edges look poor, compare dithering choices and inspect whether transparency is needed.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.