Pulls audio and video media files for upload based on source file URLs. Batch upload is supported.
Operation description
Before using this operation, make sure that you fully understand the billing methods and pricing of ApsaraVideo VOD. Uploading media files to ApsaraVideo VOD incurs storage fees. For billing details, see Media asset storage billing. If you have enabled storage transfer acceleration, uploading media files to ApsaraVideo VOD also incurs upload acceleration fees. For billing details, see Storage transfer acceleration billing.
For the media file formats supported by this operation, see Media formats.
This operation is mainly applicable to scenarios where files are not stored on a local server or terminal and need to be uploaded through a URL with public network access.
This operation is an asynchronous upload operation. It is not real-time and does not guarantee timeliness. Generally, the migration upload is completed within hours or even days after the node is submitted. If you have high timeliness requirements, use the upload SDK instead.
If a callback is configured, you will receive the URL upload video complete event notification after the upload is completed. You can call the GetURLUploadInfos operation to query the upload status.
After an upload node is submitted, an asynchronous node is generated in the cloud for execute. All URL upload nodes committed by users in the corresponding service region are queued for execute. The completion time is affected by the number of existing nodes. After the upload is completed, you can associate the URL with the video ID based on the information returned in the event notification (message callback).
This operation currently supports only the China (Shanghai), China (Beijing), China (Shenzhen), Singapore, and US (Silicon Valley) regions.
Each time you commit an upload node for the same media file URL, a new media resource is generated in ApsaraVideo VOD (that is, a new media ID is generated).
If a single file exceeds 20 GB, the upload is failed. If you need to upload a single file larger than 20 GB, use the upload SDK. For more information, see Overview of the upload SDK.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vod:UploadMediaByURL |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| UploadURLs |
string |
Yes |
The URLs of media source files.
Note
|
https://****.mp4 |
| TemplateGroupId |
string |
No |
The ID of the transcoding template group. You can obtain the ID by using one of the following methods:
Note
|
ca3a8f6e4957b65806709586**** |
| StorageLocation |
string |
No |
The storage address of the media file. Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Asset Management > Storage to view the storage address. If you do not specify this parameter, the default storage address is used. |
outin-bfefbb90a47c******163e1c7426.oss-cn-shanghai.aliyuncs.com |
| UploadMetadatas |
string |
No |
The metadata of the media files to upload. The value is a JSON string.
|
[{"SourceURL":"https://example.aliyundoc.com/video01.mp4","Title":"urlUploadTest"}] |
| UserData |
string |
No |
The custom settings. The value is a JSON string that supports message callback and upload acceleration settings. For more information, see UserData. Note
|
{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}} |
| AppId |
string |
No |
The application ID. Default value: app-1000000. For more information, see Multi-application. |
app-**** |
| WorkflowId |
string |
No |
The workflow ID. Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Processing > Workflows to view the workflow ID. Note
If both WorkflowId and TemplateGroupId are specified, WorkflowId takes precedence. For usage instructions, see Workflows. |
e1e243b42548248197d6f74f9**** |
| SessionId |
string |
No |
The custom deduplication identifier. If this parameter is specified and a request with the same identifier was sent within the past 10 minutes, an error is returned for the current request. Note
|
5c62d40299034bbaa4c195da330**** |
| EnableFirstFrameCover |
boolean |
No |
||
| GenerateThumbnail |
boolean |
No |
UploadMetadata
| Name | Type | Required | Description |
| SourceURL | String | Yes | The URL of the media source file to upload. |
| Title | String | No | The title of the media file. The title can be up to 128 bytes in length. UTF-8 encoding is used. |
| FileSize | String | No | The file size. |
| Description | String | No | The description. The description can be up to 1024 bytes in length. UTF-8 encoding is used. |
| CoverURL | String | No | The custom video thumbnail URL. |
| CateId | String | No | The category ID. Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Asset Management > Categories to view the category ID. |
| Tags | String | No | The tags. Each tag can be up to 32 bytes in length. A maximum of 16 tags are supported. Separate multiple tags with commas (,). UTF-8 encoding is used. |
| TemplateGroupId | String | No | The transcoding template group ID. This value overrides the TemplateGroupId specified in the outer parameter. |
| WorkflowId | String | No | The workflow ID. If both WorkflowId and TemplateGroupId are specified, WorkflowId takes precedence. For more information, see Workflows. |
| FileExtension | String | No | The file name extension of the media file. For supported file name extensions, see Upload overview. |
| ReferenceId | String | No | The custom ID. Only lowercase letters, uppercase letters, digits, hyphens (-), and underscores (_) are supported. The value must be 6 to 64 characters in length. The value must be unique within a user account. |
Parameters in UploadMetadata (such as Title, Description, and Tags) cannot contain emoji characters.
To ensure normal playback, when you upload video files with TemplateGroupId set to "VOD_NO_TRANSCODE" (no transcoding), only the following formats support direct playback without transcoding: MP4, FLV, MP3, M3U8, and WEBM. Other formats support storage only (pay attention to the file name extension of FileName). If you use Alibaba Cloud Player, the version must be 3.1.0 or later.
If you specify a no-transcoding template group (TemplateGroupId set to "VOD_NO_TRANSCODE"), only the video upload complete event notification is sent after the video is uploaded. The single stream transcoding complete event notification is not sent.
If a callback is configured, after the video upload is completed, in addition to the upload and transcoding notifications, the URL upload video complete event notification is also sent.
When you submit tasks in batches, each SourceURL has an independent notification.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
25818875-5F78-4AF6-D7393642CA58**** |
| UploadJobs |
array<object> |
The list of upload jobs. |
|
|
object |
The details of an upload job. |
||
| SourceURL |
string |
The source file URL of the upload job. |
http://example****.mp4 |
| JobId |
string |
The ID of the upload job. |
ad90a501b1b94fb72374ad005046**** |
Examples
Success response
JSON format
{
"RequestId": "25818875-5F78-4AF6-D7393642CA58****",
"UploadJobs": [
{
"SourceURL": "http://example****.mp4",
"JobId": "ad90a501b1b94fb72374ad005046****"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.