Updated on 2022-10-24 GMT+08:00

Transcoding Message Body

Sample Transcoding Success Message

{
	"event_type": "transcodeComplete",
	"transcode_info": {
		"asset_id": "14d7b2faba0dddd6b4e8936272d6bc3f",
		"status": "SUCCEED",
		"templateGroupName": "ssw",
		"output": [{
			"play_type": "HLS",
			"url": "https://179.cdn-vod.huaweicloud.com/asset/14d7b2faba0dddd6b4e8936272d6bc3f/play_video/index.m3u8",
			"encrypted": 0,
			"meta_data": {
				"play_type": 0,
				"codec": "H_264",
				"duration": 0,
				"videoSize": 0,
				"width": 0,
				"hight": 0,
				"bitRate": 0,
				"frameRate": 0
			}
		}, {
			"play_type": "HLS",
			"url": "https://179.cdn-vod.huaweicloud.com/asset/14d7b2faba0dddd6b4e8936272d6bc3f/play_video/58c6433759c2be34818085006af42d1e_1_1280X720_1500_0.m3u8",
			"encrypted": 0,
			"quality": "HD",
			"meta_data": {
				"play_type": 0,
				"codec": "H_264",
				"duration": 26,
				"videoSize": 3246080,
				"width": 1280,
				"hight": 720,
				"bitRate": 892,
				"frameRate": 1,
				"quality": "HD"
			}
		}]
	}
}

Transcoding Message Body Description

Table 1 TranscodeInfo structure

Parameter

Description

asset_id

Media ID

status

Event status

  • SUCCEED: Transcoding succeeded.
  • FAILED: Transcoding failed.

template_group_name

Transcoding template group name

output

Transcoding output array.

  • If outputs are in HLS or DASH format, the number of members in this array is n+1, where n indicates the number of transcoding outputs.
  • If outputs are in MP4 format, the number of members in this array is n, where n indicates the number of transcoding outputs.

This parameter is used only when status is SUCCEED. For details, see Table 2.

error_code

Error code. This parameter is used only when status is FAILED.

error_msg

Error description. This parameter is used only when status is FAILED.

Table 2 Output structure

Parameter

Description

play_type

Protocol type

The value can be hls, dash, or mp4.

url

Access URL

encrypted

Whether the stream is encrypted

The values can be 0 or 1.

  • 0: Unencrypted
  • 1: Encrypted

quality

Video quality. The values can be:

  • FLUENT
  • SD
  • HD
  • FULL_HD

meta_data

Playlist metadata. The values can be:

  • pack_type: packaging type, such as TS or MP4
  • duration: video duration, in seconds
  • size: video size, in bytes
  • width: video width (unit: pixel)
  • height: video height (unit: pixel)
  • bit_rate: average video bitrate
  • frame_rate: in FPS