All Products
Search
Document Center

ApsaraVideo VOD:Download media files

Last Updated:Oct 25, 2023

You can download media files stored in ApsaraVideo VOD to on-premises disks or other storage devices. You can use the ApsaraVideo VOD console, client, or API operations to query the download URLs of various media files. This topic describes the media files, download URL types, download limits, and query methods.

Media files

ApsaraVideo VOD may generate multiple types of media files, which include mezzanine files, transcoded stream files, video snapshot files, and uploaded image files. ApsaraVideo VOD allows you to query and download the following types of media files:

  • Audio and video

    • Mezzanine files uploaded to ApsaraVideo VOD

    • Transcoded stream files in a specified definition

  • Image

    • Image files uploaded to ApsaraVideo VOD

    • Image files of thumbnail snapshots and image sprite snapshots automatically generated by ApsaraVideo VOD during snapshot processing

    • Image files of normal snapshots, image sprite snapshots, and original snapshots that compose sprite snapshots generated after you call the SubmitSnapshotJob operation. For more information, see SubmitSnapshotJob.

Download URL types

The media file download URLs that you can obtain include the Object Storage Service (OSS) source URLs and Alibaba Cloud CDN URLs. You are charged media asset management fees for downloads from OSS source URLs. These fees are the result of OSS outbound traffic. You are charged CDN traffic fees for downloads from CDN URLs. These fees are the result of CDN acceleration.

  • Storage address

    • By default, the download URL of each media file is an OSS URL. For more information, see Manage VOD resources.

    • If a domain name for CDN is configured, the download URL of each media file is the CDN URL. You can forcibly return the OSS URL of a mezzanine file or a transcoded stream file as the download URL. To obtain the OSS URL, you can set the OutputType parameter to oss to obtain the download URL. For more information, see GetMezzanineInfo and GetPlayInfo. The download URL of a mezzanine file stored in an input bucket is the OSS URL even when a domain name for CDN is configured. The name of an input bucket starts with in-.

  • CDN URL

    If a domain name for CDN is configured, the download URL of each media file is the CDN URL. For more information about how to configure a domain name for CDN, see Add a domain name.

Limits

If media security services such as hotlink protection and video encryption are configured, media file download is limited even when the download URLs are obtained.

  • If the access control service is configured, downloads from CDN URLs are limited by policies such as Referer-based hotlink protection and IP address blacklist or whitelist. The limits are the same as those for online playback. However, the limits do not apply to the downloads from OSS URLs.

  • If video encryption is configured, all transcoded stream files that are downloaded are encrypted, no matter whether they are downloaded from OSS URLs or CDN URLs. You must decrypt the transcoded stream files for playback. For more information, see the "Video encryption" section of the Overview topic.

  • If private OSS storage is used, a download URL has a validity period. If a download URL expires, you must obtain it again. We recommend that you set a long validity period for download URLs.

  • If URL signing is enabled for the domain name for CDN, a download URL has a validity period. If a download URL expires, you must obtain it again. We recommend that you set a long validity period for download URLs.

Use the console to obtain the download URLs

  • View download URLs

    • Audio and video mezzanine files and transcoded stream files:

      Log on to the ApsaraVideo VOD console, In the left-side navigation pane, choose Media Files, click Audio/Video or Image, On the Audio/Video or Image page, find the file that you want to manage and click Manage in the Actions column.View download URLs

      On the Video URL tab, click Copy in the Actions column to copy the download URL for a file. You can copy the download URL of the mezzanine file or the transcoded file in each definition.Copy the download URL

    • Image files uploaded to ApsaraVideo VOD:

      In the left-side navigation pane, choose Media Files, click Audio/Video, On the Audio/Video page, find the file that you want to manage and click Manage in the Actions column.Management

    • On the image details page, click Copy to copy the image URL.Copy the download URL

  • Export download URLs

    • Audio and video transcoded stream files:

      In the left-side navigation pane, choose Media Files, click Audio/Video, On the Audio/Video page, click the Export media URLsExport Media URL icon in the upper-right corner. The system exports the download URLs for the first 200 video and audio files transcoded in each definition based on the specified filter conditions.

    • Image files uploaded to ApsaraVideo VOD:

      In the left-side navigation pane, choose Media Files, click Image, On the Image page, click the Export media URLsExport Media URL icon in the upper-right corner. The system exports the download URLs for the first 100 images based on the specified filter conditions.

Use the API or SDK to obtain the download URLs

You can download audio and video mezzanine files, transcoded stream files, snapshot files that are automatically generated, and image files. You can use the following operations to obtain the download URLs of required files and download these URLs.

Operation

Description

Reference

GetMezzanineInfo

Queries the download URL of a mezzanine file. In the Mezzanine object that is returned, the FileURL parameter indicates the download URL of the mezzanine file.

GetMezzanineInfo

GetPlayInfo

Queries the streaming URL of a transcoded stream file. In the PlayInfo object that is returned, the PlayURL parameter indicates the streaming URL of the transcoded stream file.

GetPlayInfo

GetVideoInfo

Queries video information. In the Video object that is returned, the CoverURL parameter indicates the thumbnail URL, and the Snapshots parameter indicates a URL array of the snapshots that are automatically taken.

GetVideoInfo

GetImageInfo

Queries image information. In the ImageInfo object that is returned, the URL parameter indicates the image URL.

GetImageInfo

SearchMedia

Queries media asset information. If the media asset type is set to video or audio, the media asset information is returned in the Video or Audio object. In the object, the CoverURL parameter indicates the thumbnail URL, the Snapshots parameter indicates a URL array of video snapshots, and the SpriteSnapshots parameter indicates a URL array of the sprite snapshots that are automatically taken. If the media asset type is set to image, the media asset information is returned in the Image object. In the object, the URL parameter indicates the image URL.

SearchMedia

ListSnapshots

Queries snapshot information. In the MediaSnapshot object that is returned, the Snapshots parameter indicates a URL array of the snapshots of the type specified by the SnapshotType parameter.

ListSnapshots

Usage notes:

  • We recommend that you call API operations by using a server operation SDK. This helps you obtain media asset information in an efficient manner. For more information about server operation SDKs, see Overview. For more information about API operations, see the SDK example section of API references.

  • You can also send requests over HTTP or HTTPS. For more information, see Request syntax.

Client download

ApsaraVideo Player SDK provides the download feature to allow users to cache audio and video stream files on their mobile terminals and watch the streams offline. You can enable or disable this feature. The Normal and Encrypted download modes are supported.

Download settings

In the left-side navigation pane, choose Configuration Management. Click CDN Configuration > Download. On the Download page , you can set the Download Mode parameter. For more information, see Configure offline download.

  • Normal: In this mode, downloaded audio and video files are unencrypted. The files can be copied and can be played by using a player. Exercise caution when you set the download mode to Normal.

  • Encrypted: In this mode, downloaded audio and video files are encrypted by using a key file. The files can be decrypted only by using the same key file. This protects the video copyright. You must use ApsaraVideo Player SDK to decrypt and play the downloaded audio and video files. The ApsaraVideo VOD console provides a tool for generating the private keys for encryption.

ApsaraVideo Player SDK

Both ApsaraVideo Player SDK for iOS and ApsaraVideo Player SDK for Android support the secure download feature. For more information, see Implementation of ApsaraVideo Player SDK for iOS and Implementation of ApsaraVideo Player SDK for Android.