You can create a dynamic image from a video by capturing a specific video segment and generating a dynamic image file. This feature is often used to create video summaries or thumbnails for scenarios such as social media sharing, news reporting, and marketing promotions. ApsaraVideo VOD supports generating dynamic images in GIF and WebP formats. This topic describes how to create a dynamic image from a video using ApsaraVideo VOD.
Introduction
A dynamic image is a set of static images that are displayed in sequence at a specific frequency to create a motion effect. The most common dynamic image formats on the web are GIF and WebP. Creating a dynamic image from a video involves extracting a specific video segment and converting it into a dynamic image file.
ApsaraVideo VOD supports generating dynamic images in GIF and WebP formats. You can choose the format that best suits your business needs. The features of each format are described in the following table.
Format | Features |
GIF | Good compatibility. Often used for website decorations. |
WebP | Much smaller file size than GIF. However, some browsers do not support WebP. Incompatible browsers include Internet Explorer, iOS Safari 3.2 to 13.7, and KaiOS Browser. |
Scenarios
Social media sharing: Create GIFs from exciting video clips for easy sharing. You can also use dynamic images as eye-catching content summaries to entice users to watch the full video.
Marketing promotion: Use dynamic images from video highlights in advertisements to attract user interest. This can increase the click-through rate (CTR) and conversion rate. On e-commerce websites, you can use dynamic images to highlight product features or demonstrate functions.
News and entertainment: In news reporting, editors can create dynamic images of key moments from news events to concisely present important information. Movie trailers or show highlights can be released as dynamic images for viewers to quickly preview.
Educational demos: In online education, teachers can use dynamic images to explain complex concepts or procedural steps. This helps students better understand and retain the information.
Billing
Generating dynamic images is a feature of video transcoding and is billed accordingly. The fees are based on the resolution and duration of the output file. For more information, see Billing for media transcoding.
Notes
Dynamic image generation may fail if the source file is audio-only, the source file is damaged, or the source file has abnormal encapsulation information.
The process of creating a dynamic image is asynchronous. You can retrieve the status of the dynamic image job from the DynamicImageComplete callback.
The time required to create a dynamic image depends on the file size, the video duration, and the duration of the dynamic image.
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 dynamic image template
Dynamic image creation involves multiple parameters. To simplify job submission, ApsaraVideo VOD provides dynamic image templates. You can pre-configure these parameters in a template. Then, you only need to specify the template ID when you submit a dynamic image job, instead of passing all the parameters for each job.
Step 2: (Optional) Configure event notifications for dynamic image jobs
Before you submit a dynamic image job, you can configure event notifications for ApsaraVideo VOD. If you configure the DynamicImageComplete event notification, you will receive the job status and the URL of the generated dynamic image after the job is complete.
For more information about how to configure event notifications, see Configure callbacks.
Step 3: Submit a dynamic image job
Step 4: Get information about the captured dynamic image
If you configured event notifications, you can retrieve information about the dynamic image by receiving the DynamicImageComplete callback message. This method is recommended.
After the dynamic image is created, you can call the ListDynamicImage operation to retrieve information about the generated dynamic image.
If you set the dynamic image as the video thumbnail, you can call the GetVideoInfo operation to retrieve the URL of the dynamic image thumbnail.
