Obtains the upload URL and credential of a media stream.
Operation description
-
Upload only a local media stream. After the media stream is uploaded, it is associated with the specified media asset ID.
-
Upload media streams only to ApsaraVideo VOD, but not to your own Object Storage Service (OSS) buckets. To upload a media stream to your own OSS bucket, you can upload the file to your OSS bucket by using OSS SDK, and then call the RegisterMediaStream operation to associate the media stream with the specified media asset ID.
-
This operation is available only in the China (Shanghai), China (Beijing), and China (Shenzhen) regions.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ice:CreateUploadStream |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| MediaId |
string |
No |
The ID of the media asset. |
****20b48fb04483915d4f2cd8ac**** |
| Definition |
string |
No |
The quality of the media stream. Valid values:
|
HD |
| FileExtension |
string |
No |
The file name extension of the media stream. |
MP4 |
| HDRType |
string |
No |
The high dynamic range (HDR) format of the transcoded stream. Valid values:
Note
|
HDR10 |
| UserData |
string |
No |
The user data. |
{"MessageCallback":{"CallbackURL":"http://aliyundoc.com"}, "Extend":{"localId":"xxx","test":"www"}} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
******11-DB8D-4A9A-875B-275798****** |
| MediaId |
string |
The ID of the media asset. |
****c469e944b5a856828dc2**** |
| FileURL |
string |
The Object Storage Service (OSS) URL of the file. The URL does not contain the information used for authentication. |
http://outin-***.oss-cn-shanghai.aliyuncs.com/stream/48555e8b-181dd5a8c07/48555e8b-181dd5a8c07.mp4 |
| UploadAddress |
string |
The upload URL. Note
The returned upload URL is a Base64-encoded URL. You must decode the Base64-encoded upload URL before you use an SDK or call an API operation to upload media files. You need to parse UploadAddress only if you use OSS SDK or call an OSS API operation to upload media files. |
eyJTZWN1cml0a2VuIjoiQ0FJU3p3TjF**** |
| UploadAuth |
string |
The upload credential. Note
The returned upload credential is a Base64-encoded value. You must decode the Base64-encoded upload URL before you use an SDK or call an API operation to upload media files. You need to parse UploadAuth only if you use OSS SDK or call an OSS API operation to upload media files. |
eyJFbmRwb2ludCI6Imm**** |
Examples
Success response
JSON format
{
"RequestId": "******11-DB8D-4A9A-875B-275798******",
"MediaId": "****c469e944b5a856828dc2****",
"FileURL": "http://outin-***.oss-cn-shanghai.aliyuncs.com/stream/48555e8b-181dd5a8c07/48555e8b-181dd5a8c07.mp4",
"UploadAddress": "eyJTZWN1cml0a2VuIjoiQ0FJU3p3TjF****",
"UploadAuth": "eyJFbmRwb2ludCI6Imm****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.