API-based transcoding

更新时间:
复制 MD 格式

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

  1. Configure transcoding templates and watermark templates, and set up message notifications for an MPS queue.

  2. Upload videos to Object Storage Service (OSS).

  3. Call the API to submit transcoding jobs.

  4. Wait for ApsaraVideo Media Processing to complete the job and send a completion message to the queue.

  5. 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

Procedure

  1. Upload the input file to OSS by using the OSS console, an upload tool, or the upload SDK.

  2. Set up message queue notifications for the MPS queue.

  3. Submit a transcoding job.

  4. After receiving the completion message, call the QueryTranscodingJob operation to query the result and retrieve the output file URL.

  5. Play the video from the URL.