Uploads a transcoded stream file from external storage and mounts it to the corresponding ApsaraVideo VOD media asset.
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 more information, see Media asset storage billing. If you have enabled storage transmission acceleration, upload acceleration fees also apply. For more information, see Storage transmission acceleration billing.
This operation is currently supported only in the Shanghai and Singapore regions.
Call this operation to upload a transcoded stream file from external storage and mount it to the corresponding ApsaraVideo VOD media asset. The supported HDR types for transcoded streams are HDR, HDR10, HLG, DolbyVision, HDRVivid, and SDR+.
You can call the GetURLUploadInfos operation to query the upload status. After the upload is complete, you will receive the URL upload transcoded stream complete event notification.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vod:UploadStreamByURL |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StreamURL |
string |
Yes |
The URL of the transcoded stream file. If the URL of the transcoded stream requires authentication, include the authentication parameters in StreamURL and make sure the URL is accessible through public network access. Note
You can obtain the audio or video URL from the console or by invoking the GetPlayInfo operation. |
https://example.com/lesson-01.mp4 |
| MediaId |
string |
Yes |
The ID of the ApsaraVideo VOD media asset that corresponds to the transcoded stream. |
ca3a8f6e49*****57b65806709586 |
| Definition |
string |
Yes |
The definition of the video stream. For valid values of this parameter, see Media asset parameter description - Definition. |
HD |
| FileExtension |
string |
No |
The file name extension of the transcoded stream file. For supported audio and video file formats, see Overview. If this parameter is not empty, it overwrites the file name extension in the StreamURL. Important This parameter is required if the StreamURL does not contain a file name extension. |
mp4 |
| HDRType |
string |
No |
The HDR type of the transcoded stream. Valid values:
Note
|
HDR10 |
| UserData |
string |
No |
The custom parameter. For more information, see UserData. Note
To use the message callback in this parameter, configure the HTTP callback URL and select the corresponding callback event types in the console. Otherwise, the callback settings do not take effect. For information about how to configure HTTP callbacks in the console, see Callback settings. |
{"MessageCallback":{"CallbackURL":"http://aliyundoc.com"}, "Extend":{"localId":"xxx","test":"www"}} |
| UploadMetadata |
string |
No |
The metadata of the media file to upload. The value is a JSON string.
|
{"AddressMapping":"1","CustomPath":"test/xxx","CustomFileName":"xxx.mp4","isOverwritePath":"0"} |
UploadMetadata
| Name | Type | Required | Description |
| AddressMapping | String | No | The address mapping rule. Valid values: 1: maps the URL of the transcoded stream. 2: uses a custom path. |
| CustomPath | String | No | The custom file path. Maximum length: 1000 bytes. UTF-8 encoded. |
| CustomFileName | String | No | The custom file name. Maximum length: 1000 bytes. UTF-8 encoded. |
| IsOverwritePath | String | No | Specifies whether to overwrite the file if the custom file path already exists. Valid values: 0: does not overwrite. 1: overwrites. |
When AddressMapping is set to 2, both CustomPath and CustomFileName are required.
When IsOverwritePath is set to 0, the operation returns a failure if the custom file path already exists.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The basic information. |
||
| RequestId |
string |
The request ID. |
7AE96389-DF1E-598D-816B-7B40F13B4620 |
| StreamJobId |
string |
The job ID of the transcoded stream. This value can be used as a request parameter of the GetURLUploadInfos operation. ApsaraVideo VOD uses the job ID to uniquely identify a transcoded stream file. For more information, see Basic data types - PlayInfo. |
e304b34fb3d959f92baef97b6496**** |
| FileURL |
string |
The OSS file URL of the transcoded stream. |
http://outin-31059bcee7810a200163e1c8dba****.oss-cn-shanghai.aliyuncs.com/lesson-01.mp4 |
| SourceURL |
string |
The input URL of the transcoded stream. This value can be used as a request parameter of the GetURLUploadInfos operation. |
https://example.com/lesson-01.mp4 |
Examples
Success response
JSON format
{
"RequestId": "7AE96389-DF1E-598D-816B-7B40F13B4620",
"StreamJobId": "e304b34fb3d959f92baef97b6496****",
"FileURL": "http://outin-31059bcee7810a200163e1c8dba****.oss-cn-shanghai.aliyuncs.com/lesson-01.mp4",
"SourceURL": "https://example.com/lesson-01.mp4"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.