All Products
Search
Document Center

Intelligent Media Management:Video-to-animated-image conversion

Last Updated:Mar 01, 2026

Intelligent Media Management (IMM) converts video files into animated images in GIF or WebP format through the CreateMediaConvertTask API. Convert a full video or a specific time range, with control over frame rate, resolution, and output format. The resulting animated image is saved to an Object Storage Service (OSS) bucket.

zhuandongtu

Use cases

  • Social media clips: Extract short moments from video and share them as animated images on social platforms.

  • Tutorials and demos: Capture step-by-step software operations as looping animated images that readers can follow without playing a video.

  • Stickers and reactions: Turn video moments into animated stickers for messaging apps.

  • Event highlights: Clip key moments from live streams, competitions, or presentations and share them instantly.

Supported input formats

CategoryFormats
VideoMainstream video formats, such as MP4, MPEG-TS, MKV, MOV, AVI, FLV, M3U8, WebM, WMV, RM, and VOB
AudioMainstream audio formats, such as AAC, MP3, WAV, FLAC, WMA, AC3, and Opus

Choose an output format

AspectGIFWebP
QualityLower color depth (256 colors)Full color support, better visual quality
File sizeSmallerTypically larger
Browser supportUniversalAll modern browsers
Best forSimple animations, maximum compatibilityHigh-quality previews, rich-color content
Note

For most use cases, use WebP. It delivers noticeably better image quality. Choose GIF only when broad legacy compatibility is required.

Prerequisites

Before you begin, make sure you have:

Note

You can also create a project by calling the CreateProject API, or list existing projects by calling the ListProjects API.

Procedure

Step 1: Upload a video to OSS

Upload your source video file to an OSS bucket in the same region as your IMM project. Use the OSS console or any OSS SDK.

image

Step 2: Create an animated image conversion task

Call the CreateMediaConvertTask API. Define the source video URI, output format, frame rate, resolution, and output path in the request parameters.

Try the API directly in OpenAPI Explorer with pre-filled parameters and SDK sample code.

For more information about media processing, see Media transcoding.

Usage notes

  • Do not set the Target.URI or Target.Container parameters for animated image conversion. Define the output path in the Image.Animations[].URI field instead.

  • Set FrameRate between 10 and 15 for smooth playback without excessive file size. If FrameRate is not set, the default value is 1/Interval.

  • Use fractional Width and Height values (e.g., 0.5) to scale relative to the source video, or integer values for absolute pixel dimensions.

Parameter examples

The following examples use an IMM project named test-project and convert oss://test-bucket/video-demo/Winemaking.mov to an animated image.

Convert an entire video

This example converts the full video to a WebP animated image at 15 fps, scaled to half the source resolution.

Configuration summary:

ParameterValue
Output formatWebP
Frame extraction interval1 second
Frame rate15 fps
Resolution50% of source (Width: 0.5, Height: 0.5)
Scale typefit (no black borders)
Output pathoss://test-bucket/video-demo/animation.{autoext}
NotificationMNS topic test-mns-topic

For more information about resize methods, see Resize methods.

Request parameters:

{
  "ProjectName": "test-project",
  "Notification": {
    "MNS": {
      "TopicName": "test-mns-topic"
    }
  },
  "Sources": [
    {
      "URI": "oss://test-bucket/video-demo/Winemaking.mov"
    }
  ],
  "Targets": [
    {
      "Image": {
        "Animations": [
          {
            "Format": "webp",
            "FrameRate": 15,
            "Height": 0.5,
            "Interval": 1,
            "ScaleType": "fit",
            "URI": "oss://test-bucket/video-demo/animation.{autoext}",
            "Width": 0.5
          }
        ]
      }
    }
  ]
}

For SDK sample code with pre-filled parameters, visit OpenAPI Explorer. Modify the parameters as needed before debugging.

Convert a specific time range

This example converts seconds 5 through 30 of the video (a 25-second segment) to a WebP animated image with the same output settings.

Configuration summary:

ParameterValue
Output formatWebP
Start time5 seconds
Duration25 seconds
Frame extraction interval1 second
Frame rate15 fps
Resolution50% of source (Width: 0.5, Height: 0.5)
Scale typefit (no black borders)
Output pathoss://test-bucket/video-demo/animation.{autoext}
NotificationMNS topic test-mns-topic

Request parameters:

{
  "ProjectName": "test-project",
  "Notification": {
    "MNS": {
      "TopicName": "test-mns-topic"
    }
  },
  "Sources": [
    {
      "Duration": 25,
      "StartTime": 5,
      "URI": "oss://test-bucket/video-demo/Winemaking.mov"
    }
  ],
  "Targets": [
    {
      "Image": {
        "Animations": [
          {
            "Format": "webp",
            "FrameRate": 15,
            "Height": 0.5,
            "Interval": 1,
            "ScaleType": "fit",
            "URI": "oss://test-bucket/video-demo/animation.{autoext}",
            "Width": 0.5
          }
        ]
      }
    }
  ]
}

For SDK sample code with pre-filled parameters, visit OpenAPI Explorer. Modify the parameters as needed before debugging.

Billing

Video-to-animated-image conversion incurs charges on both the OSS and IMM sides.

Important

Starting from 11:00 on July 28, 2025 (UTC+8), video-to-animated-image conversion changed from free to paid. For details, see the IMM billing adjustment announcement.

IMM charges

For detailed pricing, see IMM billing items.

APIBilling itemDescription
CreateMediaConvertTaskMediaAnimationBilled by the number of frames in the output animated image

OSS charges

For detailed pricing, see OSS pricing.

APIBilling itemDescription
GetObjectGET requestsBilled by the number of successful requests
GetObjectInfrequent Access data retrievalBilled by retrieved data volume, if the source object uses Infrequent Access storage
GetObjectReal-time access of Archive objectsBilled by retrieved data size, if the bucket has real-time access of Archive objects enabled
GetObjectTransfer accelerationBilled by data size, if transfer acceleration is enabled and an acceleration endpoint is used
PutObjectPUT requestsBilled by the number of successful requests
PutObjectStorage feesBilled by storage class, size, and duration of the output object
HeadObjectGET requestsBilled by the number of successful requests

References