视频编码器在线文档

视频编码器在线文档


推流器接口文档

<h1><center><strong>推流器接口文档</strong></center></h1> <p>此开发接口的技术支持需要额外付费!! 假设设备序列号是cb00a8fe73ac6e8da63ea57a1c5f4785,客户远程配置服务器域名为xstrive.com</p> <p>参数说明 command 命令字,代表不通种类的操作 channel 需要操作的通道号,从0开始 value 命令字对应的值(有的value是base64加密的,需注意接口的详细描述) auth 是用户名+密码的md5值,必须使用小写。假设用户名是admin 密码是admin 那么 userAuth = md5(“adminadmin”) 设置rtmp推流开启或者关闭 1.开启通道1的rtmp推送(命令字 live_control) <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=live_control&channel=0&value=start&auth=userAuth">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=live_control&channel=0&value=start&auth=userAuth</a></p> <p>2.关闭通道1的rtmp推送(命令字 live_control) <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=live_control&channel=0&value=stop&auth=userAuth">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=live_control&channel=0&value=stop&auth=userAuth</a></p> <p>备注:userAuth 是用户名+密码的md5值,假设用户名是admin 密码是admin 那么 userAuth = md5(“adminadmin”) channel 是从0 开始的 设置rtsp推送开启或者关闭 1.开启通道1的rtsp推送 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=rtsp_enable_control&channel=0&value=start&auth=userAuth">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=rtsp_enable_control&channel=0&value=start&auth=userAuth</a></p> <p>2.关闭通道1的rtsp推送 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=rtsp_enable_control&channel=0&value=stop&auth=userAuth">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=rtsp_enable_control&channel=0&value=stop&auth=userAuth</a></p> <p>备注:auth后面接的验证是md5加密后的用户名密码的字符串,例如md5(usernamepasswd) 设置rtmp推流地址:这里假设通道数为32 1.设置通道1的rtmp1推流地址 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=set_live_url&channel=0&value=base64(rtmp://xxxxx/test/stream1)&auth=userAuth">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=set_live_url&channel=0&value=base64(rtmp://xxxxx/test/stream1)&auth=userAuth</a> 备注:rtmp地址需要用base64加密后添加到请求中,例如base64(rtmp://xxxx/app/stream) auth后面接的验证是md5加密后的用户名密码的字符串,例如md5(usernamepasswd) channel是从0开始的 设置rtsp拉流地址 1.设置通道1的rtsp推送地址 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=set_live_rtsp&channel=0&value=base64(rtsp://xxxx/app/test)&auth=userAuth&user=admin&pass=123456">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=set_live_rtsp&channel=0&value=base64(rtsp://xxxx/app/test)&auth=userAuth&user=admin&pass=123456</a> 备注:rtsp地址需要用base64加密后添加到请求中,例如base64(rtsp://xxxx/app/stream) auth后面接的验证是md5加密后的用户名密码的字符串,例如md5(usernamepasswd) user 是摄像头访问用户名,pass是摄像头访问密码 如果rtsp视频流不需要用户名密码,那么直接留空,例如 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=set_live_rtsp&channel=0&value=base64(rtsp://xxxx/app/test)&auth=userAuth&user=&pass">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=set_live_rtsp&channel=0&value=base64(rtsp://xxxx/app/test)&auth=userAuth&user=&pass</a>= 注意: rtsp地址中不应包含用户名密码。 设置示例: 推流器账户默认为admin/admin,ip为192.168.0.15,rtmp推流地址为rtmp://live.hkstv.hk.lxdns.com/live/hks1, rtsp拉流地址为rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov auth是md5加密(usernamepassword),这里是md5加密(adminadmin)为 f6fdffe48c908deb0f4c3bd36c032e72 rtmp地址base64加密(rtmp://xxx),这里rtmp地址为 cnRtcCUzQS8vbGl2ZS5oa3N0di5oay5seGRucy5jb20vbGl2ZS9oa3Mx rtsp地址base64加密(rtsp://xxx),这里rtsp地址为 cnRzcCUzQS8vMTg0LjcyLjIzOS4xNDkvdm9kL21wNCUzQS8vQmlnQnVja0J1bm55XzE3NWsubW92 通过接口启动通道1的rtmp功能 <a href="http://192.168.0.15/control?command=live_control&channel=0&value=start&auth=f6fdffe48c908deb0f4c3bd36c032e72">http://192.168.0.15/control?command=live_control&channel=0&value=start&auth=f6fdffe48c908deb0f4c3bd36c032e72</a> 通过接口启动通道1的rtsp功能 <a href="http://192.168.0.15/control?command=rtsp_enable_control&channel=0&value=start&auth=f6fdffe48c908deb0f4c3bd36c032e72">http://192.168.0.15/control?command=rtsp_enable_control&channel=0&value=start&auth=f6fdffe48c908deb0f4c3bd36c032e72</a> 通过接口设置通道1的rtmp地址 <a href="http://192.168.0.15/control?command=set_live_url&channel=0&value=cnRtcCUzQS8vbGl2ZS5oa3N0di5oay5seGRucy5jb20vbGl2ZS9oa3Mx&auth=f6fdffe48c908deb0f4c3bd36c032e72">http://192.168.0.15/control?command=set_live_url&channel=0&value=cnRtcCUzQS8vbGl2ZS5oa3N0di5oay5seGRucy5jb20vbGl2ZS9oa3Mx&auth=f6fdffe48c908deb0f4c3bd36c032e72</a> 通过接口设置通道1的rtsp地址 <a href="http://192.168.0.15/control?command=set_live_rtsp&channel=0&value=cnRzcCUzQS8vMTg0LjcyLjIzOS4xNDkvdm9kL21wNCUzQS8vQmlnQnVja0J1bm55XzE3NWsubW92&auth=f6fdffe48c908deb0f4c3bd36c032e72&user=admin&pass=123456">http://192.168.0.15/control?command=set_live_rtsp&channel=0&value=cnRzcCUzQS8vMTg0LjcyLjIzOS4xNDkvdm9kL21wNCUzQS8vQmlnQnVja0J1bm55XzE3NWsubW92&auth=f6fdffe48c908deb0f4c3bd36c032e72&user=admin&pass=123456</a> 设置用户名和密码 1.设置用户名及密码 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=set_user_info&user=newusername&pass=newpass&value=1&auth=userAuth">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=set_user_info&user=newusername&pass=newpass&value=1&auth=userAuth</a> <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=set_user_info&user=admin&pass=234567&value=1&auth=a66abb5684c45962d887564f08346e8d">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/control?command=set_user_info&user=admin&pass=234567&value=1&auth=a66abb5684c45962d887564f08346e8d</a> 备注:auth后面接的验证是md5加密后的用户名密码的字符串,例如md5(usernamepasswd) 获取rtmp推送状态 1.获取rtmp1推送状态 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/jsonfile/rtmpstatus">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/jsonfile/rtmpstatus</a> 2.获取rtmp2推送状态 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/jsonfile/rtmpstatus1">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/jsonfile/rtmpstatus1</a> 获取所有配置信息 方法:POST 内容:userAuth 返回:设备的所有配置的json信息 AJAX示例: var auth = userAuth $.ajax({ type:&quot;post&quot;, url:&quot;/getConfig&quot;, data:auth, success:function(data){ jsonobj = data; } }) <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/getConfig">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/getConfig</a><br /> 获取局域网摄像头列表(通过onvif协议,海康摄像头需手动开启onvif) <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/getOnvifDevices">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/getOnvifDevices</a> 返回值样例: {&quot;device&quot;:[{ip:'192.168.0.136'},{ip:'192.168.0.226'},{ip:'192.168.0.67'}]} 其中包含3个摄像头,192.168.0.136,192.168.0.226 和 192.168.0.67 获取摄像头的视频播放地址(RTSP地址) <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/getDeviceRtsp?ip=192.168.0.67&user=admin&pass=admin">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/getDeviceRtsp?ip=192.168.0.67&user=admin&pass=admin</a> 参数说明: ip:摄像头的ip user:摄像头的用户名(onvif账户) pass:摄像头的密码(onvif账户) 返回值说明 {&quot;rtspurl&quot;:[&quot;rtsp://192.168.0.67:554/cam/realmonitor?channel=1&amp;subtype=0&amp;unicast=true&amp;proto=Onvif&quot;,&quot;rtsp://192.168.0.67:554/cam/realmonitor?channel=1&amp;subtype=1&amp;unicast=true&amp;proto=Onvif&quot;]} 此返回值代表该摄像头有2个码流。一般来说,第一个码流是主码流,码率相对比较高,主要做本地录像。第二个码流是辅码流,码率相对较低,主要做互联网传输。 可以将此rtsp地址通过“设置rtsp拉流地址”接口 设置到推流器上。 获取摄像头码流详情 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/setprofile?wtype=1&ip=192.168.0.67&user=admin&pass=YWRtaW4=&index=0">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/setprofile?wtype=1&ip=192.168.0.67&user=admin&pass=YWRtaW4=&index=0</a> 参数说明 wtype:1是获取码流详情 ip:摄像头ip user:摄像头用户名 pass:摄像头密码 base64编码 index:码流序号(0,主码流,1辅码流,和“获取摄像头的视频播放地址(RTSP地址)”接口对应) 返回值示例: {&quot;profile&quot;:[{&quot;profile&quot;:&quot;2&quot;},{&quot;BitrateLimit&quot;:&quot;2048&quot;},{&quot;ConstantBitRate&quot;:&quot;0&quot;},{&quot;ConstantBitRateFlag&quot;:&quot;0&quot;},{&quot;FrameRateLimit&quot;:&quot;20&quot;},{&quot;Height&quot;:&quot;1080&quot;},{&quot;Width&quot;:&quot;1920&quot;}]} 修改摄像头码流详情 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/setprofile?wtype=3&ip=192.168.0.67&user=admin&pass=YWRtaW4=&index=0&encodeType=2&bitrate=2048&constbitrate=0&flag=0&fps=25&height=1080&width=1920">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/setprofile?wtype=3&ip=192.168.0.67&user=admin&pass=YWRtaW4=&index=0&encodeType=2&bitrate=2048&constbitrate=0&flag=0&fps=25&height=1080&width=1920</a> 参数说明 wtype:3是设置码流详情 ip:摄像头ip user:摄像头用户名 pass:摄像头密码 base64编码 index:码流序号(0,主码流,1辅码流,和“获取摄像头的视频播放地址(RTSP地址)”接口对应) encodeType:2代表h264 bitrate:设置码流的波特率,波特率越高,占用的上行带宽越高,图像越清晰 constbitrate:目前必须为0 flag:目前必须为0 fps:视频帧率。 height:视频分辨率高度 width:视频分辨率宽度 ****注意,有些参数摄像头不支持。所以使用此参数设置完成后,需要调用“获取摄像头码流详情”接口来确认参数是否修改成功 控制云台 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/ptz?command=ptz&host=192.168.0.23&usr=admin&pass=1234abcd&value=0&auth=f6fdffe48c908deb0f4c3bd36c032e72">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/ptz?command=ptz&host=192.168.0.23&usr=admin&pass=1234abcd&value=0&auth=f6fdffe48c908deb0f4c3bd36c032e72</a> 参数说明: value<br /> u //上 d //下 l //左 r //右 1 //左上 1 2 //右上 3 //左下 4 //右下 n //zoom in f //zoom out i //focus in o //focus out t //stop focus s //停止转动 host 需要控制的摄像头的ip 老版本录像 在线回放接口 <a href="http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/vod/index.m3u8?command=record&start_time=151805600000&end_time=151819200000&channel=record0">http://cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502/vod/index.m3u8?command=record&start_time=151805600000&end_time=151819200000&channel=record0</a> 参数说明: command有两个值,一个是record,一个是check。 record代表获取指定时间段录像(返回m3u8文件) check代表检查指定时间是否有录像(0代表没有,其他表示有) start_time是起始时间(unix时间戳,ms) end_time是结束时间(unix时间戳,ms) channel是指定通道 下载接口 <a href="http://摄像头ip或远程域名/ts/?command=record&start_time=1575993600000&end_time=1576076400000&channel=record0">http://摄像头ip或远程域名/ts/?command=record&start_time=1575993600000&end_time=1576076400000&channel=record0</a> 参数说明 start_time 为准备下载录像的开始的时间戳 end<em>time. 为准备下载录像的结束的时间戳 (注意时间跨度不要超过8小时,以免文件过大) channel. record0 代表通道1,record1 代表通道2,以此类推 其他字段保留,不可修改 新版本录像 录像列表查询(只支持按天查询) <code>${videoUrl}/api/record/list?beginTime=${beginTimeMs}&amp;endTime=${endTimeMs}&amp;channel=${channel}</code> 请求参数: videoUrl:设备地址 beginTimeMs: 开始时间戳,单位毫秒 endTimeMs: 结束时间戳,单位毫秒 channel:通道号,从0开始 返回参数: mode:flv或者hls, 默认flv。 day: 20211118, 当前日期格式字符串 files: [{dur: 30000, name: 123456789}]. dur: 时长,name: 文件名即当前时间戳毫秒 播放 flv格式播放 请求播放:<code>${videoUrl}/api/record/publish?beginTime=${beginTimeMs}&amp;endTime=${endTimeMs}&amp;channel=${channel}</code> 播放地址:`${videoUrl}/hdl/playback/record${channel}</em>${beginTimeMs}.flv<code> hls格式播放 </code>${videoUrl}/api/record/hls/vod/index.m3u8?start_time=${beginTimeMs}&amp;end_time=${endTimeMs}&amp;channel=${channel}<code> 参数说明 videoUrl: 设备地址 beginTimeMs: 开始毫秒数 endTimeMs:结束毫秒数 channel: 当前通道号,从0开始 下载 单文件下载 </code>${videoUrl}/playbackhls/rec/record${channel}/${playbackDay}/${name}.flv<code> </code>${videoUrl}/playbackhls/rec/record${channel}/${playbackDay}/${name}.ts<code> 区间下载 </code>${videoUrl}/api/record/hls/ts/record.ts?start_time=${beginTimeMs}&amp;end_time=${endTimeMs}&amp;channel=${channel}` 参数说明 videoUrl: 设备地址 beginTimeMs: 开始毫秒数 endTimeMs:结束毫秒数 channel: 当前通道号,从0开始 playbackDay: 当前日期格式字符串如:20211118 name: 文件名,为录像列表返回 files[0].name 录像播放器测试 <a href="http://playback.platform.xstrive.com/vod?address=http://192.168.0.140&username=admin&password=admin&mode=old">http://playback.platform.xstrive.com/vod?address=http://192.168.0.140&username=admin&password=admin&mode=old</a></p> <p>参数说明 mode: old表示旧版,new表示新版本 username: 设备用户名 password:设备密码 address: 设备访问地址 如果是局域网调用 就将例子中的cb00a8fe73ac6e8da63ea57a1c5f4785.cloud.xstrive.com:9502 替换成设备IP,譬如192.168.0.15 BASE64加密参考网站 <a href="http://tool.chinaz.com/Tools/Base64.aspx">http://tool.chinaz.com/Tools/Base64.aspx</a></p>

页面列表

ITEM_HTML