Video to GIF & WebP Preview - Auto Best Clip, Size Target avatar

Video to GIF & WebP Preview - Auto Best Clip, Size Target

Pricing

from $11.90 / 1,000 previews

Go to Apify Store
Video to GIF & WebP Preview - Auto Best Clip, Size Target

Video to GIF & WebP Preview - Auto Best Clip, Size Target

Turn video files into short looping GIF and animated WebP previews (+ optional MP4 loop and thumbnail). Auto-picks the most active, sharp, non-black seconds, or your own clip, or one preview per scene. Fits a file-size target (e.g. under 2 MB). $0.014 per preview.

Pricing

from $11.90 / 1,000 previews

Rating

0.0

(0)

Developer

Kanto Labs

Kanto Labs

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

14 days ago

Last modified

Features

Limited permissions

Share

Video to GIF & WebP Preview: the best seconds of any video as a looping GIF

Video to GIF in one API call: send links to your video files (MP4, MOV, WEBM, MKV...) and get back short looping animated GIF and animated WebP previews, an optional muted MP4 loop and a JPEG thumbnail for each one. You do not have to find the right moment yourself: in auto mode the Actor picks the most active, sharp, non-black seconds of the video. You can also cut your own clip (start + length) or get one preview per scene. A file-size target (for example "under 2 MB" for email or Slack) is met automatically.

Typical uses:

  • Hover previews and thumbnails-in-motion for video libraries, course platforms, marketplaces and product pages
  • GIFs for email newsletters, Slack, GitHub READMEs, docs and help centers (where video does not play)
  • Animated WebP for fast web pages: about 10x smaller than the same GIF
  • Scene previews of long recordings, trailers and ads for review tools and asset managers
  • Bulk previews for AI agents and automations (n8n, Make, Zapier) that need a quick look at a video

How it works

  1. Download the video file (direct links, S3/R2/GCS pre-signed URLs, Dropbox and Google Drive share links, Apify key-value store records).
  2. Choose the span:
    • auto: the encoded frame sizes of the whole video (read without decoding) show where things move; the most active windows plus a few spread-out ones are decoded and scored on real pixels: motion, sharpness, contrast and exposure. Black frames and hard cuts inside the span are penalised. You get the best span, or the N best (previewCount).
    • clip: your startSeconds (seconds or MM:SS) and clipSeconds.
    • scenes: our shot detector (the same one as in Video Scene Detection) finds cuts, dissolves and fades; the liveliest part of each scene becomes a preview, up to maxScenes.
  3. Encode only those seconds: GIF with a per-clip colour palette (ffmpeg palettegen + paletteuse), animated WebP (libwebp), MP4 (H.264, no audio, fast start). Width (default 480 px) and frame rate (default 12 fps) are yours; the source is never upscaled.
  4. Fit the size target if you set one: fewer colours or a lower quality first, then a lower frame rate and width, down to 160 px / 5 fps. If even that is too big, you still get the smallest version and sizeTargetMet: false with a note.

Why run it on Apify

  • API, no ffmpeg setup: call it from any language, or from n8n, Make, Zapier and the Apify MCP server for AI agents.
  • Batch: hundreds of videos in one run, one dataset row per preview, files in the run's key-value store.
  • Schedules and webhooks: make previews of every new upload automatically.

Input example

{
"videoUrls": ["https://your-bucket.s3.amazonaws.com/demo.mp4"],
"mode": "auto",
"clipSeconds": 3,
"previewCount": 1,
"formats": ["gif", "webp"],
"width": 480,
"fps": 12,
"loop": true,
"quality": "balanced",
"maxFileSizeMb": 2
}

Output example

One dataset row per preview (shortened):

