All Products
Search
Document Center

Download media files

Last Updated: Jan 19, 2021

You can download media files stored in ApsaraVideo VOD to local 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

Download URL types

The media file download URLs that you can obtain include the OSS source URLs and CDN URLs. You are charged media asset management (storage) 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 OutputType 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:

      On the Video and Audio page in the ApsaraVideo VOD console, 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 original file and the download URL of the transcoded file in each definition.Copy the download URL

    • Image files uploaded to ApsaraVideo VOD:

      On the Image page in the ApsaraVideo VOD console, click Manage in the Actions column.Manage

    • On the Image Details page, click Copy to copy the image linking.Copy the download URL

  • Export download URLs

    • Audio and video transcoded stream files:

      On the Video and Audio page in the ApsaraVideo VOD console, click the Export Media URL icon in the upper-right corner to export download URLs for the first 200 videos and audios in each definition under the filter condition.Export the download URL

    • Image files uploaded to ApsaraVideo VOD:

      On the Image page in the ApsaraVideo VOD console, click the Export media URLsExport Media URL icon in the upper-right corner to export download URLs for the first 100 images in each definition under the filter condition.

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 them.

Obtain information

Description

Reference

Mezzanine file URL

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

Obtain mezzanine file information

Playback information

Obtains the playback URL of a transcoded stream file. In the PlayInfo object that is returned, PlayURL indicates the playback URL of the transcoded stream file.

Obtain video playback URLs

Video information

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

Obtain video information

Image information

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

Obtain image information

Media asset Information

Obtains 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, CoverURL indicates the thumbnail URL, Snapshots indicates a URL array of video snapshots, and SpriteSnapshots 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, URL indicates the image URL.

Search for media information

Snapshot data

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

Obtain snapshot data

Call methods:

  • To obtain media asset information, we recommend that you use a server SDK by calling the API operations. This method is simpler and more efficient. For more information, see Usage notes. For more information about API operations, see SDK examples for each API operation.

  • For more information about how to generate HTTP or HTTPS requests, see Common parameters and Examples.

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

On the download settings page in the ApsaraVideo VOD console, you can set Download Mode. 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 any 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 Usage of ApsaraVideo Player SDK for iOS and Usage of ApsaraVideo Player SDK for Android.