Media upload sends your media resources to ApsaraVideo VOD, and is a prerequisite for other ApsaraVideo VOD services such as media asset management, media processing, and delivery and playback. This topic describes what to confirm before you upload, the available upload methods, upload event notifications, and what to do after upload.
Before you upload
Supported media formats
ApsaraVideo VOD supports uploading media files such as videos, audio, images, and auxiliary media assets (watermarks, subtitles, and material files). Files can be local files or network files (network files use URL pull upload). The following table lists the formats supported by each media type.
Include the file name extension when you upload. Extensions are case-insensitive. For example, MP4 and mp4 are equivalent.
| Media type | Supported file formats |
| Video |
Note To upload an M3U8 file through the ApsaraVideo VOD console, you can only use URL pull upload. To upload a local M3U8 file, use the ApsaraVideo VOD API or SDK. For details, see Upload media files by using the ApsaraVideo VOD API
|
| Audio | MP3, WMA, WAV, AAC, RA, M4A, FLAC, APE, AC3, AMR, CAF, ACM. |
| Image | PNG, JPG, JPEG, GIF, HEIC. |
| Auxiliary media asset |
|
ApsaraVideo VOD media upload supports only the media types listed above. To upload other file types, follow the steps in Upload files to OSS.
Storage regions
ApsaraVideo VOD stores media resources based on Alibaba Cloud Object Storage Service (OSS). Each storage node is a storage region, and ApsaraVideo VOD assigns a storage address to each storage region.
When you upload from the ApsaraVideo VOD console or the PC client, the storage address is based on the region you log on to or select. When you upload with an SDK or API, you can specify the storage address by using a parameter, such as the StorageLocation parameter of the UploadMediaByURL operation.
ApsaraVideo VOD supports the following storage regions and region IDs:
| Storage region | Region ID |
| China (Shanghai) | cn-shanghai |
| China (Beijing) | cn-beijing |
| China (Shenzhen) | cn-shenzhen |
| China (Hong Kong) | cn-hongkong |
| Japan (Tokyo) | ap-northeast-1 |
| Singapore | ap-southeast-1 |
| Indonesia (Jakarta) | ap-southeast-5 |
| Germany (Frankfurt) | eu-central-1 |
| US (Silicon Valley) | us-west-1 |
By default, ApsaraVideo VOD does not share data across regions within the same account. Before you upload, make sure your upload region matches your actual business region. Otherwise, you may fail to find your files.
About storage addresses
| Available storage address settings | Description |
| Enable the ApsaraVideo VOD system storage address | After you activate ApsaraVideo VOD, each service region is assigned an independent storage bucket (an ApsaraVideo VOD system bucket) by default. Enable this bucket to upload and manage media resources without any additional configuration. For details, see Manage storage buckets. |
| Add a storage address | Add your own OSS bucket to ApsaraVideo VOD so that you can transcode, capture snapshots from, and play media files stored in the OSS bucket. For details, see Manage storage buckets. |
| Modify the default storage address | After you enable storage addresses for multiple storage regions or add multiple storage addresses, you can modify the default storage address. When you upload files, you can specify a storage address or leave it unspecified. If you do not specify one, ApsaraVideo VOD uses the default storage address. For details, see Manage storage buckets. |
Storage billing
ApsaraVideo VOD storage supports two billing methods: pay-as-you-go (postpaid) and resource plans (prepaid).
For pay-as-you-go, see Media asset storage billing.
For resource plans, see ApsaraVideo VOD storage plan.
Upload methods
ApsaraVideo VOD provides manual upload and programmatic (automated) upload methods for different user scenarios. Use the following guidance to choose a method, and see the overview table for details.
Quickly upload a few small files: Use the console.
Upload large files or run long uploads: Use the PC client.
Batch uploads or automated integration: Use the server-side upload SDK.
Upload network files: Use URL pull upload.
| Upload method | Scenarios | Description | |
| Manual upload | Upload files to the ApsaraVideo VOD console | Scenarios that require a quick and convenient way to upload media resources to ApsaraVideo VOD. Note Because of console security policies, long uploads may fail for large files when the logon session expires. To avoid this issue, upload large files with the PC client. |
|
| Upload files using the Windows client | Large files, long uploads, and low-barrier operational scenarios. |
| |
| Programmatic integration | Upload using Upload SDK |
Note We recommend the upload SDK. If the upload SDK does not support your language, you can use an OSS native SDK to complete the upload. |
|
| Upload media files using OSS SDKs |
|
Note For Java, Python, PHP, and C/C++, we recommend the ApsaraVideo VOD upload SDK. | |
| Batch upload from URLs | Scenarios where files are not stored on a local server or terminal and must be uploaded from a public-network-accessible URL. |
|
Feature comparison by upload method
The following table compares the features that each upload method supports during upload. The ① and ② marks correspond to the feature explanations that follow the table.
| Group | Feature | Console | PC client | Server-side SDK-Java | Server-side SDK-Python | Server-side SDK-PHP | Server-side SDK-C/C++ | OSS SDK |
| Media asset management | Set the media title | Supported | Supported | Supported | Supported | Supported | Supported | Supported |
| Specify the media category | Supported | Supported | Supported | Supported | Supported | Supported | Supported | |
| Set media tags | Not supported | Supported | Supported | Supported | Supported | Supported | Supported | |
| Set the video thumbnail | Not supported | Not supported | Supported | Supported | Supported | Supported | Supported | |
| Audio and video transcoding① | Transcoding template group | Supported | Supported | Supported | Supported | Supported | Supported | Supported |
| Media workflow | Supported | Not supported | Supported | Supported | Supported | Supported | Supported | |
| No transcoding | Supported | Supported | Supported | Supported | Supported | Supported | Supported | |
| Upload control② | Get upload progress | Supported | Supported | Supported | Supported | Supported | Supported | Supported |
| Resumable upload | Not supported | Not supported | Supported by the Java upload SDK only | Supported | Not supported | Not supported | Not supported | |
| Multipart upload | Enabled by default | Enabled by default | Enabled by default | Enabled by default | Enabled by default | Enabled by default | Enabled by default |
The following notes explain the feature groups marked with ① and ② in the preceding table.
Audio and video transcoding①
Set transcoding when you upload an audio or video file (by specifying a transcoding template group or a media workflow), and transcoding starts automatically after the upload completes. You can also choose not to transcode. However, note that Only videos in the following formats can be played without transcoding: MP4, FLV, M3U8, MP3, and WEBM.
Transcode with a transcoding template group: Using a transcoding template group is the default processing method of ApsaraVideo VOD. When you upload, select the transcoding template group processing method. ApsaraVideo VOD automatically starts transcoding after the upload completes.
Transcode with a media workflow: After you create a media workflow that contains transcoding tasks, select the media workflow processing method when you upload. After the upload completes, ApsaraVideo VOD automatically runs the specified media workflow to complete transcoding.
No transcoding: If you do not need transcoding during upload, select the No Transcoding template in the transcoding template group.
Upload control②
Multipart upload: The file to be uploaded is split into multiple parts that are uploaded separately, and then combined into a single object after the upload completes. ApsaraVideo VOD uploads files by using multipart upload by default.
When you use multipart upload, if the upload fails, fragment files may be generated. These are automatically cleared after about seven days. You can also call the DeleteMultipartUpload operation to clear the fragment files manually.
Get upload progress or status.
Resumable upload: If a network error causes the upload to fail, ApsaraVideo VOD can resume the upload from the last part that was uploaded successfully, achieving a resumable upload.
Resumable upload is handled internally by the upload SDK (client). You do not need to manage any breakpoints or fragment recovery, because a re-upload after a failure caused by an exception starts from the breakpoint.
Upload event notifications
After a media file upload completes, you can get the processing progress and status in a timely manner through a preconfigured callback address. ApsaraVideo VOD supports two callback methods for event notifications: HTTP callback (HTTPS-compatible) and Message Service (MNS) callback. To learn about callback configuration, see Event notification. To complete the callback configuration, see Configure callbacks. All upload methods support upload event notifications. The upload-related events are listed in the following table.
For details about each event, see Event notifications.
| Event name | Event type | Description |
| Video Upload Complete | FileUploadComplete | Generated after the ApsaraVideo VOD server finishes receiving an uploaded audio or video file. Note For non-transcoded audio and video (or audio), you can get the playback URL only after you receive the Video Upload Complete event notification. If you disabled transcoding during upload, after you receive the Video Upload Complete event notification, you can call the Submit media transcoding jobs operation to transcode. |
| Image Upload Complete | ImageUploadComplete | Generated after the ApsaraVideo VOD server finishes receiving an uploaded image file. |
| Auxiliary Media Upload Complete | AttachedMediaUploadComplete | Generated after the ApsaraVideo VOD server finishes receiving an uploaded auxiliary media asset file. |
| Video Upload from URL Complete | UploadByURLComplete | After you call the Upload media files by URL task, the UploadByURLComplete event is generated when the cloud finishes pulling and uploading the video. |
| Stream Transcode Complete | StreamTranscodeComplete | Generated when a stream of a specific definition and format for a video (for example, an MP4 file in standard definition) finishes transcoding. Note For transcoded audio and video, you can get the playback URL only after you receive the Stream Transcode Complete event notification. Playing before you receive the callback may cause playback to fail. |
| Video Transcode Complete | TranscodeComplete | Generated when all streams for a video finish transcoding. Note To ensure that all definitions are available before playback, wait until you receive the Video Transcode Complete event notification before you proceed. Playing before you receive the callback may cause playback to fail. |
What to do after upload
After media resources are uploaded to ApsaraVideo VOD, they enter different media statuses depending on the business processing situation and stage. Audio and video resources in different media statuses support different operations. For example, audio and video in the Uploading, Upload Failed, or Blocked status can only be deleted and support no other operations (you cannot start transcoding, capture video snapshots, or review media assets). Audio and video in the Normal status support all operations, including transcoding, video snapshots, media asset review, and playback. For details about media statuses, see Status: video status and Status: image status.
The ApsaraVideo VOD services available after upload and the notes for subsequent delivery and playback are as follows:
| ApsaraVideo VOD service | Description | References |
| Media asset management (after upload) | After the upload completes, use ApsaraVideo VOD to manage media files, such as video source files, transcoded stream files, and image files. | Media asset management |
| Media processing | ApsaraVideo VOD supports post-upload operations such as audio and video transcoding, automated review, online editing (video editing in the cloud), and AI processing. Note Audio and video files uploaded to ApsaraVideo VOD storage have their metadata (such as video resolution, duration, and bitrate) extracted by default, and thumbnails and sprites captured for videos by default. This preprocessing is completely free. | Media processing |
| Audio and video playback | After you finish uploading audio or video, the file is not necessarily ready. The ApsaraVideo VOD server must confirm that it has finished receiving the file. Use event notifications to determine when the uploaded audio or video is playable.
|
|
Upload security
In programmatic upload scenarios, both upload credentials and STS solve authorization and security issues during upload, preventing media files from being maliciously uploaded and played.
For the scenarios of each method, see Credential method vs. STS method.
For specific usage, see the operation documentation for each developer upload method.
- - - - Upload media files using OSS SDKs
Restrict public-read file uploads
Since January 31, 2024, ApsaraVideo VOD no longer supports modifying file permissions through the OSS x-oss-object-acl header. This effectively prevents issues such as media resource leaks or cost spikes from malicious access that are caused by directly uploading public-read files. To restrict uploading public-read files to your own OSS buckets in ApsaraVideo VOD, you can use the following permission management methods:
To authorize ApsaraVideo VOD to access your OSS and other resources, click Cloud Resource Access Authorization to grant authorization.
Create a custom policy that prohibits uploading files with a public-read object ACL to your own OSS buckets. For the procedure and the policy content, see The policy that prohibits the upload of objects whose ACL is public read to OSS buckets.
Grant the AliyunVODDefaultRole role the prohibit uploading files with a public-read object ACL to your own OSS buckets permission created in the previous step.
To grant the permission to the AliyunVODDefaultRole role
Log on to the Resource Access Management (RAM) console. For the procedure, see Manage RAM user permissions.
In the left-side navigation pane, click Roles, and then find and click AliyunVODDefaultRole.
On the Permissions tab, click Grant Permission.
In the panel that appears, select the Custom Policy tab, select the target policy, and then complete the authorization.
Upload acceleration
ApsaraVideo VOD provides upload acceleration to improve the transfer of long-distance files and large files at the GB or TB level. Upload acceleration applies to cross-region uploads (such as cross-sea transfers), for example, uploading videos from the Chinese mainland to a storage address in the Singapore storage region.
How to enable
To enable upload acceleration, submit a ticket. Provide your Alibaba Cloud account UID and the storage address you want to accelerate.
Billing
Upload acceleration is a value-added feature of ApsaraVideo VOD and is billed by usage. For billing details, see Billing for transfer acceleration.
You are not charged if you enable the feature but do not use it.
Limitations
Only Upload files to the ApsaraVideo VOD console does not support acceleration. All other upload methods support it.
Billing
Uploading media assets to ApsaraVideo VOD does not incur additional fees. Related fees come from the Alibaba Cloud ApsaraVideo VOD service resources that you use.
| Billing item | Description |
| Storage fees | Storage fees for media files after upload, billed by storage volume and duration. |
| Traffic fees | Upload traffic is free (inbound traffic from the client to ApsaraVideo VOD is not charged). Downstream playback traffic is billed separately. |
| Transcoding fees | If transcoding is triggered after upload, billed by output file duration and transcoding specification. No charge if no transcoding is performed. |
| Upload acceleration fees | When you enable and use upload acceleration, billed additionally by accelerated traffic. |
For billing details, see Basic service billing and Resource plans.