{
"fileName": "sample-creative-ad.mp4",
"status": "ok",
"previewIndex": 1,
"mode": "auto",
"thumbnailUrl": "https://api.apify.com/v2/key-value-stores/.../records/...-p1-00015000ms-thumbnail.jpg",
"gifUrl": "https://api.apify.com/v2/key-value-stores/.../records/...-p1-00015000ms.gif",
"gifSizeBytes": 1888299,
"webpUrl": "https://api.apify.com/v2/key-value-stores/.../records/...-p1-00015000ms.webp",
"webpSizeBytes": 194310,
"width": 480, "height": 270, "fps": 12, "frames": 36, "durationSeconds": 3.0, "loop": true,
"sourceStart": 15.0, "sourceEnd": 18.0, "sourceStartTimecode": "00:00:15.000",
"sizeTargetBytes": 2000000, "sizeTargetMet": true,
"encoding": {"gif": {"bytes": 1888299, "width": 480, "fps": 12, "colors": 256, "tries": 1}, "webp": {"bytes": 194310, "quality": 72}},
"selection": {"reason": "Most active, sharp, non-black span of 6 candidate windows.", "score": 0.88, "motion": 4.38, "sharpness": 438.1, "blankShare": 0.0, "cuts": 0, "thumbnailAtSeconds": 16.75},
"sourceDurationSeconds": 30.21, "sourceWidth": 1280, "sourceHeight": 720, "sourceCodec": "h264",
"billedPreviews": 1
}

The "Previews" table view in the Console shows the thumbnail, the time range, links to every file and why that span was chosen.

Pricing

Pay per event, $0.014 per preview (Silver $0.0126, Gold $0.0119). One preview includes every format you ask for (GIF + WebP + MP4) and the thumbnail. Nothing else is billed: no per-minute or platform-usage charge.

Worked example: 200 product videos, one auto preview each = 200 x $0.014 = $2.80. A 40-minute webinar in scenes mode with maxScenes: 10 = 10 previews = $0.14.

Free: refused links, failed downloads, files that are not videos, damaged or black videos, a start time beyond the end of the video and any other error row. Set "Max cost per run" to cap a run: previews that would go over it are not made and are listed as skipped (free).

FAQ

How do I convert a video to GIF without losing quality? Keep 2-4 second clips, 480 px and 10-15 fps, and pick quality: high. GIF is limited to 256 colours per frame, so busy film footage is always larger than a WebP or MP4 of the same clip; use the WebP when the page supports it.

How do I make a GIF under 2 MB for email or Slack? Set maxFileSizeMb: 2. Each file is re-encoded until it fits; encoding shows the final width, fps and colours.

Which video formats work? Anything ffmpeg reads: MP4/M4V (H.264, HEVC), MOV (iPhone, with rotation), WEBM (VP8/VP9), MKV, AVI, OGV, MPEG-TS, and animated GIF input (GIF to WebP).

Can it read YouTube or TikTok links? No. Platform pages are refused because their terms forbid downloading. Link your own file.

Does it keep the sound? No: GIF and WebP have no audio and the MP4 loop is muted, as autoplay previews are.

What does "auto" choose on a screen recording? The span with the most change on screen (scrolling, typing, a new page). On a static slide video, the sharpest and best-exposed part.

Is there a length limit? Previews up to 30 s each. Source videos up to 600 minutes and 4 GB (defaults 180 min / 2 GB). The price does not depend on the video's length.

Known limits

  • Portrait (9:16) videos at the default 480 px width give 480x854 GIFs, about 3x the bytes of a 16:9 GIF. Use width: 320 or a size target for chat and email.
  • Busy footage (film grain, fast pans, confetti) makes large GIFs; the animated WebP of the same clip is usually 5-10x smaller.
  • HDR (10-bit HLG/PQ) phone videos are converted without tone mapping, so colours can look flat.
  • Auto mode looks at a few candidate windows chosen from the whole video's activity, not at every second, and it prefers motion over meaning: it cannot know which moment matters to you. Use previewCount: 3 to get alternatives, or clip mode for an exact moment.

Support

Found a video that fails or a preview you would have cut differently? Open an issue in the Issues tab with the video link and your input; we reply within a day.