附录
Aidstream配置文件
当使用接口int start_stream(string stream_id, GetImageCB &cb)的时候,可根据配置文件/usr/local/share/aidstream-gst/conf/aidstream-gst.conf来配置输入输出流。 具体要求如下:
- 配置文件为json格式。
- 标注为必选参数,则必须配置。
- 参数大小写敏感。
配置文件整体结构:
json
{
"streams": [ // 根键,流配置数组
{
"streamsId": "1", // 流级:流唯一标识
"properties": { // 属性级:流的具体配置参数
"inputType": "rtsp",
...
}
}
]
}各层级参数说明:
| 层级 | 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| 根 | streams | array | 是 | 流配置数组 |
| 流级 | streamsId | string | 是 | stream id,唯一标识一组流配置 |
| 属性级 | inputType | string | 是 | 输入流的协议类型。支持:rtsp / rtmp / file / usbcam / splice |
| 属性级 | inputAddr | string | 是 | 输入流的地址(usbcam / splice 可省略) |
| 属性级 | outputType | string | 是 | 输出流的协议类型。支持:rtsp / wayland / mp4 / empty(empty 输出到 fakesink) |
| 属性级 | outputAddr | string | 是 | 输出流的地址 |
| 属性级 | decodeType | string | 否 | 硬解码格式。支持:H264 / H265。默认 H264 |
| 属性级 | encodeType | string | 否 | 硬编码格式。支持:H264 / H265。默认 H264 |
bash
<视频输入源> (例如rtsp://admin:aidlux123@192.168.110.234:554)
<视频输出推流> (例如rtsp://192.168.111.115:8554)
**💡💡注意💡💡**
请根据自己的ip地址进行配置配置文件参考内容:
json
{
"streams": [
{
"streamsId": "1",
"properties": {
"inputType": "rtsp",
"inputAddr": "<视频输入源>/h264/ch1/main/av_stream",
"outputType": "rtsp",
"outputAddr": "<视频输出推流>/aidstream-gst-rtsp-test-1",
"decodeType": "H264",
"encodeType": "H264"
}
},
{
"streamsId": "2",
"properties": {
"inputType": "file",
"inputAddr": "./test_kobe.mp4",
"outputType": "rtsp",
"outputAddr": "<视频输出推流>/aidstream-gst-rtsp-test-2",
"decodeType": "H264",
"encodeType": "H264"
}
},
{
"streamsId": "3",
"properties": {
"inputType": "rtmp",
"inputAddr": "<视频输入源>/live/stream",
"outputType": "rtsp",
"outputAddr": "<视频输出推流>/aidstream-gst-rtmp-test-3",
"decodeType": "H264",
"encodeType": "H264"
}
},
{
"streamsId": "4",
"properties": {
"inputType": "file",
"inputAddr": "./test_kobe.mp4",
"outputType": "wayland",
"outputAddr": "",
"decodeType": "H264",
"encodeType": "H264"
}
},
{
"streamsId": "5",
"properties": {
"inputType": "rtsp",
"inputAddr": "<视频输入源>/h264/ch1/main/av_stream",
"outputType": "rtsp",
"outputAddr": "<视频输出推流>/aidstream-gst-rtsp-test-5",
"decodeType": "H265",
"encodeType": "H265"
}
}
]
}