
MP4 to GIF
Turn an MP4 clip into an animated GIF. WebCodecs decodes the frames and this tool builds the GIF89a bytes itself: one shared 256-colour palette across every sampled frame, no dithering. Browser only.
MP4 to GIF samples an MP4 clip at 10 frames per second by default, scaling frames to 480 pixels wide and stopping after 150 of them. A single shared palette of up to 256 colours covers every sampled frame, with no dithering. Decoding needs a browser tab, so the CLI refuses this page.
Questions
How does an MP4 become a GIF, given WebCodecs has no GIF codec?
In two steps. WebCodecs decodes the video frames, and this tool then builds the GIF89a bytes itself: one shared 256-color palette computed across every sampled frame, with each pixel mapped to its nearest palette entry and no dithering.
What is lost?
Color depth, since every frame is quantized down to a shared 256-color palette rather than the full color range of the video, and most of the frames, since only a sampled subset, controlled by the fps and maxFrames options, makes it into the GIF.
Which engine handles this, and where can it run?
mediabunny and WebCodecs decode the video, and a GIF89a encoder built into this tool writes the result. This needs a browser and is marked browser only; the command line and MCP refuse it and point to the web page.
What size should I expect?
Size grows quickly with resolution, frame count and palette use. A short, low-resolution sample at five frames per second, 160 pixels wide, capped at nine frames in the fixture test, still produces a real multi-frame GIF89a file well beyond what an empty animation would need.
What is the reverse page?
GIF to MP4 runs the opposite direction, the reverse pair of this one, decoding the frames stored in the GIF and re-encoding them as video through WebCodecs.