All Products
Search
Document Center

VideoAnalysisComplete

Last Updated: Jul 31, 2019

Event type

VideoAnalysisComplete

Event description

A VideoAnalysisComplete event is generated after ApsaraVideo for VOD analyzes an uploaded audio or video mezzanine file.

Note:

  • ApsaraVideo for VOD analyzes all uploaded audio and video mezzanine files by default. The analysis is free of charge.
  • During the analysis, ApsaraVideo for VOD extracts the basic metadata about the mezzanine file, including the duration, resolution (width and height), bitrate, and frame rate.
  • After the analysis is completed, ApsaraVideo for VOD stores the metadata in the media library. You can call the GetMezzanineInfo operation to obtain the detailed metadata.

Event content

Parameter Type Description
EventTime String The time when the event occurs. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
EventType String The type of the event. Set this parameter to VideoAnalysisComplete.
VideoId String The audio or video ID.
Status String The analysis result of the mezzanine file. Valid values: success and fail.
Width Long The width of the mezzanine file. This parameter is unavailable if the mezzanine file is an audio file.
Height Long The height of the mezzanine file. This parameter is unavailable if the mezzanine file is an audio file.
Duration Float The duration of the mezzanine file. Unit: seconds.
Bitrate String The bitrate of the mezzanine file. Unit: kbit/s.
Fps String The frame rate of the mezzanine file. Unit: fps. This parameter is unavailable if the mezzanine file is an audio file.
Size Long The size of the mezzanine file. Unit: bytes.
ErrorCode String The error code. This parameter is available if the mezzanine file fails to be analyzed.
ErrorMessage String The error message. This parameter is available if the mezzanine file fails to be analyzed.

Note:

  • If the value of the Status parameter is fail, the metadata about the mezzanine file is not returned. Generally, the analysis fails because the mezzanine file encapsulation is incorrect.

Callback example

Note:

  • For an HTTP callback, write the following code as the HTTP POST request body.
  • For an MNS callback, write the following code as the message body.

Callback message for successful analysis

  1. {
  2. "VideoId":"84bd5b0566dd7a7f9986befd0e8021ff",
  3. "EventTime":"2018-11-28T10:12:48Z",
  4. "EventType":"VideoAnalysisComplete",
  5. "Status":"success",
  6. "Duration":"12",
  7. "Height":"360",
  8. "Width":"630",
  9. "Fps":"30",
  10. "Bitrate":"499",
  11. "Size":"1234568"
  12. }

Callback message for an analysis failure

  1. {
  2. "VideoId":"84bd5b0566dd7a7f9986befd0e8021ff",
  3. "EventTime":"2018-11-28T10:12:48Z",
  4. "EventType":"VideoAnalysisComplete",
  5. "Status":"fail",
  6. "ErrorCode":"InvalidParameter.ResourceContentBad",
  7. "ErrorMessage":"The resource operated InputFile is bad"
  8. }