All Products
Search
Document Center

ApsaraVideo VOD:UploadStreamByURL

Last Updated:Dec 16, 2024

Uploads transcoded streams to ApsaraVideo VOD from external storage.

Operation description

  • Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see Billing of media asset storage. If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see Billing of acceleration traffic.
  • This operation is available only in the China (Shanghai) and Singapore regions.
  • You can call this operation to upload transcoded streams to ApsaraVideo VOD from external storage. The following HDR types of transcoded streams are supported: HDR, HDR 10, HLG, Dolby Vision, HDR Vivid, and SDR+.
  • You can call the GetURLUploadInfos operation to query the upload status. After the upload is complete, the callback of the UploadByURLComplete event is returned.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vod:UploadStreamByURL
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
StreamURLstringYes

The URL of the transcoded stream.

If URL authentication is required, you must pass authentication information in this parameter and make sure that the URL can be accessed over the Internet.

https://example.com/lesson-01.mp4
MediaIdstringYes

The media ID in ApsaraVideo VOD.

ca3a8f6e49*****57b65806709586
DefinitionstringYes

The quality of the video stream.

For more information about valid values of this parameter, see Parameters for media assets.

HD
FileExtensionstringNo

The file name extension of the transcoded stream.

For more information, see the Supported media file formats section in Overview .

If you set a value for this parameter, the file name extension specified in StreamURL is overwritten.

Note This parameter is required if you do not specify a file name extension in StreamURL.
mp4
HDRTypestringNo

The HDR type of the transcoded stream. Valid values:

  • HDR
  • HDR10
  • HLG
  • DolbyVision
  • HDRVivid
  • SDR+
Note
  • The HDR type of the transcoded stream is not case-sensitive.

  • You can leave this parameter empty for non-HDR streams.

HDR10
UserDatastringNo

The user-defined parameter. For more information, see the "UserData: specifies the custom configurations for media upload" section of the Request parameters topic.

Note The callback configurations you specify for this parameter take effect only after you specify the HTTP callback URL and select specific callback events in the ApsaraVideo VOD console. For more information about how to configure HTTP callback settings in the ApsaraVideo VOD console, see Configure callback settings.
{"MessageCallback":{"CallbackURL":"http://aliyundoc.com"}, "Extend":{"localId":"xxx","test":"www"}}

Response parameters

ParameterTypeDescriptionExample
object

The basic information.

RequestIdstring

The ID of the request.

7AE96389-DF1E-598D-816B-7B40F13B4620
StreamJobIdstring

The ID of the stream upload job. This parameter is used when you call the GetURLUploadInfos operation.

In ApsaraVideo VOD, you can upload only one transcoded stream in an upload job. For more information, see the PlayInfo: the playback information about a video stream section in Basic structures.

e304b34fb3d959f92baef97b6496****
FileURLstring

The URL of the OSS object.

http://outin-31059bcee7810a200163e1c8dba****.oss-cn-shanghai.aliyuncs.com/lesson-01.mp4
SourceURLstring

The URL of the input stream. This parameter is used when you call the GetURLUploadInfos operation.

https://example.com/lesson-01.mp4

Examples

Sample success responses

JSONformat

{
  "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

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2021-12-22The response structure of the API has changedView Change Details
2021-12-20The response structure of the API has changedView Change Details
2021-11-16The request parameters of the API has changedView Change Details
2021-10-28Add OperationView Change Details