All Products
Search
Document Center

ApsaraVideo VOD:StreamTranscodeComplete

Last Updated:Oct 24, 2023

This topic describes the StreamTranscodeComplete event and provides sample callbacks.

Event type

StreamTranscodeComplete

Event description

The StreamTranscodeComplete event is generated when a video stream is transcoded to a specific definition and format, such as an SD stream in the MP4 format. A video stream in a single resolution can be played immediately after the video stream is transcoded in at least one format.

Note

If you have enabled URL signing, you must generate the auth_key to play the video based on the URL. Otherwise, the HTTP 403 error code is returned. For more information about URL signing, see Configure URL signing.

Event notification

Parameter

Type

Required

Description

EventTime

String

Yes

The time when the event was generated. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.

EventType

String

Yes

The event type. The value is StreamTranscodeComplete.

VideoId

String

Yes

The ID of the video.

Status

String

Yes

Indicates whether the video stream is transcoded. Valid values:

  • success

  • fail

Bitrate

String

No

The bitrate of the video stream. Unit: Kbit/s.

Definition

String

No

The quality of the video stream. Valid values:

  • FD: low definition

  • LD: standard definition

  • SD: high definition

  • HD: ultra high definition

  • OD: original definition

  • 2K

  • 4K

  • AUTO: adaptive

Duration

Double

No

The duration of the video stream. Unit: seconds.

Codec

String

No

The codec of the video stream.

Encrypt

Boolean

No

Indicates whether the video stream is encrypted.

EncryptType

String

No

The encryption type.

ErrorCode

String

No

The error code. This parameter is returned if an error occurs while the video stream is being transcoded.

ErrorMessage

String

No

The error message. This parameter is returned if an error occurs while the video stream is being transcoded.

FileUrl

String

No

The playback URL of the video stream. The URL does not include the auth_key. If you have enabled URL signing, you must generate the auth_key to play the video based on the URL.

Format

String

No

The format of the video stream.

  • mp4

  • m3u8

Fps

String

No

The frame rate of the video stream. Unit: FPS.

Height

Long

No

The height of the video stream. Unit: pixels.

Size

Long

No

The size of the video stream. Unit: bytes.

Width

Long

No

The width of the video stream. Unit: pixels.

JobId

String

No

The ID of the transcoding job.

WatermarkId

String

No

The IDs of the watermarks. Multiple IDs are separated by commas (,).

IsAudio

Boolean

Yes

Indicates whether the stream is an audio stream.

StartTime

String

Yes

The start time of the task. The time is displayed in UTC.

FinishTime

String

Yes

The end time of the task. The time is displayed in UTC.

Extend

String

No

The user-defined parameter that is returned in the pass-through mode. For more information, see Request parameters.

Sample callbacks

Description:

  • For an HTTP callback, the following example is the message body of the HTTP POST request.

  • For an MNS callback, the following example is the message body.

    { 
       "EventTime": "2017-03-20T07:49:17Z",
       "EventType": "StreamTranscodeComplete", 
       "VideoId": "43q9fj74hdf****", 
       "Status": "success",
       "Bitrate": "925",
       "Definition": "LD",
       "Duration": 15.0,
       "Encrypt": false,
       "FileUrl": "http://example.aliyundoc.com/DBEBDEAJS73J79BE4D****/52a53151eba5js73ke2da3b55bc5****.mp4",
       "Format": "mp4",
       "Fps": "30",
       "Height": 960,
       "Size": 1815321,
       "Width": 540,
       "JobId":"ddddddddddd",
       "Codec":"h264",
       "WatermarkId": "33q9fj74hdf****,93q9fj74hdf****", 
       "IsAudio": false, 
       "StartTime": "2017-03-20T07:49:17Z",
       "FinishTime": "2017-03-20T09:49:17Z",
       "Extend":"test data"
    }