live-stream.md 23 KB

文档

管理后台

Live Stream 管理

获取 Live Stream 列表(分页)

维护人:TG Live

URL

描述:获取 Live Stream 列表(分页)

ContentType:application/json

请求参数

Body Parameter
名称 类型 必填 最大长度 描述 示例值
page Integer - 页码 (从 1 开始) 1
size Integer - 每页条数 10
keyword String - 搜索关键词 (模糊匹配名称、ID 等) 摄像头
enabled Boolean - 启用状态过滤 (null=全部, true=启用, false=禁用) true
sortBy String - 排序字段 createdAt
sortDir String - 排序方向 (ASC/DESC) DESC

请求示例

{
    "page": 1,
    "size": 10,
    "keyword": "摄像头",
    "enabled": true,
    "sortBy": "createdAt",
    "sortDir": "DESC"
}

响应参数

响应示例

{
    "success": true,
    "errCode": "string",
    "errMessage": "string",
    "data": {
        "list": [
            {
                "id": 1,
                "streamSn": "stream_1705823456789_0001",
                "name": "测试推流-001",
                "lssId": "lss-machine_001",
                "cameraId": "CAM-069",
                "channelId": 1,
                "pushMethod": "ffmpeg",
                "commandTemplate": "string",
                "timeoutSeconds": 30,
                "status": "IDLE",
                "enabled": true,
                "remark": "测试备注",
                "createdAt": "2024-01-21T10:00:00",
                "updatedAt": "2024-01-21T10:00:00"
            }
        ],
        "page": 1,
        "size": 10,
        "total": 100,
        "totalPages": 10,
        "hasNext": true,
        "hasPrevious": false
    }
}

错误码

获取全部 Live Stream 列表(不分页)

维护人:TG Live

URL

描述:获取全部 Live Stream 列表(不分页)

ContentType:application/x-www-form-urlencoded;charset=UTF-8

请求参数

响应参数

名称 类型 必填 最大长度 描述 示例值
success Boolean - 请求是否成功 true
errCode String - 错误码(失败时返回)
errMessage String - 错误信息(失败时返回)
data object 响应数据 (ActualType: PageResponse)
└ list List 数据列表 (ActualType: T)
└ id Long - 主键 ID 1
└ streamSn String - 推流流水号 stream_1705823456789_0001
└ name String - 名称 测试推流-001
└ lssId String - 关联 LSS 节点 ID lss-machine_001
└ cameraId String - 关联摄像头 ID CAM-069
└ channelId Long - 关联推流通道 ID 1
└ pushMethod String - 推流方式: ffmpeg ffmpeg
└ commandTemplate String - FFmpeg 命令模板
└ timeoutSeconds Integer - 超时时间(秒) 30
└ status String - 推流状态: IDLE / STREAMING / STOPPED / ERROR IDLE
└ enabled Boolean - 是否启用 true
└ remark String - 备注 测试备注
└ createdAt LocalDateTime - 创建时间 2024-01-21T10:00:00
└ updatedAt LocalDateTime - 更新时间 2024-01-21T10:00:00
└ page Integer - 当前页码 (从 1 开始) 1
└ size Integer - 每页条数 10
└ total Long - 总记录数 100
└ totalPages Integer - 总页数 10
└ hasNext Boolean - 是否有下一页 true
└ hasPrevious Boolean - 是否有上一页 false
名称 类型 必填 最大长度 描述 示例值
success Boolean - 请求是否成功 true
errCode String - 错误码(失败时返回)
errMessage String - 错误信息(失败时返回)
data array 响应数据 (ActualType: List)
└ id Long - 主键 ID 1
└ streamSn String - 推流流水号 stream_1705823456789_0001
└ name String - 名称 测试推流-001
└ lssId String - 关联 LSS 节点 ID lss-machine_001
└ cameraId String - 关联摄像头 ID CAM-069
└ channelId Long - 关联推流通道 ID 1
└ pushMethod String - 推流方式: ffmpeg ffmpeg
└ commandTemplate String - FFmpeg 命令模板
└ timeoutSeconds Integer - 超时时间(秒) 30
└ status String - 推流状态: IDLE / STREAMING / STOPPED / ERROR IDLE
└ enabled Boolean - 是否启用 true
└ remark String - 备注 测试备注
└ createdAt LocalDateTime - 创建时间 2024-01-21T10:00:00
└ updatedAt LocalDateTime - 更新时间 2024-01-21T10:00:00

响应示例

