实时录制事件

最近更新时间:2024-09-11 09:08:12

我的收藏

录制开始

事件名称
OnlineRecordStarted
事件说明
当实时录制服务准备完成,开始录制时通知 App 后。
EventData 结构定义
参数名称
类型
描述
TaskId
String
录制已开始的实时录制 TaskId
RoomId
Integer
实时录制的房间 ID
RecordUserId
String
当前任务用于实时录制服务进房的用户 ID
示例
{
"EventData": {
"RecordUserId": "tic_record_user_1253_01",
"RoomId": 1253,
"TaskId": "bj0mt2l23osdj300hl30"
},
"EventType": "OnlineRecordStarted",
"ExpireTime": 1590046391,
"SdkAppId": 1400000001,
"Sign": "a2dabb362a9b811c0e26953a6276a41c",
"Timestamp": 1575545412
}

录制停止

事件名称
OnlineRecordStopped
事件说明
当用户主动调用停止录制接口或者由于其他原因自动停止录制时通知 App 后台。
EventData 结构定义
参数名称
类型
描述
TaskId
String
录制已停止的实时录制 TaskId
RoomId
Integer
实时录制的房间 ID
RecordUserId
String
当前任务用于实时录制服务进房的用户 ID
示例
{
"EventData": {
"RecordUserId": "tic_record_user_1253_01",
"RoomId": 1253,
"TaskId": "bj0mt2l23osdj300hl30"
},
"EventType": "OnlineRecordStopped",
"ExpireTime": 1590046391,
"SdkAppId": 1400000001,
"Sign": "a2dabb362a9b811c0e26953a6276a41c",
"Timestamp": 1575545412
}

录制结果回调

事件名称
OnlineRecordFinished
事件说明
当实时录制完成时通知 App 后台。
EventData 结构定义
参数名称
类型
描述
TaskId
String
录制结束的实时录制任务 ID
RoomId
Integer
房间号
GroupId
String
白板的群组 ID
RecordUserId
String
录制用户 ID
FinishReason
String
录制结束原因
AUTO:房间内长时间没有音视频上行及白板操作导致自动停止录制
USER_CALL:主动调用了停止录制接口
EXCEPTION:录制异常结束
RecordStartTime
Integer
实际开始录制时间,Unix 时间戳,单位秒
RecordStopTime
Integer
实际停止录制时间,Unix 时间戳,单位秒
TotalTime
Integer
回放视频总时长(单位:毫秒)
ExceptionCnt
Integer
录制过程中出现异常的次数
OmittedDurations
拼接视频中被忽略的时间段,只有开启视频拼接功能的时候,这个参数才是有效的
VideoInfos
Array of VideoInfo
录制视频列表
Error.Code
String
如果实时录制发生错误会有该字段,具体错误码描述请参考接口文档 查询实时录制任务
Error.Message
String
如果实时录制发生错误的具体错误描述
示例
示例1 实时录制成功的回调
{
"EventData": {
"TaskId": "ghucnligqtgtvk2624mb",
"RoomId": 880528,
"GroupId": "880528",
"RecordUserId": "tic_record_user_880528_test-01",
"FinishReason": "USER_CALL",
"RecordStartTime": 1568949369,
"RecordStopTime": 1568949392,
"TotalTime": 18317,
"ExceptionCnt": 0,
"OmittedDurations": [],
"VideoInfos": [
{
"UserId": "Mac_trtc_04",
"VideoDuration": 17969,
"VideoFormat": "mp4",
"VideoId": "dace3518e865e76a9e36712c629822ba",
"VideoPlayTime": 0,
"VideoSize": 593418,
"VideoType": 0,
"VideoUrl": "http://online-recording-1259648581.file.myqcloud.com/00sp43mantgtv4r842mb/d124f518e865e76a9e36712c629822ba.mp4"
},
{
"UserId": "tic_mixstream_880528_101",
"VideoDuration": 18205,
"VideoFormat": "mp4",
"VideoId": "763d1f6b8679c3f17fb118bd37d05c85",
"VideoPlayTime": 3,
"VideoSize": 765545,
"VideoType": 3,
"VideoUrl": "http://online-recording-1259648581.file.myqcloud.com/00sp43mantgtv4r842mb/763d1f6b86724f51fb118bd37d05c85.mp4"
},
{
"UserId": "tic_mixstream_880528_3",
"VideoDuration": 18222,
"VideoFormat": "mp4",
"VideoId": "1b9623df0516dc7318df89f6e7fffc1e",
"VideoPlayTime": 95,
"VideoSize": 402038,
"VideoType": 3,
"VideoUrl": "http://online-recording-1259648581.file.myqcloud.com/00sp43mantgtv4r842mb/1b9623df05124f51318df89f6e7fffc1e.mp4"
},
{
"UserId": "",
"VideoDuration": 17605,
"VideoFormat": "mp4",
"VideoId": "a8152f8faa2cfe621dc965a066a5813c",
"VideoPlayTime": 623,
"VideoSize": 226337,
"VideoType": 2,
"VideoUrl": "http://online-recording-1259648581.file.myqcloud.com/00sp43mantgtv4r842mb/a815224f512cfe621dc965a066a5813c.mp4"
}
]
},
"EventType": "OnlineRecordFinished",
"ExpireTime": 1590046391,
"SdkAppId": 1400000001,
"Sign": "a2dabb362a9b811c0e26953a6276a41c",
"Timestamp": 1575545412
}
示例2 实时录制失败的回调
{
"EventData": {
"Error": {
"Code": "FailedOperation.Record",
"Message": "code: 40001, msg: 2020-05-21 15:20:06, invalid userid\\n"
},
"ExceptionCnt": 0,
"FinishReason": "EXCEPTION",
"GroupId": "880528",
"OmittedDurations": [],
"RecordStartTime": 0,
"RecordStopTime": 1590045606,
"RecordUserId": "tic_record_user_880528_test-01",
"RoomId": 880528,
"TaskId": "ghucnligqtgtvk2624mb",
"TotalTime": 0,
"VideoInfos": []
},
"EventType": "OnlineRecordFinished",
"ExpireTime": 1590046391,
"SdkAppId": 1400000001,
"Sign": "a2dabb362a9b811c0e26953a6276a41c",
"Timestamp": 1575545412
}

长时间暂停告警

事件名称
OnlineRecordLongPauseWarning
事件说明
实时录制暂停超过30分钟会自动停止,当暂停了20分钟时,会通知 App 后台处理该任务。
EventData 结构定义
参数名称
类型
描述
TaskId
String
录制已开始的实时录制 TaskId
RoomId
Integer
实时录制的房间 ID
RecordUserId
String
当前任务用于实时录制服务进房的用户 ID
PauseTime
Integer
暂停时间,Unix 时间戳,单位秒
EstimateStopTime
Integer
预计自动停止时间,Unix 时间戳,单位秒
示例
{
"EventData": {
"TaskId": "bj0mt2l23osdj300hl30",
"RoomId": 1253,
"RecordUserId": "tic_record_user_1253_01",
"PauseTime": 1575545412,
"EstimateStopTime": 1575546412
},
"EventType": "OnlineRecordLongPauseWarning",
"ExpireTime": 1590046391,
"SdkAppId": 1400000001,
"Sign": "a2dabb362a9b811c0e26953a6276a41c",
"Timestamp": 1575545412
}

长时间暂停自动结束

事件名称
OnlineRecordLongPauseForceStopped
事件说明
实时录制暂停超过30分钟会自动停止,会通知 App 后台已经自动停止当前任务。
EventData 结构定义
参数名称
类型
描述
TaskId
String
录制已开始的实时录制 TaskId
RoomId
Integer
实时录制的房间 ID
RecordUserId
String
当前任务用于实时录制服务进房的用户 ID
PauseTime
Integer
暂停时间,Unix 时间戳,单位秒
StopTime
Integer
自动停止时间,Unix 时间戳,单位秒
示例
{
"EventData": {
"TaskId": "bj0mt2l23osdj300hl30",
"RoomId": 1253,
"RecordUserId": "tic_record_user_1253_01",
"PauseTime": 1575545412,
"StopTime": 1575546412
},
"EventType": "OnlineRecordLongPauseForceStopped",
"ExpireTime": 1590046391,
"SdkAppId": 1400000001,
"Sign": "a2dabb362a9b811c0e26953a6276a41c",
"Timestamp": 1575545412
}