LiveGBS国标GB/T28181前端设备录像历史视音频回放下载接口调用说明
程序员文章站
2022-03-17 14:13:08
...
前端设备录像
1、什么是前端设备录像
录像存储在国标设备端,如:DVR:数字硬盘录像机(DigitalVideoRecorder),NVR:网络硬盘录像机(NetworkVideoRecorder)上。再通过GB28181注册到国标平台,国标平台根据协议回看设备上的历史音视频
2、GB28181回看步骤
2.1、设备视音频文件检索
2.2、历史视音频回放
3、前端设备录像接口
-
查询录像列表
-
开始回放
-
回放流保活
-
回放流停止
-
回放控制
-
回放流列表
-
单条回放流信息
4、下载设备录像示例
4.1、WEB页面操作
4.1.1、设备录像界面
4.1.2、开始下载
- 可以点击调整倍速
4.1.3、停止下载
4.1.4、另存下载完成的录像
停止下载后,录制的文件会弹出另存为。
4.2、接口操作
这里部署国标平台后服务接口地址示例为: http://192.168.2.135:10000
4.2.1、调用开始回放接口
http://192.168.2.135:10000/api/v1/playback/start?serial=34020000001110000234&code=34020000001320000234&starttime=2020-08-04T00%3A00%3A00&endtime=2020-08-04T01%3A00%3A01&download=true
返回示例:
{
"AudioEnable": false,
"CDN": "",
"CascadeSize": 0,
"ChannelCustomName": "演示",
"ChannelID": "34020000001320000234",
"ChannelName": "演示",
"DeviceID": "34020000001110000234",
"Duration": 1,
"FLV": "",
"HLS": "",
"InBitRate": 0,
"InBytes": 0,
"NumOutputs": 0,
"Ondemand": false,
"OutBytes": 0,
"PlaybackDuration": 3601,
"PlaybackFileURL": "http://192.168.2.135:10000/sms/34020000002020000001/api/v1/downloads/34020000001110000234_34020000001320000234_1200000008.mp4",
"Progress": 0,
"RTMP": "",
"RTSP": "",
"RecordStartAt": "",
"SnapURL": "",
"SourceAudioCodecName": "",
"SourceAudioSampleRate": 0,
"SourceVideoCodecName": "",
"SourceVideoFrameRate": 0,
"SourceVideoHeight": 0,
"SourceVideoWidth": 0,
"StartAt": "2020-08-04 10:08:15",
"StreamID": "download:34020000001110000234:34020000001320000234:1200000008",
"TimestampSec": 0,
"Transport": "TCP",
"WS_FLV": ""
}
4.2.2、调用回放控制接口(可选调节下载倍速)
http://192.168.2.135:10000/api/v1/playback/control?streamid=download%3A34020000001110000234%3A34020000001320000234%3A1200000008&command=scale&scale=2
返回示例:
"OK"
4.2.3、调用回放流停止接口
http://192.168.2.135:10000/api/v1/playback/stop?streamid=download%3A34020000001110000234%3A34020000001320000234%3A1200000008
返回示例:
{
"PlaybackFileURL": "http://192.168.2.135:10000/sms/34020000002020000001/api/v1/downloads/34020000001110000234_34020000001320000234_1200000008.mp4"
}
5、GB28181流媒体服务搭建
支持 Windows|Linux 64 位系统环境,支持内网、私有云部署