{
    "success": true,
    "errCode": "string",
    "errMessage": "string",
    "data": [
        {
            "id": 1,
            "streamSn": "stream_1705823456789_0001",
            "name": "测试推流-001",
            "lssId": "lss-machine_001",
            "cameraId": "CAM-069",
            "channelId": 1,
            "pushMethod": "ffmpeg",
            "commandTemplate": "string",
            "timeoutSeconds": 30,
            "status": "IDLE",
            "enabled": true,
            "remark": "测试备注",
            "createdAt": "2024-01-21T10:00:00",
            "updatedAt": "2024-01-21T10:00:00"
        }
    ]
}

错误码

根据 LSS ID 获取 Live Stream 列表

维护人:TG Live

URL

描述:根据 LSS ID 获取 Live Stream 列表

ContentType:application/x-www-form-urlencoded;charset=UTF-8

请求参数

Query Parameter
名称 类型 必填 最大长度 描述 示例值
lssId string - LSS 节点 ID lss-machine_001

响应参数

名称 类型 必填 最大长度 描述 示例值
success Boolean - 请求是否成功 true
errCode String - 错误码(失败时返回)
errMessage String - 错误信息(失败时返回)
data array 响应数据 (ActualType: List)
└ id Long - 主键 ID 1
└ streamSn String - 推流流水号 stream_1705823456789_0001
└ name String - 名称 测试推流-001
└ lssId String - 关联 LSS 节点 ID lss-machine_001
└ cameraId String - 关联摄像头 ID CAM-069
└ channelId Long - 关联推流通道 ID 1
└ pushMethod String - 推流方式: ffmpeg ffmpeg
└ commandTemplate String - FFmpeg 命令模板
└ timeoutSeconds Integer - 超时时间(秒) 30
└ status String - 推流状态: IDLE / STREAMING / STOPPED / ERROR IDLE
└ enabled Boolean - 是否启用 true
└ remark String - 备注 测试备注
└ createdAt LocalDateTime - 创建时间 2024-01-21T10:00:00
└ updatedAt LocalDateTime - 更新时间 2024-01-21T10:00:00

响应示例

{
    "success": true,
    "errCode": "string",
    "errMessage": "string",
    "data": [
        {
            "id": 1,
            "streamSn": "stream_1705823456789_0001",
            "name": "测试推流-001",
            "lssId": "lss-machine_001",
            "cameraId": "CAM-069",
            "channelId": 1,
            "pushMethod": "ffmpeg",
            "commandTemplate": "string",
            "timeoutSeconds": 30,
            "status": "IDLE",
            "enabled": true,
            "remark": "测试备注",
            "createdAt": "2024-01-21T10:00:00",
            "updatedAt": "2024-01-21T10:00:00"
        }
    ]
}

错误码

获取 Live Stream 详情

维护人:TG Live

URL

描述:获取 Live Stream 详情

ContentType:application/x-www-form-urlencoded;charset=UTF-8

请求参数

Query Parameter
名称 类型 必填 最大长度 描述 示例值
id int64 - 主键 ID 1

响应参数

名称 类型 必填 最大长度 描述 示例值
success Boolean - 请求是否成功 true
errCode String - 错误码(失败时返回)
errMessage String - 错误信息(失败时返回)
data object 响应数据 (ActualType: LiveStreamInfoDTO)
└ id Long - 主键 ID 1
└ streamSn String - 推流流水号 stream_1705823456789_0001
└ name String - 名称 测试推流-001
└ lssId String - 关联 LSS 节点 ID lss-machine_001
└ cameraId String - 关联摄像头 ID CAM-069
└ channelId Long - 关联推流通道 ID 1
└ pushMethod String - 推流方式: ffmpeg ffmpeg
└ commandTemplate String - FFmpeg 命令模板
└ timeoutSeconds Integer - 超时时间(秒) 30
└ status String - 推流状态: IDLE / STREAMING / STOPPED / ERROR IDLE
└ enabled Boolean - 是否启用 true
└ remark String - 备注 测试备注
└ createdAt LocalDateTime - 创建时间 2024-01-21T10:00:00
└ updatedAt LocalDateTime - 更新时间 2024-01-21T10:00:00

响应示例

{
    "success": true,
    "errCode": "string",
    "errMessage": "string",
    "data": {
        "id": 1,
        "streamSn": "stream_1705823456789_0001",
        "name": "测试推流-001",
        "lssId": "lss-machine_001",
        "cameraId": "CAM-069",
        "channelId": 1,
        "pushMethod": "ffmpeg",
        "commandTemplate": "string",
        "timeoutSeconds": 30,
        "status": "IDLE",
        "enabled": true,
        "remark": "测试备注",
        "createdAt": "2024-01-21T10:00:00",
        "updatedAt": "2024-01-21T10:00:00"
    }
}

错误码

根据 stream sn 获取详情

维护人:TG Live

URL

描述:根据 stream sn 获取详情

ContentType:application/x-www-form-urlencoded;charset=UTF-8

请求参数

Query Parameter
名称 类型 必填 最大长度 描述 示例值
streamSn string - 推流流水号 stream_1705823456789_0001

响应参数

名称 类型 必填 最大长度 描述 示例值
success Boolean - 请求是否成功 true
errCode String - 错误码(失败时返回)
errMessage String - 错误信息(失败时返回)
data object 响应数据 (ActualType: LiveStreamInfoDTO)
└ id Long - 主键 ID 1
└ streamSn String - 推流流水号 stream_1705823456789_0001
└ name String - 名称 测试推流-001
└ lssId String - 关联 LSS 节点 ID lss-machine_001
└ cameraId String - 关联摄像头 ID CAM-069
└ channelId Long - 关联推流通道 ID 1
└ pushMethod String - 推流方式: ffmpeg ffmpeg
└ commandTemplate String - FFmpeg 命令模板
└ timeoutSeconds Integer - 超时时间(秒) 30
└ status String - 推流状态: IDLE / STREAMING / STOPPED / ERROR IDLE
└ enabled Boolean - 是否启用 true
└ remark String - 备注 测试备注
└ createdAt LocalDateTime - 创建时间 2024-01-21T10:00:00
└ updatedAt LocalDateTime - 更新时间 2024-01-21T10:00:00

响应示例

{
    "success": true,
    "errCode": "string",
    "errMessage": "string",
    "data": {
        "id": 1,
        "streamSn": "stream_1705823456789_0001",
        "name": "测试推流-001",
        "lssId": "lss-machine_001",
        "cameraId": "CAM-069",
        "channelId": 1,
        "pushMethod": "ffmpeg",
        "commandTemplate": "string",
        "timeoutSeconds": 30,
        "status": "IDLE",
        "enabled": true,
        "remark": "测试备注",
        "createdAt": "2024-01-21T10:00:00",
        "updatedAt": "2024-01-21T10:00:00"
    }
}

错误码

添加 Live Stream

维护人:TG Live

URL

描述:添加 Live Stream

ContentType:application/json

请求参数

Body Parameter
名称 类型 必填 最大长度 描述 示例值
name String - 名称 测试推流-001
lssId String - 关联 LSS 节点 ID lss-machine_001
cameraId String - 关联摄像头 ID CAM-069
channelId Long - 关联推流通道 ID 1
pushMethod String - 推流方式: ffmpeg ffmpeg
commandTemplate String - FFmpeg 命令模板 /usr/local/ffmpeg-whip/bin/ffmpeg -rtsp_transport tcp -i {RTSP_URL} ...
timeoutSeconds Integer - 超时时间(秒) 30
remark String - 备注 测试备注

请求示例

{
    "name": "测试推流-001",
    "lssId": "lss-machine_001",
    "cameraId": "CAM-069",
    "channelId": 1,
    "pushMethod": "ffmpeg",
    "commandTemplate": "/usr/local/ffmpeg-whip/bin/ffmpeg -rtsp_transport tcp -i {RTSP_URL} ...",
    "timeoutSeconds": 30,
    "remark": "测试备注"
}

响应参数

名称 类型 必填 最大长度 描述 示例值
success Boolean - 请求是否成功 true
errCode String - 错误码(失败时返回)
errMessage String - 错误信息(失败时返回)
data object 响应数据 (ActualType: LiveStreamInfoDTO)
└ id Long - 主键 ID 1
└ streamSn String - 推流流水号 stream_1705823456789_0001
└ name String - 名称 测试推流-001
└ lssId String - 关联 LSS 节点 ID lss-machine_001
└ cameraId String - 关联摄像头 ID CAM-069
└ channelId Long - 关联推流通道 ID 1
└ pushMethod String - 推流方式: ffmpeg ffmpeg
└ commandTemplate String - FFmpeg 命令模板
└ timeoutSeconds Integer - 超时时间(秒) 30
└ status String - 推流状态: IDLE / STREAMING / STOPPED / ERROR IDLE
└ enabled Boolean - 是否启用 true
└ remark String - 备注 测试备注
└ createdAt LocalDateTime - 创建时间 2024-01-21T10:00:00
└ updatedAt LocalDateTime - 更新时间 2024-01-21T10:00:00

响应示例

