Overview
When workflows cannot meet your needs, use the API to submit transcoding jobs with custom business logic. For example, you can skip transcoding for certain videos or apply different configurations per video.
Benefits
-
Flexible job submission based on custom business logic.
-
Transcoding, container format conversion, watermarking, HLS-AES128 standard encryption, and video editing.
-
Job completion notifications to a message queue or notification service.
-
URL-based playback.
Architecture:
Parsing
-
Configure transcoding templates and watermark templates, and set up message notifications for an MPS queue.
-
Upload videos to Object Storage Service (OSS).
-
Call the API to submit transcoding jobs.
-
Wait for ApsaraVideo Media Processing to complete the job and send a completion message to the queue.
-
Start playback.
Limits
-
Each transcoding job generates one output file. Jobs can be submitted in batches.
-
Supports HLS-AES128 standard encryption only. Alibaba Cloud proprietary cryptography is not supported.
-
Supports URL-based playback only, not media ID-based playback. To enable automatic definition switchover and multi-format support, associate multiple outputs with different definitions and formats.
Prerequisites
-
(Optional) Create a custom transcoding template in the ApsaraVideo Media Processing console.
-
(Optional) Create a custom watermark template in the ApsaraVideo Media Processing console.
Procedure
-
Upload the input file to OSS by using the OSS console, an upload tool, or the upload SDK.
-
After receiving the completion message, call the QueryTranscodingJob operation to query the result and retrieve the output file URL.
-
Play the video from the URL.