Video upload from server refers to uploading videos to the VOD platform by the application backend. This document describes how to upload videos by using server APIs.
Activate the VOD service.
Get the security credentials (i.e., SecretId
and SecretKey
) required to call the server API in the following steps:
SecretId
and SecretKey
.An upload can be initiated through the SDK or API.
To facilitate the upload feature in your development environment, VOD provides SDKs for different programming languages. The SDK for each language comes with a corresponding demo. For more information, please see:
If the upload SDK provided by VOD does not apply to the programming language used by your application backend, the application backend needs to call VOD server APIs for video upload (this method is more complicated and not recommended). The business flow of API-based upload is as follows:
API-based upload requires you to implement steps such as applying for upload and uploading file on your own, which is not so convenient as SDK-based upload. Plus, you need to develop multipart upload logic for uploading large files. For more information, please see:
Procedure
parameter when calling the server API ApplyUpload, and the parameter value should the name of the desired task flow template. VOD supports creating task flow templates and naming them. When initiating a task flow, you can use the task flow template name to indicate the desired task. All the SDKs provided by VOD for different programming languages support specifying the task flow parameter. For more information, please see:
StorageRegion
parameter when the server API ApplyUpload is called, and the parameter value should be a region abbreviation. All the SDKs provided by VOD for different programming languages support specifying the storage region during upload. For more information, please see:
After a video upload is completed, VOD will initiate an event notification - video upload completion to the application backend, through which the application backend can become aware of the video upload event. To receive event notifications, you need to go to Console - Callback Settings to enable event notification. Event Notification - Video Upload Completion mainly contains the following information:
FileId
and URL of the uploaded video.
VOD supports specifying passthrough fields during video upload, which will be sent to the application backend upon event completion. The following fields are in the event notification:
SourceType
: this field is always ServerUpload
, indicating that the upload originates from a server.SourceContext
: this is a custom passthrough field specified by the application backend during signature distribution, which corresponds to the sourceContext
parameter in the signature.VOD supports automatic video processing upon video upload completion. If a video processing task flow is specified during upload, the task ID will also be included in the event notification content, i.e., the data.procedureTaskId
field.
For more information, please see:
Was this page helpful?