For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
StatusSupportDiscussionsLog inSign Up
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
  • Get started
    • Overview
    • Quickstart
  • Upload videos
    • Upload videos from device
    • Upload videos from a URL
    • Upload 4K videos
    • Speed up video processing
  • Playback and delivery
    • Play your videos
    • Embed a video in your app
    • Configure media quality levels
    • Enable MP4 Support for offline viewing
    • Create and manage playlists
  • Edit and transform videos
    • Add metadata to videos
    • Add a watermark to a video
    • Add an intro and outro to a video
    • Clip and trim videos
    • Merge and stitch videos
    • Remove unwanted video segments
  • Manage audio and subtitle tracks
    • Upload and play audio and subtitle tracks
    • Add subtitles to a video
    • Generate subtitles automatically
    • Add audio to a video
    • Replace a video's audio track
    • Normalize audio loudness
    • Overlay audio on a video timeline
  • Extract images from video
    • Create thumbnails from a video
    • Create GIFs from a video
    • Create timeline hovers from a video
  • Video security
    • Generate JWTs for secure media
    • Secure media access with JWTs
    • Restrict playback access
    • Set up DRM encryption
    • FairPlay DRM integration
  • VOD events
    • Media events
    • Transform media events
LogoLogo
StatusSupportDiscussionsLog inSign Up
On this page
  • Prerequisites
  • Key terms
  • Create an on-demand video
  • Monitor the video status
  • Extract a GIF
  • Request details
  • Example request
  • Common use cases for animated previews
  • Best practices for GIF and WebP output
  • Frequently asked questions
  • What’s next?
Extract images from video

Create GIFs from a video

Convert videos to GIFs with customizable dimensions, frame rate, and format using FastPix API.
Was this page helpful?
Previous

Create timeline hovers from a video

Enhance FastPix video player interactivity with timeline hover previews using spritesheets and metadata.
Next
Built with

FastPix converts any on-demand video into an animated GIF or WebP preview that boosts click-through rates and social engagement by adding motion to thumbnails, product pages, and feeds. GIFs are highly popular for adding visual dynamism and are particularly effective in social media, messaging, and content-sharing platforms. This guide walks through the step-by-step process of generating GIFs with FastPix, from video initialization to final output customization.

Prerequisites

  • A FastPix account with an active workspace (Activate your account)
  • Your Access Token ID and Secret Key from the FastPix dashboard
  • An uploaded on-demand video with status ready and a playbackId

Key terms

  • mediaId is the unique identifier FastPix assigns to every uploaded asset.
  • playbackId is a separate, access-controlled identifier used to construct playback and image URLs. FastPix keeps them separate so you can control playback access independently from asset management.

Create an on-demand video

Create the source asset that the GIF will be extracted from. You can upload directly from your device or add the video using a URL. For a walk-through of the full flow, see the quick start guide.


Monitor the video status

Wait for the media status to change to ready before requesting a GIF. Until transcoding completes, the playbackId is not yet bound to renditions that the image service can sample from.

FastPix dashboard showing an on-demand video with status ready

Extract a GIF

Send a GET request to the image endpoint with the target playbackId and the segment you want to convert. The endpoint returns an animated GIF or WebP directly — no polling or webhook is required.

URL format

https://images.fastpix.com/{PLAYBACK_ID}/clip.{gif|webp}

Supported formats: gif or webp. WebP produces smaller files at comparable visual quality and is the better choice for mobile and high-traffic pages. Use gif when the destination platform does not render animated WebP (for example, older email clients).

NOTE:
To generate an animated preview for a video with accessPolicy: private, sign the URL with a JWT. See Secure playback with JWTs.


Request details

  • Method: GET
  • Endpoint: https://images.fastpix.com/{PLAYBACK_ID}/clip.{gif|webp}
  • Auth: HTTP Basic: Access Token ID as username, Secret Key as password

Path parameters

