All Products
Search
Document Center

ApsaraVideo VOD:Upload from clients

Last Updated:Jun 17, 2025

ApsaraVideo VOD supports direct media file uploads from mobile clients. Compared with uploads from the application server, this method conserves server resources by eliminating the need for intermediate file transfers.

Feature overview

Client upload SDKs support uploading local files and online files.

Feature

Description

Note

Supported platforms

Web, iOS, Android, and WeChat mini program

N/A

Media files

  • For supported formats, see Media formats.

  • You can upload local files and online files. Online files are uploaded by using the URLs.

    Note

    URL-based upload is supported only in the China (Shanghai) region.

  • You can record and upload short videos.

  • You can upload multiple files at a time and manage them, including add, delete, cancel, resume, traverse, and clear operations.

  • Local file: up to 48.8 TB in size.

  • Online file: up to 5 GB.

Note

To upload online files, encode the URLs to prevent failures caused by special characters in the URLs.

Storage locations

You can use the default storage address or specify one.

You can change the default storage address

To specify a storage address, set the StorageLocation parameter when you call an operation to obtain an upload URL and credential.

Media asset management

Supports metadata configurations, such as titles, tags, categories, and thumbnails.

To configure metadata, set Title, Tags, CateId, and CoverURL when you call an operation to obtain an upload URL and credential.

Audio and video transcoding

You can specify a transcoding template or workflow to transcode uploaded audio and video files.

To transcode files, set TemplateGroupId and WorkflowId when you call an operation to obtain an upload URL and credential.

Upload authorization

  • Supports the upload URL and credential method.

  • Supports the STS Token method.

We recommend that you use the upload URL and credential method. Read Upload processes to understand the differences between the two methods.

Upload control

You can start, stop, pause, and resume the upload.

Resumable upload is automatically handled by the SDK. If a video fails to be uploaded due to exceptions, the upload is resumed from the point in time when it is stopped.

Upload acceleration

To enable upload acceleration, submit a request on Yida.

After the feature is enabled, configure it by setting the AccelerateConfig field in the UserData parameter.

Network type switching

You can switch between a 3G or 4G mobile network and Wi-Fi.

To reduce data usage in 3G or 4G networks, you can pause the upload when the network switches to 3G or 4G and resume the upload when the network switches back to Wi-Fi.

Event notifications

You can configure callbacks to receive notifications about upload events. For supported event notifications, see Media upload.

For more information about how to set callbacks, see Callback configurations.

Upload processes

Client upload SDK encapsulates the logic of Object Storage Service (OSS) SDK for object upload. The files are directly uploaded to an OSS bucket for ApsaraVideo VOD, which eliminates the need for intermediate file transfers via the server.

In this case, you must authenticate upload requests by deploying an authorization service on your application server. Client upload SDKs support two methods: STS token-based authorization and credential-based authorization.

We recommend that you use credential-based authorization. Compared with STS token-based authorization, it features simpler and more flexible configuration, enhanced security, and higher redundancy, allowing you to control the permissions on a single video and set multiple response parameters.

Credential-based authorization

The following figure shows the complete process of uploading a media file by using an upload URL and an upload credential.

image
  1. Deploys an authorization service on your application server, such as ApsaraVideo VOD SDK, to obtain upload URLs and credentials. 

    Note

    API reference

  2. A client sends a request to the application server to request an upload URL and an upload credential.

  3. The application server sends a request to ApsaraVideo VOD to request the upload URL and credential. 

  4. ApsaraVideo VOD returns the upload URL and credential. 

    Note
    • ApsaraVideo VOD also generates media IDs, which will be referenced in media lifecycle management and media processing. 

      • For a video, the media ID is returned in the VideoId parameter. 

      • For an image, the media ID is returned in the ImageId parameter. 

      • For an auxiliary media asset, the media ID is returned in the MediaId parameter. 

    • You can also set a callback to subscribe to the upload result. 

  5. The application server returns the upload URL and credential to the client. 

  6. The client uses the upload URL and credential to initialize an upload instance. 

  7. The client constructs upload parameters to send an upload request. 

  8. OSS returns the upload result. 

STS token-based authorization

The following figure shows the complete process of uploading a media file by using an STS token.

image
  1. Deploy an authorization service on your application server, such as STS SDK, to obtain temporary STS tokens. 

    Note

    API reference

    AssumeRole: obtains an STS token to assume a Resource Access Management (RAM) role. For more information, see Obtain an STS token.

  2. A client sends a request to the application server to request an STS token. 

  3. The application server sends a request to STS to request the STS token. 

  4. STS returns the token. 

  5. The application server returns the STS token to the client. 

  6. The client uses the STS token to request an upload URL and credential from ApsaraVideo VOD.

  7. ApsaraVideo VOD returns the upload URL and credential to the client.

  8. The client constructs upload parameters to send an upload request. 

  9. OSS returns the upload result. 

Client-side integration

The integration and usage methods vary by platform. For more information, see the following topics: