最近更新时间:2023.08.07 11:52:35
首次发布时间:2022.02.09 17:21:01
当直播域名配置完成回调功能后,关联事件触发时将以主动发送请求到业务服务器的方式,将含直播事件回调信息的 JSON 数据包发送给业务服务器。
事件通知请求具备重试能力,重试时间间隔为 4s,默认失败后自动触发重试,直至成功。满足以下任意条件可触发重试。
字段 | 类型 | 说明 |
---|---|---|
sign | String | 事件通知请求安全签名 sign=MD5 ( AuthKeyPrimary + t ) 。 说明 火山引擎将回调密钥 AuthKeyPrimary 和过期时间 t 进行字符串拼接后通过 MD5 计算得出 sign 值,并将其放在通知消息里,业务服务器在收到事件通知请求后可以根据同样的算法确认 sign 是否正确,进而确认事件通知请求是否确实来自火山引擎。 |
t | Int64 | 过期时间,事件通知请求签名过期 UNIX 时间戳。 说明 来自火山引擎的事件通知请求默认过期时间是 10 分钟,如果一条事件请求通知中的 t 值所指定的时间已经过期,则可以判定此条事件请求通知无效,通过此方法可以防止网络重放攻击。 |
字段 | 类型 | 说明 |
---|---|---|
vhost | String | 域名空间 |
domain | String | 推流地址 |
app | String | AppName,App 名称 |
stream | String | StreamName,流名称 |
event_type | String | 事件名,push_start 表示开始推流 |
time | Int | 开始推流时间,单位为 s |
time_ms | Int | 开始推流时间,单位为 ms |
transcoded | Boolean | 是否为转码流。
|
fp_node_ip | String | 推流节点 IP |
fp_client_ip | String | 推流客户端 IP |
session_id | String | 本次推流的会话 ID |
回调示例如下所示。
{ "code":0, "message":"ok", "data":{ "vhost":"push-rtmp.example.com", "domain":"push-rtmp.example.com", "app":"live", "stream":"stream-123456", "event_type":"push_start", "detail":{ "time":1640849510, "time_ms":1640849510029, "transcoded":false, "fp_node_ip":"150.139.1.1", "fp_client_ip":"114.100.2.2", "session_id":"3693930911_150.139.1.1" } } }
字段 | 类型 | 说明 |
---|---|---|
vhost | String | 域名空间 |
domain | String | 推流地址 |
app | String | AppName,App 名称 |
stream | String | StreamName,流名称 |
event_type | String | 事件名,push_end 表示推流结束 |
errmsg | String | 断流错误原因描述 |
time | Int | 结束推流时间,单位为 s |
time_ms | Int | 结束推流时间,单位为毫秒 |
transcoded | Boolean | 是否为转码流。
|
fp_node_ip | String | 推流节点 IP |
fp_client_ip | String | 推流客户端 IP |
session_id | String | 本次推流的会话 ID |
回调示例如下所示。
{ "code":0, "message":"ok", "data":{ "vhost":"push-rtmp.example.com", "domain":"push-rtmp.example.com", "app":"live", "stream":"stream-123456", "event_type":"push_end", "detail":{ "time":1640849502, "time_ms":1640849502762, "transcoded":false, "errmsg":"func:OnStop:eof", "fp_node_ip":"106.225.1.1", "fp_client_ip":"113.77.2.2", "session_id":"2491536431_106.225.1.1" } } }
字段 | 类型 | 说明 |
---|---|---|
vhost | String | 域名空间 |
domain | String | 推流地址 |
app | String | AppName,App 名称 |
stream | String | StreamName,流名称 |
event_type | String | 事件名,record_event 表示录制事件 |
tos_bucket | String | 保存在对象存储中的 bucket 名称 |
tos_object | String | 保存在对象存储中的文件路径 |
uri | String | 录制保存在点播时,该录制视频在点播中的 Vid |
duration | Int | 录制长度,单位毫秒 |
start_time | Int | 录制开始时间,Unix 时间,单位为 s |
stop_time | Int | 录制结束时间,Unix 时间 |
format | String | 录制格式。支持的取值如下所示。
|
url | String | 文件地址 说明 如果录制文件存储在 VoD 中, |
vod_filename | String | 录制至点播时的文件路径 |
account_id | Sting | 账号 ID |
size | Int | m3u8 文件大小,单位字节 |
回调示例如下所示。
{ "code":0, "message":"ok", "data":{ "vhost":"pushrtmp.example.com", "domain":"pushrtmp.example.com", "app":"live", "stream":"stream_123456", "event_type":"record_event", "detail":{ "tos_bucket":"", "tos_object":"record/pushrtmp.example.com/live/stream_123456_1640847072_1640849947_record.m3u8", "uri":"v0df17g10000ca6ut9pka0prk****pig", "duration":2868674, "start_time":1640847072, "stop_time":1640849947, "format":"m3u8", "url":"", "vod_filename":"record/{PubDomain}/{App}/{Stream}/{StartTime}_{EndTime}", "account_id":"10000**", "size":28361 } } }
{ "code": 0, "message": "ok", "data": { "vhost": "push.example.com", "domain": "push.example.com", "app": "live", "stream": "stream_12345", "event_type": "record_event", "detail": { "tos_bucket": "livetest", "tos_object": "record/record/push.exanple.com/live/stream_123456/1653469134_1653469220.m3u8", "uri": "", "duration": 84430, "start_time": 1653469134, "stop_time": 1653469220, "format": "m3u8", "url": "http://livetest.tos-cn.volces.com/record/record/testpush.lurenxin.com/live/stream_12345/1653469134_1653469220.m3u8", "account_id": "2000001174", "size": 689 } } }
字段 | 类型 | 说明 |
---|---|---|
Vhost | String | 域名空间 |
Domain | String | 推流地址 |
App | String | AppName,App 名称 |
Stream | String | StreamName,流名称 |
Bucket | String | 保存在对象存储中的 bucket 名称 |
ObjectKey | String | 存储的文件路径 |
Height | Int | 图片高度,单位像素 |
Width | Int | 图片宽度,单位像素 |
Format | String | 录制格式 |
TimeStamp | Int | 截图时间,Unix 时间 |
AccountId | Sting | 账号 ID |
ImageXURI | String | 截图存储在 ImageX 时,veImageX 为图片分配的资源 URI |
ServiceID | String | 截图存储在 veImageX 时,veImageX 的服务 ID |
event_type | String | 事件名,snapshot_event 表示截图事件 |
回调示例如下所示。
{ "Vhost": "push.example.com", "Domain": "push.example.com", "App": "live", "Stream": "stream_1234", "Bucket": "bucket1", "ObjectKey": "push.example.com/live/stream_1234/2022052510115****.jpg", "Height": 1080, "Width": 1920, "Format": "jpg", "TimeStamp": 1653473517, "AccountId": "2000001174", "ImageXURI": "tos-cn-i-exampleid/2022052510115****.jpg", "ServiceID": "exampleid" }
{ "Vhost":"pushrtmp.example.com.", "Domain":"pushrtmp.example.com", "App":"live", "Stream":"stream_1234", "Bucket":"bucket1", "ObjectKey":"pushp.example.com/live/20211****.jpeg", "Height":864, "Width":480, "Format":"jpeg", "TimeStamp":1640849845, "AccountId":"10000" }
字段 | 类型 | 说明 |
---|---|---|
action | String | 事件。
|
event_time | Int | 事件的时间,Unix 时间戳,单位为 ns,例如,1650263223542095385 |
task_id | String | 创建的任务 ID |
src | String | 视频来源的流地址 |
dst | String | 推流地址 |
type | Int | 类型。
|
cycle_mode | Int | 点播文件的循环方式。 |
event_type | String | 事件名,live_pull_to_push 表示拉流转推事件 |
{ "action":"vod_start", "event_time":1650263223542095385, "task_id":"5f4c37605b7d711b51e28d73fa60****", "src":"http://test.com/test/test.m3u8", "dst":"rtmp://testpush/test/teststream", "type":1, "cycle_mode":-1 }
字段 | 类型 | 说明 |
---|---|---|
vhost | String | 域名空间名称 |
Domain | String | 推流域名 |
App | String | 应用名称 |
Stream | String | 流名称 |
EventType | String | 事件类型,默认为 scan_screenshoot_event ,表示审核截图事件 |
EventData | EventData | 事件详情 |
EventTime | String | 事件产生时间,RFC3339 格式的 UTC 时间。单位为 s |
EventId | string | 事件 ID,用于事件去重 |
参数名 | 类型 | 描述 |
---|---|---|
MediaType | Int | 可能违规的内容类型。截图审核的默认取值为 1,表示直播截图。 |
Image | String | 审核截图保存的 uri,根据您配置的审核规则,返回截图在 TOS、veImageX 中的存储路径 |
HitLabels | Array of String | 截图的违规原因。支持以下取值。
|
RiskHit | Array of Risk | 命中的违规列表 |
RiskALL | Array of Risk | 已配置的所有模型列表 |
Decision | String | 根据违规命中情况,给出的操作建议。支持的取值与含义如下所示。
|
AIResultOrigin | String | 审核平台返回的响应原数据。 |
参数名 | 类型 | 描述 |
---|---|---|
Label | String | 截图命中的违规类型标签。支持以下取值。
|
Sublabel | String | 截图命中的违规子类型标签。 |
Decision | String | 根据违规命中情况,给出的操作建议。支持的取值与含义如下所示。
|
{ "Vhost": "example.com", "Domain": "example.com", "App": "live", "Stream": "stream1", "EventType": "scan_screenshoot_event", "EventData": { "MediaType": 1, "Image": "/liveexample/tob****01/stream**/1659079720209.jpg", "HitLabels": [ "301" ], "RiskHit": [ { "Label": "301", "SubLabel": "301001", "Decision": "BLOCK" }, { "Label": "301", "SubLabel": "301002", "Decision": "BLOCK" } ], "RiskALL": [ { "Label": "301", "SubLabel": "301001", "Decision": "BLOCK" }, { "Label": "301", "SubLabel": "301002", "Decision": "BLOCK" } ], "Decision": "BLOCK", "AIResultOrigin": "{\"RequestId\":\"202207291528410102091561590F291DAA\",\"Code\":0,\"Message\":\"success\",\"Data\":{\"DataId\":\"7125691570795811116\",\"Decision\":\"BLOCK\",\"Results\":[{\"Label\":\"301\",\"SubLabel\":\"301001\",\"Decision\":\"BLOCK\",\"score\":0,\"Detail\":null,\"Frames\":null},{\"Label\":\"301\",\"SubLabel\":\"301002\",\"Decision\":\"BLOCK\",\"score\":0,\"Detail\":null,\"Frames\":null}],\"Scores\":null}}" }, "EventTime": "2022-07-29T15:28:40+08:00", "EventId": "71256915707958766**", "CallbackURL": [ "http://example.com/callback/scan_screenshoot" ] }
errmsg | 说明 |
---|---|
func:OnStatus:func:RtmpStatusCode2NssError:duplicate | 重复推流 |
param:nssSession:duplicate | 重复推流 |
func:OnStatus:func:RtmpStatusCode2NssError:not_allowed | 推流被禁 |
func:conn.Read:eof | 推流断开连接 |
func:conn.Read:net:timeout | 读数据超时 |
func:conn.Read:net:broken_pipe | 推流断开连接 |
func:OnStop:eof | 推流结束 |
func:conn.Read:net:peer_going_away | 推流断开连接 |
func:OnStatus:func:rtmpStatusCode2NssError:api_close | API 关闭流 |
func:conn.Read:net:deadline_exceeded | 读数据超时 |
func:Validate:param:Name:invalid | 流名不合法 |
func:conn.Read:net:conn_reset_by_peer | 推流断开连接 |
func:timeout:idle_too_long | 长时间没收到数据 |
func::done | 未知原因 |
func:HandleInputPacket:net:func:Input: rtmp:invalid_rtmp_type | rtmp 协议解析失败 |
func:HandleInputPacket:net:func:Input: rtmp: FLV Signature don't match | flv 协议解析失败 |
func:JudgePublishAuth:param:MissParam:invalid_sign | 推流鉴权参数不存在 |
func:JudgePublishAuth:access:disable | Domain 不合法 |
param:uniqueSinkMap:duplicate | 重复推流 |
func:Validate:param:App:invalid | App 不合法 |
param:group.Type:cancel | 转推失败 |
stream:idle_too_long | 长时间没收到数据 |
func:HandleInputPacket:net:func:Input: rtmp:invalid_chunk_size | rtmp 协议解析失败 |