To use the short video demo, you must configure the required templates in the ApsaraVideo VOD console. This topic describes how to complete the configuration.
- ApsaraVideo VOD is activated.
Real-name verification is completed for your Alibaba Cloud account. To perform real-name verification, log on to the Alibaba Cloud International site (alibabacloud.com), click Real-name Verification, and then perform operations as promoted.
- A domain name for Content Delivery Network (CDN) is added to the ApsaraVideo VOD console.
For more information, see 添加加速域名.
A canonical name (CNAME) record that is generated by Alibaba Cloud CDN is bound to the domain name at your Domain Name System (DNS) service provider. For more information, see Configure a CNAME record in HiChina.
The content that is stored on the origin server of the domain name for CDN has passed the review. You can store the content in ApsaraVideo VOD or Object Storage Service (OSS). If the content on the origin server is not stored on Alibaba Cloud, submit a ticket before you add the domain name.
Configure ApsaraVideo VOD
- Configure transcoding template groups
To ensure the viewing experience and resource security, the short video demo requires you to configure a transcoding template group. For example, you can configure a transcoding template group that contains a template of low definition (LD) transcoding without watermarks and a template of standard definition (SD) transcoding with watermarks.
- To create a template of LD transcoding without watermarks, select Low Definition from the Definition drop-down list, turn off Watermark, and then click Save.
- To create a template of SD transcoding with watermarks, select Standard Definition from the Definition drop-down list, turn on Watermark, use the default watermark template, and then click Save.
The short video demo allows you to recommend Narrowband HD™ transcoding videos in your short video console. To use this feature, you must configure another transcoding template group that contains a Narrowband HD™ transcoding template.
The IDs of transcoding template groups must be added to the profile of your short video AppServer. We recommend that you note the IDs for use in subsequent configuration. For more information, see Build the short video AppServer.
- Configure callback settings
The short video demo involves callbacks for transcoding, snapshot capture, video AI processing, and automated review. In the short video demo, HTTP requests are used to send callback notifications. When a callback event occurs, ApsaraVideo VOD sends an HTTP POST request to the URL that you specify in the console. The notification content is contained in the HTTP request body. The short video demo provides the basic logic to handle callbacks. You can specify the callback address of the Elastic Compute Service (ECS) instance where the AppServer resides as the callback URL to handle callbacks. You can also deploy an independent HTTP server to receive and handle callbacks.
- Select HTTP Request for the Callback Method parameter.
- Set the Callback URL parameter to the callback address of the ECS instance where the
AppServer resides. The source code in the short video demo provides the basic logic
to handle callbacks.
Example: http://<Public IP address of the ECS instance>:8080/vodcallback/callback
- When you use the short video demo, you must select the following callback events: Single Transcoding Task Completed, All Transcoding Tasks Completed, Screenshot Created, AI Processing Completed, Live Stream Recording Completed, Create Audit Completed, and Clip Synthesis Completed. You can also select other events as needed. When a selected event occurs, ApsaraVideo VOD sends an HTTP POST request to the specified URL to notify the AppServer.
- Configure callback authentication.
When you use HTTP requests as the callback method, we recommend that you configure callback authentication. You can add a specific signed header to each HTTP or HTTPS callback request. This way, when the AppServer receives callback notifications, it authenticates the signature to prevent illegal or invalid requests.Turn on Callback Authentication. Then, specify a custom authentication key and click OK.
The callback URL and authentication key must be added to the profile of the AppServer. We recommend that you note the callback URL and authentication key for use in subsequent configuration. For more information, see Build the short video AppServer.
Make sure that you correctly configure the callback URL, callback events, and callback authentication. Otherwise, callbacks may fail to be handled. For example, a video may be stuck in the Reviewing or Transcoding state.
- Configure download settings
To allow users to download videos, you must enable the download feature.Notice If the download feature is disabled and a mobile user attempts to download a video, the "Download switch is off" error message is returned.