edit-icon download-icon

Overview

Last Updated: Dec 30, 2017

Previous step: Upload a video file

  • Message format

    When media workflow execution starts or completes, a message is sent to the queue or topic (notification) specified by MNS.

    • Format definition

      A message body is in JSON format. For details about the field names, types, and descriptions, see “Media workflow message” in AddMedia.

      The structure layers are defined as follows:

      • Top layer

        It is a JSON object. Definition:

        {Basic attribute of the current activity, object to be executed by the workflow}.

      • Basic attribute of the current activity

        It is a top-layer key value attribute, rather than an independent object. See the following example. Definition:

        Workflow execution ID, activity name, activity type, activity state, error information.

      • Details of the object to be executed by the workflow

        It is a JSON object. Definition:

        {Workflow execution ID, media workflow ID, media workflow name, media ID, input file, workflow execution type, activity object array, creation time}.

      • Activity object array

        It is a JSON array, containing all activities executed to the current state. For example, a start message contains only the Start activity object, while a completion message contains all activity objects. Definition:

        [Activity object, activity object, …]

      • Activity object

        It is a JSON object. Definition:

        {Activity name, activity type, task ID, activity state, start time, end time, error information}.

    • Start

      “Activity type” in activity basic attribute is “Start”.

    • Complete

      “Activity type” in activity basic attribute is “Report”.

    • Example

      1. {
      2. "RunId": "8f8aba5a62ab4127ae2add18da20b0f2",
      3. "Name": "Act-4",
      4. "Type": "Report",
      5. "State": "Success",
      6. "MediaWorkflowExecution": {
      7. "Name": "ConcurrentSuccess",
      8. "RunId": "8f8aba5a62ab4127ae2add18da20b0f2",
      9. "Input": {
      10. "InputFile": {
      11. "Bucket": "inputfirst",
      12. "Location": "oss-test",
      13. "Object": "mediaWorkflow/ConcurrentSuccess/01.wmv"
      14. }
      15. },
      16. "State": "Success",
      17. "MediaId": "2be491ab4cb6499cd0befe5fcf0cb670",
      18. "ActivityList": [
      19. {
      20. "RunId": "8f8aba5a62ab4127ae2add18da20b0f2",
      21. "Name": "Act-1",
      22. "Type": "Start",
      23. "State": "Success",
      24. "StartTime": "2016-03-15T02: 53: 41Z",
      25. "EndTime": "2016-03-15T02: 53: 41Z"
      26. },
      27. {
      28. "RunId": "8f8aba5a62ab4127ae2add18da20b0f2",
      29. "Name": "Act-2",
      30. "Type": "Transcode",
      31. "JobId": "f34b6d1429dd491faa7a6c1c8f905285",
      32. "State": "Success",
      33. "StartTime": "2016-03-15T02: 53: 43Z",
      34. "EndTime": "2016-03-15T02: 53: 47Z"
      35. },
      36. {
      37. "RunId": "8f8aba5a62ab4127ae2add18da20b0f2",
      38. "Name": "Act-3",
      39. "Type": "Snapshot",
      40. "JobId": "c14150be33304825a5d67cd5364c35cb",
      41. "State": "Success",
      42. "StartTime": "2016-03-15T02: 53: 44Z",
      43. "EndTime": "2016-03-15T02: 53: 45Z"
      44. },
      45. {
      46. "RunId": "8f8aba5a62ab4127ae2add18da20b0f2",
      47. "Name": "Act-4",
      48. "Type": "Report",
      49. "State": "Success",
      50. "StartTime": "2016-03-15T02: 53: 49Z",
      51. "EndTime": "2016-03-15T02: 53: 49Z"
      52. }
      53. ],
      54. "CreationTime": "2016-03-15T02: 53: 39Z"
      55. }
      56. }
  • How to receive and resolve a message

Next step: Video playback

Thank you! We've received your feedback.