{
    "success": true,
    "errCode": "string",
    "errMessage": "string",
    "data": {
        "id": 1,
        "streamSn": "stream_1705823456789_0001",
        "name": "测试推流-001",
        "lssId": "lss-machine_001",
        "cameraId": "CAM-069",
        "channelId": 1,
        "pushMethod": "ffmpeg",
        "commandTemplate": "string",
        "timeoutSeconds": 30,
        "status": "IDLE",
        "enabled": true,
        "remark": "测试备注",
        "createdAt": "2024-01-21T10:00:00",
        "updatedAt": "2024-01-21T10:00:00"
    }
}

错误码

更新 Live Stream

维护人:TG Live

URL

描述:更新 Live Stream

ContentType:application/json

请求参数

Body Parameter
名称 类型 必填 最大长度 描述 示例值
id Long - 主键 ID 1
name String - 名称 测试推流-001
lssId String - 关联 LSS 节点 ID lss-machine_001
cameraId String - 关联摄像头 ID CAM-069
channelId Long - 关联推流通道 ID 1
pushMethod String - 推流方式: ffmpeg ffmpeg
commandTemplate String - FFmpeg 命令模板
timeoutSeconds Integer - 超时时间(秒) 30
enabled Boolean - 是否启用 true
remark String - 备注 测试备注

请求示例

{
    "id": 1,
    "name": "测试推流-001",
    "lssId": "lss-machine_001",
    "cameraId": "CAM-069",
    "channelId": 1,
    "pushMethod": "ffmpeg",
    "commandTemplate": "string",
    "timeoutSeconds": 30,
    "enabled": true,
    "remark": "测试备注"
}

响应参数

名称 类型 必填 最大长度 描述 示例值
success Boolean - 请求是否成功 true
errCode String - 错误码(失败时返回)
errMessage String - 错误信息(失败时返回)
data object 响应数据 (ActualType: LiveStreamInfoDTO)
└ id Long - 主键 ID 1
└ streamSn String - 推流流水号 stream_1705823456789_0001
└ name String - 名称 测试推流-001
└ lssId String - 关联 LSS 节点 ID lss-machine_001
└ cameraId String - 关联摄像头 ID CAM-069
└ channelId Long - 关联推流通道 ID 1
└ pushMethod String - 推流方式: ffmpeg ffmpeg
└ commandTemplate String - FFmpeg 命令模板
└ timeoutSeconds Integer - 超时时间(秒) 30
└ status String - 推流状态: IDLE / STREAMING / STOPPED / ERROR IDLE
└ enabled Boolean - 是否启用 true
└ remark String - 备注 测试备注
└ createdAt LocalDateTime - 创建时间 2024-01-21T10:00:00
└ updatedAt LocalDateTime - 更新时间 2024-01-21T10:00:00

响应示例

{
    "success": true,
    "errCode": "string",
    "errMessage": "string",
    "data": {
        "id": 1,
        "streamSn": "stream_1705823456789_0001",
        "name": "测试推流-001",
        "lssId": "lss-machine_001",
        "cameraId": "CAM-069",
        "channelId": 1,
        "pushMethod": "ffmpeg",
        "commandTemplate": "string",
        "timeoutSeconds": 30,
        "status": "IDLE",
        "enabled": true,
        "remark": "测试备注",
        "createdAt": "2024-01-21T10:00:00",
        "updatedAt": "2024-01-21T10:00:00"
    }
}

错误码

删除 Live Stream

维护人:TG Live

URL

描述:删除 Live Stream

ContentType:application/x-www-form-urlencoded;charset=UTF-8

请求参数

Query Parameter
名称 类型 必填 最大长度 描述 示例值
id int64 - 主键 ID 1

响应参数

名称 类型 必填 最大长度 描述 示例值
success Boolean - 请求是否成功 true
errCode String - 错误码(失败时返回)
errMessage String - 错误信息(失败时返回)
data object - 响应数据 (ActualType: Void)

响应示例

{
    "success": true,
    "errCode": "string",
    "errMessage": "string",
    "data": {}
}

错误码

批量删除 Live Stream

维护人:TG Live

URL

描述:批量删除 Live Stream

ContentType:application/json

请求参数

Body Parameter
名称 类型 必填 最大长度 描述 示例值
ids array - ID 列表,[array of int64] [1,2,3]

请求示例

{
    "ids": [
        1,
        2,
        3
    ]
}

响应参数

名称 类型 必填 最大长度 描述 示例值
success Boolean - 请求是否成功 true
errCode String - 错误码(失败时返回)
errMessage String - 错误信息(失败时返回)
data int32 - 响应数据 (ActualType: Integer)

响应示例

{
    "success": true,
    "errCode": "string",
    "errMessage": "string",
    "data": 0
}

错误码