Frame animation captures a video segment and converts it to a dynamic image file, commonly used for video summaries and covers in social media, news reporting, and marketing. ApsaraVideo VOD supports generating dynamic images in GIF and WebP formats.
Introduction
A dynamic image creates a motion effect by rapidly displaying a series of static images. The most common formats on the web are GIF and, to a lesser extent, WebP. Creating a frame animation involves extracting a specific segment from a video and generating a dynamic image file.
ApsaraVideo VOD supports GIF and WebP formats for frame animations. The following table compares the two formats.
|
Format |
Features |
|
GIF |
Offers high compatibility and is often used for web page decoration. |
|
WebP |
Its file size is much smaller than GIF, but it is not supported by some browsers, including Internet Explorer, iOS Safari 3.2 to 13.7, and KaiOS Browser. |
Use cases
-
Social media sharing: Create GIFs from video highlights for quick sharing, or use a frame animation as an eye-catching summary to attract users to watch the full video.
-
Marketing promotion: Use dynamic images from video highlights in advertisements to spark user interest, improve click-through rates, and increase conversion. On e-commerce sites, dynamic images can showcase product features or demonstrate functionality.
-
News reporting and entertainment: In news reporting, editors often capture key moments from news events as dynamic images to present important information concisely. Movie trailers or show highlights can be released as dynamic images for quick browsing.
-
Educational demonstrations: In online courses, teachers can use dynamic images to explain complex concepts or steps, helping students understand and remember information more effectively.
Billing
Frame animation is billed as media transcoding, with charges based on resolution and duration. For more information, see Media transcoding billing.
Usage notes
-
A frame animation may fail to generate if the media file contains only audio and no video stream, the source file is damaged, or the container metadata is invalid.
-
The process of creating a frame animation is asynchronous. You can check the job status by using the DynamicImageComplete callback.
-
The time required to create a frame animation depends on the file size, file duration, and the duration of the animation.
Prerequisites
ApsaraVideo VOD is activated. For more information, see Activate ApsaraVideo VOD.
The RAM user or RAM role that you use has corresponding permissions to access ApsaraVideo VOD. We recommend that you use a RAM user or RAM role to perform operations to improve the security of your account and resources. For more information, see Create and grant permissions to a RAM user.
Step 1: Create a frame animation template
Frame animation templates simplify job submission by letting you pre-configure parameters and reference a template ID instead of passing them for each job.
Step 2: (Optional) Configure event notifications
Before starting a frame animation job, configure an event notification for DynamicImageComplete to receive the job status and the URL of the generated frame animation after the task is complete.
For more information, see Configure callbacks.
Step 3: Start a frame animation job
Step 4: Get frame animation information
-
(Recommended) If you have configured event notifications, you will receive a DynamicImageComplete callback with the animation information.
-
After the frame animation job is complete, you can call the ListDynamicImage operation to retrieve the details of the generated animation.
If you have set the frame animation as the cover, you can call the GetVideoInfo operation to get the URL of the cover animation.
SDK reference
-
For SDK examples related to frame animation templates, see Snapshot jobs and template management.
-
For SDK examples related to frame animation jobs, see Frame animation management.