ApsaraVideo Media Processing (MPS) allows you to upload videos by using the MPS console, the Object Storage Service (OSS) console, the OSS API, and OSS tools. This topic describes how to upload a video by using different methods.
Usage notes
After a video is uploaded to OSS, you are charged storage fees. To create MPS jobs on the uploaded video, you must download the video first. OSS provides various storage classes such as Standard, Infrequent Access (IA), Archive, and Cold Archive. If you access an OSS bucket of the Standard storage class over an internal network within the same region, you are not charged for the traffic generated over the internal network. For other storage classes, you are charged traffic fees and API call fees. If you upload the video to an OSS bucket of the Archive storage class and enable real-time access of Archive objects for the bucket, you are charged Archive data retrieval fees when you access the video for media processing. For more information about billing, see Billing overview.
If you upload a video to a specific path of an MPS workflow and the trigger mode of the workflow is automatic trigger, the workflow may be automatically triggered. For more information, see Trigger a workflow.
If an uploaded video is not intact, the video may fail to be transcoded. Make sure that a video is intact before you upload the video.
Upload methods
Upload a video in the MPS console
After you specify a workflow in the MPS console, you can directly upload a video to the OSS input path that you specified for the Input node of the workflow and initiate the workflow. After the video is uploaded, a media file is generated and displayed on the Media List page of the MPS console. The media file has a media asset ID.
Prerequisites
OSS is activated. For more information, see Activate OSS.
A workflow is created. For more information, see Create a workflow.
Procedure
Log on to the MPS console.
In the top navigation bar, select a region from the drop-down list.
In the left-side navigation pane, choose . The Upload Video page appears.
Click Add Video.
In the Add Video and Initiate Workflow dialog box, specify the video that you want to upload.
Parameter
Description
Workflow
The workflow that processes the video. Select a workflow from the drop-down list.
Add Video
The video that you want to upload. Click Add Local Video or Add Video and select the video that you want to upload.
Click Upload.
NoteDuring an upload, you can switch to other pages in the MPS console. However, do not refresh or close the browser or access the consoles of other Alibaba Cloud services. Otherwise, the upload is interrupted.
What to do next
After the video is uploaded, choose Manage media files.
in the left-side navigation pane. On the Media List page, view or publish the media file that is generated after the video is uploaded. For more information, seeUpload a video in the OSS console
You can upload a video in the OSS console to a bucket in a region that is supported by MPS and manually start a job, such as a transcoding job. You can also upload a video to the input path that you specified for the Input node of an MPS workflow. After the video is uploaded, the workflow is triggered.
Prerequisites
OSS is activated. For more information, see Activate OSS.
Procedure
Log on to the OSS console.
In the left-side navigation pane, click Buckets.
Click the name of the bucket to which you want to upload a video. If you want to trigger a workflow, you must select the bucket that you added as an input media bucket and the input path that you specified for the Input node of the workflow in the MPS console.
In the left-side pane of the bucket details page, choose Object Management > Objects. On the Objects page, click Upload Object.
On the page that appears, configure the parameters that are described in the following table. For more information, see Upload objects.
Parameter
Description
Upload To
The directory to which you want to upload the video. You can upload the video to the current directory or the specified directory.
Object ACL
The access control list (ACL) of the video. Select an option based on your business requirements. Default value: Inherited from Bucket.
Files to Upload
The video that you want to upload. You can click Select Files or Select Folders to upload the video. You can also drag the video to the dashed-line box. After the video is uploaded, the specified workflow is triggered to generate a media file.
Click Upload Object.
What to do next
After the video is uploaded, a media file is generated and displayed on the Media List page in the MPS console. You can view or publish the media file. For more information, see Manage media files.
Upload a video by using the OSS API or OSS tools
OSS also allows you to upload a video by calling API operations or using OSS tools:
Call basic operations, such as the PutObeject, PostObject, and CopyObeject operations. For more information, see Basic operations.
NoteIf you call basic operations to upload a video to a specific path of an MPS workflow and the trigger mode of the workflow is automatic trigger, the workflow is automatically triggered. If you do not want to trigger an MPS workflow when you call the CopyObeject operation to copy a video, disable the workflow.
Call multipart upload operations. For more information, see Multipart upload.
NoteIf you perform multipart upload to upload a video, you must call the UploadPart operation instead of the PutObject operation. Otherwise, the specified workflow is triggered each time a part file is uploaded. After all part files are uploaded, you must call the CompleteMultipartUpload operation to complete the upload. Otherwise, the specified workflow cannot be triggered.
Use OSS tools such as ossutil and ossbrowser. For more information, see OSS tools.
FAQ
Why are multiple transcoding jobs triggered after I upload a file?
If multiple transcoding jobs are triggered by one uploaded file, you can troubleshoot the issue by using the following methods:
Check the input path of the specified workflow and the upload path of the file, and check whether the uploaded file may trigger multiple workflows based on workflow triggering rules. For more information, see Workflow triggering rules for files.
Check whether the input path and output path of the specified workflow may trigger an inner loop of the workflow. Check whether the code contains loop logic. For example, a file is generated and triggers the workflow again.
Check whether the uploaded file is a live stream recording in the M3U8 format. If you call the PutObject operation of OSS multiple times to update the M3U8 file during the recording process, the specified workflow is triggered multiple times. To prevent the workflow from being repeatedly triggered, we recommend that you configure the workflow to be manually triggered, and call the AddMedia operation to trigger the workflow after the M3U8 file is updated. If you configure the workflow to be automatically triggered, you must wait until the live stream recording is complete and upload the M3U8 file to OSS to automatically trigger the workflow.
Check whether multipart upload is performed. If you call the PutObject operation to upload part files, the specified workflow is triggered multiple times. To prevent the workflow from being repeatedly triggered, you must call the UploadPart operation to upload part files. After all part files are uploaded, you must call the CompleteMultipartUpload operation to complete the upload. Otherwise, the specified workflow cannot be triggered.