easyrms 接口文档

来源:互联网 发布:淘宝动漫壁纸店铺推荐 编辑:程序博客网 时间:2024/06/10 18:34

easyrms接口文档

easyrms初版主要提供功能:录像,直播点播,资源检索

一.录像

1.开始录像

接口:
http://127.0.0.1:10000/api/v1/startrecord?name=test&url=rtsp://127.0.0.1:8554/live
参数解析:
访问easyrms地址:127.0.0.1:10030
命令标识:startrecord
录像名称:test
录像视频源:rtsp://127.0.0.1:8554/live

2.停止录像

接口:http://127.0.0.1:10030/api/v1/stoprecord?name=test
参数解析:
访问easyrms地址:127.0.0.1:10030
命令标识:stoprecord
录像名称:test

二.rtmp直播

1.开始直播

接口:
http://127.0.0.1:10000/api/v1/startlive?name=test&url=rtsp://127.0.0.1:8554/live
参数解析:
访问easyrms地址:127.0.0.1:10030
命令标识:startlive
录像名称:test
录像视频源:rtsp://127.0.0.1:8554/live

2.停止直播

接口:http://127.0.0.1:10030/api/v1/stoplive?name=test
参数解析:
访问easyrms地址:127.0.0.1:10030
命令标识:stoplive
录像名称:test

三.查询所有正在录像或直播的视频资源

接口:http://127.0.0.1:10030/api/v1/running
参数解析:
访问easyrms地址:127.0.0.1:10030
命令标识:running

四 .直播点播

1.HLS直播

仅仅针对正在录像的视频:默认地址为:*\live.m3u8,可从接口(查询所有正在录像的视频资源)返回信息中获取到。

2.点播

默认地址为:*\record.m3u8
录像的视频和历史资源都可以实现点播

3.rtmp直播

默认格式:rtmp://*

五.检索资源

接口:
http://127.0.0.1:10030/api/v1/list?name=test&begin=20161101000000&end=20171103153045
参数解析:
命令标识:list
检索时间段:begin=20151101000000&end=20151103153045
访问easyrms地址:127.0.0.1:10030
录像名称:test

六.查询服务器信息

http://127.0.0.1:10030/api/v1/getserverinfo
参数解析:
命令标识:getserverinfo
访问easyrms地址:127.0.0.1:10030

七.查询数据库配置

http://127.0.0.1:10030/api/v1/getbaseconfig
参数解析:
命令标识:getbaseconfig
访问easyrms地址:127.0.0.1:10030

八.详细命令交互

1.开始录制

接口:
http://127.0.0.1:10030/api/v1/startrecord?name=test&url=rtsp://127.0.0.1:8554/live
命令反馈:
{
“EasyRMS” : {
“Header” : {
“MessageType” : “MSG_CLI_RMS_STARTRECORD_ACK”,
“Version” : “1.0”
}
}
}

2.停止录像

接口:
http://127.0.0.1:10030/api/v1/stoprecord?name=test
命令反馈:
{
“EasyRMS” : {
“Header” : {
“MessageType” : “MSG_CLI_RMS_STOPRECORD_ACK”,
“Version” : “1.0”
}
}
}

3.开始直播

接口:
http://127.0.0.1:10030/api/v1/startlive?name=test&url=rtsp://127.0.0.1:8554/live
命令反馈:
{
“EasyRMS” : {
“Header” : {
“MessageType” : “MSG_CLI_RMS_STARTLIVE_ACK”,
“Version” : “1.0”
}
}
}

4.停止直播

接口:
http://127.0.0.1:10030/api/v1/stoprecord?name=test
命令反馈:
{
“EasyRMS” : {
“Header” : {
“MessageType” : “MSG_CLI_RMS_STOPLIVE_ACK”,
“Version” : “1.0”
}
}
}

5.查询正在录像或直播的视频资源

接口:
http://127.0.0.1:10030/api/v1/running
命令反馈:注意内部包含了音视频信息及直播点播地址
{
“EasyRMS” : {
“Body” : {
“running” : [
{
“audio” : {
“bitRate” : 0,
“channels” : 2,
“codec” : “aac”,
“sampleRate” : 48000
},
“info” : {
“M3U8Live” : “http://10.0.192.82:81/test/20170803153445/live.m3u8“,
“M3U8Record” : “http://10.0.192.82:81/test/20170803153445/record.m3u8“,
“RTMPLive” : “rtmp://10.0.192.82:1935/live/test”,
“name” : “test”,
“url” : “rtmp://10.0.192.74/live/1”
},
“video” : {
“bitRate” : 0,
“codec” : “h264”,
“frameRate” : 23,
“videoHeight” : 400,
“videoWidth” : 640
}
}
]
},
“Header” : {
“MessageType” : “MSG_CLI_RMS_RECORDING_ACK”,
“Version” : “1.0”
}
}
}

6.检索资源

接口:
http://127.0.0.1:10030/api/v1/list?name=test&begin=20161101000000&end=20171103153045
命令反馈;注意,基于检索后的视频可以通过flash实现m3u8点播
{
“EasyRMS” : {
“Body” : {
“Records” : [
{
“time” : “20170517225938”,
“url” : “http://114.55.107.180:10080/test/20170517225938/record.m3u8”
},
{
“time” : “20170518070420”,
“url” : “http://114.55.107.180:10080/test/20170518070420/record.m3u8”
}
]
},
“Header” : {
“MessageType” : “MSG_CLI_RMS_RECORD_LIST_ACK”,
“Version” : “1.0”
}
}
}

7.查询服务器信息

接口:
http://127.0.0.1:10030/api/v1/getserverinfo
命令反馈:
{
“EasyRMS” : {
“Body” : {
“Hardware” : “x86”,
“InterfaceVersion” : “v1”,
“RunningTime” : “0 Days 0 Hours 2 Mins 2 Secs”,
“Server” : “Server: EasyRMS/1.0.3 (Build/16.0115; Platform/Win32; Release/EasyRMS; State/Development;

)”
},
“Header” : {
“MessageType” : “MSG_CLI_RMS_INFO_ACK”,
“Version” : “1.0”
}
}
}

8.查询数据库配置

接口:
http://127.0.0.1:10030/api/v1/getbaseconfig
反馈:
http://127.0.0.1:10030/api/v1/getbaseconfig
{
“EasyRMS” : {
“Body” : {
“HttpPort” : “10030”,
“HttpRootDir” : “http://114.55.107.180:10080/“,
“RecordDuration” : “120”,
“RecordPath” : “D:\easy\EasyDarwin\nginx\www”,
“TargetDuration” : “10”
},
“Header” : {
“MessageType” : “MSG_CLI_RMS_GETBASECONFIG_ACK”,
“Version” : “1.0”
}
}
}

0 0
原创粉丝点击