All Products
Search
Document Center

ApsaraVideo VOD:Download media files

Last Updated:Feb 06, 2026

You often need to download media files from ApsaraVideo VOD (VOD). These files can be audio, video, or images. Common use cases include media asset management, content delivery, and offline playback. This topic describes how to obtain download URLs and download files using the console, an API or SDK, or a mobile SDK. The methods are fast, secure, and cost-effective.

Scenarios

  • Download from the console: Suitable for quick validation or temporary export of a small number of files.

  • Download using an API: Suitable for automated batch processing of files.

  • Download offline using a player SDK: Suitable for custom application scenarios.

Scenario 1: Download from the console

Download a single file

The console provides a straightforward way to download files. This method is ideal for downloading a small number of files or for business testing.

  1. Log on to the ApsaraVideo VOD console.

  2. In the left navigation pane, choose Media Files > Audio/Video to go to the Audio/Video list page.

  3. Find the target file and click Manage in the Actions column. Select the Video URL or Audio URL tab. In the Actions column for the desired definition, click Copy.

  4. Paste the copied URL into a browser or download tool to start the download.

Download multiple files

The console provides a batch export feature for media asset information when you need to download multiple files.

  1. Log on to the ApsaraVideo VOD console.

  2. In the left navigation pane, choose Media Files. Based on the file type, select Audio/Video or Image to go to the list page.

  3. On the list page, use the filter or search feature to locate and select the media files that you want to export.

  4. Click the image icon in the upper-right corner of the page to export the media asset information.

  5. Paste the URLs for the media assets into a browser or download tool to start the download.

Scenario 2: Download using an API

Obtain download URLs

APIs provide a flexible way to obtain download URLs for various media resources, such as source files, transcoded files, and thumbnails. The following table lists the APIs for obtaining download URLs for different media files.

Media asset type

Retrieve the API

Address field

Description

Source file

Obtaining source file information

Mezzanine.FileURL

The original audio or video file that was uploaded.

Transcoded file

Obtain the audio and video (playback) URL

PlayInfoList.PlayInfo.PlayURL

The URL of the transcoded stream.

Video thumbnail

Retrieve single audio/video information

Video.CoverURL

The thumbnail image of the video.

Video snapshot

Retrieve metadata for a single audio or video file

Video.Snapshots

An array of snapshot URLs for the video.

Image file

GetImageInfo

ImageInfo.URL

The URL of the image.

Obtain download URLs in batches

Address Type

Obtain API

Address field

Description

Batch search

Search for media information

MediaList.Video/Audio/Image

You can search for information about multiple media types at once. The response includes all the URL types mentioned above.

Note

Use a server-side SDK to call APIs to retrieve and update media asset information. For more information, see VOD SDK usage guide.

Perform the download operation

You can integrate the download feature into your application using APIs to automate the process. The following code provides a Python SDK example. For more SDK examples, see the OpenAPI Portal.

  1. Prepare the environment.

    Install the VOD Python SDK.

    pip install aliyun-python-sdk-vod
  2. Obtain the download URL.

    Call the GetMezzanineInfo operation to retrieve the source file information.

    import json
    from aliyunsdkcore.client import AcsClient
    from aliyunsdkvod.request.v20170321 import GetMezzanineInfoRequest
    
    # Initialize the client
    # Replace with your AccessKey ID, AccessKey secret, and region ID
    client = AcsClient('YOUR_ACCESS_KEY_ID', 'YOUR_ACCESS_KEY_SECRET', 'cn-shanghai')
    
    # 1. Create a request
    request = GetMezzanineInfoRequest()
    request.set_accept_format('json')
    request.set_VideoId("YOUR_VIDEO_ID") # Replace with your video ID
    request.set_OutputType("oss")  # Recommended: Returns the OSS storage address for lower cost
    request.set_AuthTimeout(3600)  # Set the URL validity period to 1 hour (3600 seconds)
    
    # 2. Send the request and get the response
    response = client.do_action_with_exception(request)
    result = json.loads(response)
    
    # 3. Parse the download URL
    download_url = result['Mezzanine']['FileURL']
    print(f"Source file download URL: {download_url}")
    
    # (Optional) Use the requests library to download the file
    import requests
    print("Starting file download...")
    file_response = requests.get(download_url, stream=True)
    if file_response.status_code == 200:
        with open('downloaded_video.mp4', 'wb') as f:
            for chunk in file_response.iter_content(chunk_size=8192):
                f.write(chunk)
        print("File downloaded successfully: downloaded_video.mp4")
    else:
        print(f"Download failed, status code: {file_response.status_code}")
        print(f"Error message: {file_response.text}")

Scenario 3: Download offline using a client SDK

For mobile application scenarios, ApsaraVideo VOD supports caching videos locally for offline viewing. Offline download is available in two modes: standard download and secure download.

  • Standard download: The downloaded video file is not encrypted and can be copied and played by any player. This mode is suitable for public content or scenarios with low copyright requirements.

  • Secure download: The downloaded video file is encrypted. It can only be decrypted and played by an ApsaraVideo Player SDK that is integrated with the same key. This mode is suitable for copyright-sensitive scenarios, such as paid courses and exclusive content.

Steps

  1. Configure the download mode.

    1. Log on to the ApsaraVideo VOD console. Go to Configuration Management > CDN Configuration > Download Settings.

    2. Select standard download or secure download as needed. If you select secure download, you must generate and securely store the encryption key on this page.

  2. Integrate the player SDK.

    Integrate the ApsaraVideo Player SDK into your Android or iOS project. For more information, see Integrate the Android SDK and Integrate the iOS SDK.

  3. Complete the video download.

    Integrate the video download module into your Android or iOS project. For more information, see Video download for Android and Video download for iOS.

Billing

Media file download URLs fall into the following two categories:

  • Storage address

    • If you do not configure an accelerated domain name, the system uses the media asset storage address directly and incurs outbound traffic fees.

  • Accelerated address:

FAQ

Why can't I play the downloaded video?

If video encryption, such as HLS encryption, is enabled for the transcoded output file, the downloaded file remains encrypted. You must use the ApsaraVideo Player SDK to decrypt and play it. For more information, see Video encryption.

How do I download many media files?

Retrieve media file information with paging using SearchMedia - Search Media Information, and then follow Scenario 2: Download via API to download.