MP4 to GIF API - convert video to an animated GIF that fits a size limit
mp4_to_gifConvert an MP4, MOV, WebM, MKV or AVI video (base64, max 15 MB) into an animated GIF with a two-pass colour palette. Trim by start and length (up to 30 s), set width, frames per second, speed, centre crop (square, vertical, wide), loop count, reverse or boomerang. maxSizeMb re-makes the GIF smaller (width, then frames/s, then colours) until it fits, and the response says what was reduced. Deterministic local ffmpeg, 0 AI, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.004/call via x402 at https://radarbg.com/x402/mp4-to-gif.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"fps": "10",
"start": "0",
"width": "320",
"length": "2",
"maxSizeMb": 2
},
"name": "mp4_to_gif"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | Frames per second (lowered automatically when a GIF would exceed 360 frames) | 12 |
| crop | No | Centre crop: keep, square 1:1, vertical 9:16 or wide 16:9 | keep |
| loop | No | How often the GIF plays | forever |
| speed | No | Playback speed: 0.5 slow motion, 2 or 4 fast | 1 |
| start | No | Where the GIF starts: seconds (12.5) or mm:ss (0:12) | 0 |
| width | No | GIF width in pixels, never upscaled (orig = source width up to 800) | 480 |
| length | No | Seconds of video to use, max 30 (empty = to the end of the video) | |
| quality | No | Colours and dithering: best (256, smooth), balanced (256), small (128), tiny (64) | balanced |
| reverse | No | Play backwards (uses up to 10 s, 480 px) | |
| fileName | No | Optional file name, e.g. clip.mp4 (the GIF gets the same name) | |
| boomerang | No | Forward then backward (uses up to 10 s, 480 px) | |
| maxSizeMb | No | Largest GIF size in MB, 0.2 to 10. The GIF is re-made smaller until it fits | |
| fileContent | No | Base64-encoded video: MP4, MOV, WebM, MKV or AVI (max 15 MB; empty = built-in 3-second sample MP4) |