你可以使用此接口查询指定合流转推任务的相关信息。
你可以调用GetPushMixedStreamToCDNTask接口,指定你所属的AppId,查询指定 RoomId 下的合流转推任务。
你可以查询由客户端或服务端发起的合流转推任务,但返回的参数结构均为服务端的参数结构。
不支持查询端云一体场景下客户端合流转推任务。
通过此接口仅能查询距今 72 小时内开始的合流转推任务。
在查询前,你必须已经在控制台上开通转推直播服务。
关于调用接口的服务地址、通信协议、字符编码和签名机制,参看调用 OpenAPI。
QPS 不得超过 60。
使用 Get 方式发起请求。
以下是接口特有的请求参数。关于其他公共请求参数,参看请求参数。
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | GetPushMixedStreamToCDNTask | 接口名称,本接口取值:GetPushMixedStreamToCDNTask |
| Version | String | 是 | 2020-12-01 | 接口版本,本接口取值:2020-12-01 |
| AppId | String | 是 | Your_AppId | 你的音视频应用的唯一标志 |
| RoomId | String | 是 | Your_RoomId | 房间的 ID,是房间的唯一标志 |
| TaskId | String | 否 | Your_TaskId | 要查询的转推任务 ID。关于 TaskId 和 UserId,请参看注释1。 |
| UserId | String | 否 | Your_UserId | 客户端发起转推任务的用户 ID。关于 UserId,详情请参看注释2。 |
注释1:
TaskId 和 UserId 均为非必填参数,但是你需要至少填一个参数以保证可以正常发起请求。
注释2:
你在客户端发起多个任务,当使用该接口进行查询时:
UserId 可以传入发起转推任务的用户 UserId,TaskId 传入空字符串;或直接将该用户的 UserId 传入 TaskId。UserId 和 TaskId 为发起转推任务的用户 UserId 和 TaskId。https://rtc.volcengineapi.com?Action=GetPushMixedStreamToCDNTask&Version=2020-12-01&AppId=Your_AppId&RoomId=Your_RoomId&TaskId=Your_TaskId&UserId=Your_UserId
返回结果参看 BaseResponse。
其中 Result 的结构如下:
| 参数名 | 类型 | 描述 |
|---|---|---|
| TranscodeTask | TranscodeTask | 合流转推任务信息 |
| 参数名 | 类型 | 描述 |
|---|---|---|
| StartTime | Uint64 | 任务开始时间戳,Unix 时间,单位为毫秒 |
| EndTime | Uint64 | 任务结束时间戳,Unix 时间,单位为毫秒。0 表示任务未结束 |
| Status | Uint64 | 任务状态。0: 未知异常状态1: 未开始 2: 运行中3: 已结束4: 任务运行失败 |
| StopReason | String | 任务停止的原因无:表示任务未结束UnknownStopReason:未知停止原因StopByAPI:用户主动调用 服务端 OpenAPI 停止StartTaskFailed:任务启动失败IdleTimeOut:任务超过最大空闲时间UserDisconnect:客户端用户主动退房/调用停止转推接口 |
| TargetStreams | Streams | 转推任务包含的音视频流 |
| ExcludeStreams | Streams | 转推任务排除的音视频流 |
| PushURL | String | 推流 CDN 地址。仅支持 RTMP 协议。 |
| Encode | Encode | 输出的音视频编码参数。 |
| Layout | Layout | 房间内多路流合为一路时的布局参数 |
| Control | Control | 音视频扩展配置。 |
{
"Result": {
"TranscodeTask": {
"StartTime": 1677237518000,
"EndTime": 1677239022000,
"Status": 3,
"StopReason": "StopByAPI",
"TargetStreams": {
"StreamList": [
{
"Index": 1,
"UserId": "user1",
"StreamType": 0
}
]
},
"ExcludeStreams": {
"StreamList": [
{
"Index": 3,
"UserId": "user3",
"StreamType": 1
}
]
},
"PushURL": "rtmp://xxxxxx",
"Layout": {
"LayoutMode": 2,
"CustomLayout": {
"Canvas": {
"Width": 1280,
"Height": 720,
"Background": "#303342",
"BackgroundImage": "http://xxxxxx"
},
"Regions": [
{
"StreamIndex": 1,
"LocationX": 0,
"LocationY": 0.2,
"WidthProportion": 0.5,
"HeightProportion": 0.4,
"ZOrder": 0,
"Alpha": 1,
"CornerRadius": 0,
"RenderMode": 0,
"SourceCrop": {
"LocationX": 0.5,
"LocationY": 0.5,
"WidthProportion": 0.4,
"HeightProportion": 0.4
},
"AlternateImage": "http://xxxxx",
"SpatialPosition": [
1,
1,
1
]
}
]
}
},
"Encode": {
"VideoCodec": 0,
"VideoBitrate": 1600,
"VideoWidth": 1280,
"VideoHeight": 720,
"VideoFps": 15,
"VideoGop": 4,
"AudioCodec": 0,
"AudioProfile": 0,
"AudioBitrate": 128,
"AudioSampleRate": 48000,
"AudioChannels": 2
},
"Control": {
"MediaType": 0,
"FrameInterpolationMode": 0,
"MaxIdleTime": 180,
"VolumeIndicationInterval": 2,
"VolumeIndicationMode": false,
"TalkVolume": 0,
"SpatialConfig": {
"AudienceSpatialPosition": [
0,
0,
0
]
},
"PushStreamMode": 0
}
}
},
"ResponseMetadata": {
"RequestId": "Your_RequestId",
"Action": "GetTranscodeTask",
"Version": "2020-12-01",
"Service": "rtc",
"Region": "cn-north-1"
}
}
json