Updated on 2022-03-17 GMT+08:00

JSON Message Body

Table 1 describes the fields in a JSON message.

Table 1 JSON message body

Parameter

Type

Description

event_type

String

Event type.

Possible values include:
  • TranscodeComplete: A transcoding task has completed.
  • TranscodeStart: A transcoding task starts.
  • ThumbnailComplete: A snapshot task has completed.
  • RemuxComplete: A packaging task has completed.
  • AnimatedGraphicsComplete: An animated GIF file has been generated.
  • ParseComplete: Attribute parsing completed

transcode_info

TranscodeInfo

Transcoding information. This parameter is used only when event_type is TranscodeComplete or TranscodeStart.

thumbnail_info

ThumbnailInfo

Snapshot information. This parameter is used only when event_type is ThumbnailComplete.

animated_graphics_info

AnimatedGraphicsInfo

GIF image information. This parameter is used only when event_type is AnimatedGraphicsComplete.

remux_info

RemuxInfo

Packaging information. This parameter is used only when event_type is RemuxComplete.

Table 2 TranscodeInfo parameter description

Parameter

Type

Description

task_id

string

Task ID

status

tring

Event status.
  • TRANSCODING: started
  • SUCCEED: completed
  • FAILED: failed

create_time

string

Time when a task is created

start_time

string

Time when a task starts

end_time

string

Time when a task ends

intput

FileAddress

Storage location of an input file

output

FileAddress

Storage location of an output file

description

string

Task description

media_detail

MediaDetail

Transcoding details. This field is unavailable if transcoding fails.

Table 3 MediaDetail parameter description

Parameter

Type

Description

features

String[]

Task name

origin_para

OriginPara

Input file information

output_video_paras

OutputVideoPara[]

Information about multiple output media files

output_watermark_para

OutputWatermarkPara

Watermark information

Table 4 OriginPara parameter description

Parameter

Type

Description

duration

Integer

Duration of an input file

file_format

String

Input file format

video

Video

Input video file information

audio

Audio

Input audio file information

Table 5 Video parameter description

Parameter

Type

Description

width

Integer

Video width

height

Integer

Video height

bitrate

Integer

Video bitrate

frame_rate

Integer

Video frame rate

codec

string

Video codec

Table 6 Audio parameter description

Parameter

Type

Description

codec

string

Audio codec

sample

Integer

Audio sampling rate

channels

Integer

Audio channel

bitrate

Integer

Audio bitrate

Table 7 OutputVideoPara parameter description

Parameter

Type

Description

template_id

Integer

ID of the template used by the output video

size

Integer

Video size

pack

string

Video container format

video

Video

Output file (video) information

audio

Audio

Output file (audio) information

file_name

string

Output file name

conver_duration

double

Converted duration

error

Error

Error information

Table 8 OutputWatermarkPara parameter description

Parameter

Type

Description

time_duration

Int32

Watermark duration

Table 9 AnimatedGraphicsInfo parameter description

Parameter

Type

Description

task_id

String

Task ID

status

String

Event status.
  • SUCCEED: completed
  • FAILED: failed

create_time

String

Time when a task is created

start_time

String

Time when a task starts

end_time

String

Time when a task ends

description

String

Task description. If a task is abnormal, this field indicates error details.

input

FileAddress

Input file information

output

FileAddress

Output file information

output_param

AnimatedGraphicsOutputParam

Animated GIF parameters

Table 10 FileAddress parameter description

Parameter

Type

Description

location

String

Region where an OBS bucket is deployed

bucket

String

Name of the OBS bucket

object

String

File path.

  • If this parameter is used for an input, a specific path must be specified.
  • If this parameter is used for an output, only the directory for storing the outputs needs to be specified.

file_name

String

Name of an output file.

  • If this parameter is specified, the output object name is object/file_name.
  • If this parameter is not specified, the output object name is object/xxx, where xxx is allocated by the system.
Table 11 AnimatedGraphicsOutputParam parameter description

Parameter

Type

Description

format

String

Output file format. Currently, only GIF format is supported.

width

Integer

Width of an output file

height

Integer

Height of an output file

start

Integer

Start time

Unit: millisecond

end

Integer

End time

frame_rate

Integer

Frame rate of the output file

Table 12 ThumbnailInfo parameter description

Parameter

Type

Description

task_id

string

Task ID

status

tring

Event status.

  • SUCCEED: completed
  • FAILED: failed

create_time

string

Time when a task is created

start_time

String

Time when a task starts

end_time

string

Time when a task ends

intput

FileAddress

Storage location of an input file

output

FileAddress

Storage location of an output file

description

string

Task description

output_file_name

String

Output file name

thumbnail_info

PicInfo[]

Snapshot details. This field is unavailable if capturing snapshots fails.

Table 13 PicInfo parameter description

Parameter

Type

Description

pic_name

String

Snapshot file name

Table 14 RemuxInfo parameter description

Parameter

Type

Description

task_id

String

Task ID

status

String

Event status.
  • SUCCEED: completed
  • FAILED: failed

create_time

String

Time when a task is created

start_time

String

Time when a task starts

end_time

String

Time when a task ends

description

String

Task description. If a task is abnormal, this field indicates error details.

input

FileAddress

Input file information

output

FileAddress

Output file information

output_param

RemuxOutputParam

Packaging parameters

Table 15 RemuxOutputParam parameter description

Parameter

Type

Description

format

String

Output format.

Possible values are:
  • HLS
  • MP4

segment_duration

Integer

Segment duration. This parameter is only used when format is HLS.

The value ranges from 2 to 10.

Default value: 5

Unit: second