ParameterTypeRequiredDescription
PLAYBACK_IDUUIDYesThe playbackId of the source video.
ServiceWithFormatStringYesOutput format. Either gif or webp.

Query parameters

ParameterTypeRequiredDescription
startFloatNoStart time in seconds on the video timeline. Defaults to 0.
endFloatNoEnd time in seconds. Defaults to 5 seconds after start. Maximum duration is 10 seconds.
heightint32NoHeight in pixels. Defaults to an aspect-ratio-preserving value from width. Maximum 640.
widthint32NoWidth in pixels. Defaults to 320. Maximum 640. If height is set, width adjusts to preserve aspect ratio.
fpsint32NoFrame rate. Defaults to 15. Maximum 30.

Example request

$curl --request GET \
> --url 'https://images.fastpix.com/def4bf9f-6571-4edb-bb5c-ce3bfb60bd95/clip.gif?width=320&height=200&start=0&end=5&fps=15' \
> --user 'your-access-token-id:your-secret-key' \
> --output preview.gif

Example URL

https://images.fastpix.com/def4bf9f-6571-4edb-bb5c-ce3bfb60bd95/clip.gif?width=320&height=200&start=0&end=5&fps=15

Animated GIF output generated from a FastPix on-demand video

Signed URL for private playback

https://images.fastpix.com/5f7d0954-b546-45e6-a38a-9c68bfc57e43/clip.gif?token={JWT}&width=320&height=200&start=0&end=5&fps=15

Common use cases for animated previews

  • Tutorials and walk-throughs: A silent GIF demonstrates a feature: logging in, running a search, opening a setting, without the bandwidth cost of embedding a video.

  • Highlight key moments: Extract a 5-second segment from a longer recording (a goal, a product reveal, a demo beat) and surface it on a landing page or in search results.

  • Social sharing and messaging: When choosing dimensions for your GIF, select sizes that fit within your application’s design and user experience requirements. Consistent sizing keeps your UI looking cohesive and prevents layout shifts. Also, smaller resolutions improve load time, especially important for mobile devices.

  • Product demos in e-commerce: Show a product rotating, a feature animating, or a UI step in motion on a category page where a full video player would be heavyweight.


Best practices for GIF and WebP output

  1. Keep duration between 3 and 5 seconds: The maximum supported is 10 seconds, but shorter clips loop more smoothly and load faster on mobile. This is especially useful in social and e-commerce apps, where users expect quick content previews.

  2. Optimize the frame rate to the motion: The frame rate (fps) determines the GIF’s smoothness. Use fps=15 to fps=20 for hands-on UI demos or fast motion. Drop to fps=10 for subtle motion to cut file size without visible loss.

  3. Cap dimensions at the display size: Requesting a 640x360 GIF that renders at 320x180 wastes bandwidth. The width default of 320 is a good starting point.

  4. Prefer WebP where supported: Animated WebP is typically 25–50% smaller than a comparable GIF at the same quality, which matters on mobile and high-traffic pages.


Frequently asked questions

When should I use WebP instead of GIF?

Use webp for modern browsers and mobile apps, it produces smaller files at comparable quality. Use gif when the destination (older email clients, some embed contexts) does not render animated WebP.

What is the maximum duration of a GIF generated by FastPix?

The end - start window can be up to 10 seconds. If you omit end, FastPix defaults to 5 seconds after start.

Do I need authentication to request a GIF?

Yes. The image endpoint accepts HTTP Basic auth with your Access Token ID and Secret Key. For videos with accessPolicy: private, you additionally need a signed JWT appended as a token query parameter.

Can I control the file size of the animated output?

Indirectly reduce fps, shrink width and height, or shorten the end - start window. Switching gif to webp usually produces the largest single size reduction.


What’s next?

  • Extract thumbnails and images from a video
  • Create clips from existing media
  • Secure playback with JWTs
  • API Reference: image and clip endpoints