A media workflow in ApsaraVideo Media Processing (MPS) contains multiple activities to implement the automatic processing of an input file. This topic introduces the basic concepts and execution rules of media workflows in MPS to help you better understand and use MPS.

Basic concepts

  • Media asset

    A media asset contains one input file, such as a video or audio file, and all related output files, such as transcoded files, snapshots, media information, and AI tags. An input file corresponds to only one media asset and is uniquely identified by the ID of the media asset.

  • Media Library

    Media Library is the collection of all media assets. A media asset is the smallest management unit in Media Library.

  • Media workflow

    A media workflow automatically generates media files based on your requirements and is uniquely identified by the ID of the media workflow.

    • Activity
      A media workflow contains multiple nodes. Each node is called an activity. Multiple activities can be run in parallel or one by one. An activity can be an input activity, a notification activity, or a type of job, such as a transcoding job and a video snapshot job.
      Note Features of MPS vary based on different regions. The activities supported by a media workflow are also different among regions. For more information about features supported in different regions, see Regions and endpoints.
      • Input activity

        After you specify the input path for a workflow, the workflow is automatically triggered the moment you upload a media file, such as an audio file or a video file, to the specified input path.

      • Notification activity

        After a workflow is complete, a notification that contains the execution results of the workflow is sent to the specified Message Service (MNS) queue or topic. The execution results include the media ID and the absolute address of the media file. Then, you can determine which media file is processed.

      • Job activity

        All parameters supported by a job can be configured in a job activity.

    • Path matching rule

      If the path of an uploaded file matches the input path specified for a workflow, the workflow is automatically triggered. If the prefix of the path of an uploaded file is the same as an input path, the file path matches the input path. For example, the path of an uploaded file is http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/A/B/C/video_01.flv. The following table describes the matching results of multiple Object Storage Service (OSS) input paths.

      OSS input path Matched
      http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/A/B/C/ Yes
      http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/A/B/C2/ No
      http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/A/B Yes
      http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/A/B2/ No
      http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/A/ Yes
      http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/A2/B/C/ No
      http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/A/B/C/video Yes
      http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/A/B/C/video_01 No
    • Matching rule of file name extensions
      After you upload a file, the automatic trigger mechanism checks the file name extension to prevent invalid files from being uploaded. For example, a PDF file and a Word file are considered invalid by the automatic trigger mechanism.
      Note If you manually trigger a workflow by calling an API operation, the file name extension is not checked.
      If a file does not have a file name extension or the file name extension matches the extensions in the following lists, the file is considered valid. A file that does not have a file name extension has no separator dot in the file name.
      • File name extensions supported for a video file

        .3gp, .asf, .avi, .dat, .dv, .flv, .f4v, .gif, .m2t, .m3u8, .m4v, .mj2, .mjpeg, .mkv, .mov, .mp4, .mpe, .mpg, .mpeg, .mts, .ogg, .qt, .rm, .rmvb, .swf, .ts, .vob, .wmv, and .webm

      • File name extensions supported for an audio file

        .aac, .ac3, .acm, .amr, .ape, .caf, .flac, .m4a, .mp3, .ra, .wav, .wma, and .aiff

    • Workflow execution
      A workflow can be automatically triggered or manually triggered by calling an API operation.
      • Automatic trigger mechanism: A workflow is automatically triggered each time the path of an uploaded media file matches the input path specified for the workflow. If you upload the same file multiple times, the workflow is automatically triggered multiple times. An ID is generated for each execution of the workflow.
      • Manual trigger mechanism: A workflow is triggered each time you call an API operation. The manual trigger mechanism applies to existing video files that are uploaded to OSS buckets but not processed.
    • User data

      If you set custom parameters of user data, such as the ID of a commodity, when you trigger a workflow, the custom parameters are returned in a notification. This way, you can associate the user data with your business based on the custom parameters without the need to record the media ID or the absolute path of the media file.