基于owt的restful接口

1、创建会议接口

创建会议接口

  • 创建会议接口

请求URL

  • https://192.168.1.123:3006/rooms

请求方式

  • POST

参数

参数名

必选

类型

说明

Content-Type

string

application/json

返回示例

 {

    "mediaIn":{

        "audio":Array[10],

        "video":Array[3]

    },

    "mediaOut":Object{...},

    "transcoding":Object{...},

    "notifying":{

        "participantActivities":true,

        "streamChange":true

    },

    "inputLimit":-1,

    "participantLimit":-1,

    "roles":Array[5],

    "_id":"5fd7167c98ea870760d3be59",

    "name":"NewRoom",

    "views":Array[1],

    "__v":0,

    "id":"5fd7167c98ea870760d3be59"

}

返回参数说明

参数名

类型

说明

id

String

会议id

  • 更多返回错误代码请看首页的错误代码描述

欢迎使用ShowDoc!

2、删除会议接口

欢迎使用ShowDoc!

删除会议房间接口

  • 删除会议房间接口

请求URL

  • https://192.168.1.123:3006/rooms/{roomId}

请求方式

  • Delete

参数

参数名

必选

类型

说明

roomId

string

房间id

返回示例

Room deleted

备注

返回结果为空

  • 更多返回错误代码请看首页的错误代码描述

3、获取所有房间接口

获取所有房间接口

  • 获取所有房间接口

请求URL

  • https://192.168.1.123:3006/rooms

请求方式

  • GET

参数

返回示例

[

    {

        "mediaIn":{

            "audio":Array[10],

            "video":Array[3]

        },

        "mediaOut":Object{...},

        "transcoding":Object{...},

        "notifying":{

            "participantActivities":true,

            "streamChange":true

        },

        "inputLimit":-1,

        "participantLimit":-1,

        "roles":Array[5],

        "_id":"5fd709206c3acf07688fe022",

        "name":"NewRoom",

        "views":Array[1],

        "__v":0,

        "id":"5fd709206c3acf07688fe022"

    },

    {

        "mediaIn":{

            "audio":Array[10],

            "video":Array[3]

        },

        "mediaOut":{

            "video":Object{...},

            "audio":Array[10]

        },

        "transcoding":{

            "video":Object{...},

            "audio":true

        },

        "notifying":{

            "participantActivities":true,

            "streamChange":true

        },

        "inputLimit":-1,

        "participantLimit":-1,

        "roles":Array[5],

        "_id":"5fd7132ca6aa8c0766ea2338",

        "name":"NewRoom",

        "views":[

            Object{...}

        ],

        "__v":0,

        "id":"5fd7132ca6aa8c0766ea2338"

    }

]

返回参数说明

参数名

类型

说明

name

string

房间名称

id

string

房间ID

备注

  • 更多返回错误代码请看首页的错误代码描述

4、加入指定房间

欢迎使用ShowDoc!

简要描述

  • 加入房间接口

加入房间接口

请求方式

  • POST

参数

参数名

必选

类型

说明

room

string

房间id

备注

  • 直接带url加入房间会议。

5、获取所有流的视频流接口

欢迎使用ShowDoc!

简要描述

  • 用户注册接口

请求URL

  • https://192.168.1.123:3006/rooms/{roomId}/streams/

请求方式

  • GET

参数

参数名

必选

类型

说明

roomId

string

房间id

返回示例

 [

    {

        "id":"5fd721cf148f1d058a940ac8-common",

        "type":"mixed",

        "media":{

            "audio":Object{...},

            "video":Object{...}

        },

        "info":{

            "label":"common",

            "activeInput":"260051018178094850",

            "layout":Array[4]

        }

    },

    {

        "id":"225441493865192300",

        "type":"forward",

        "media":{

            "audio":Object{...},

            "video":Object{...}

        },

        "info":{

            "type":"webrtc",

            "owner":"xlAhF7JW7bEV5CixAAAD",

            "inViews":[

                "common"

            ]

        }

    },

    {

        "id":"260051018178094850",

        "type":"forward",

        "media":{

            "audio":Object{...},

            "video":Object{...}

        },

        "info":{

            "type":"webrtc",

            "owner":"Sv0QKEc4uDgl4moQAAAJ",

            "inViews":[

                "common"

            ]

        }

    }

]

返回参数说明

6、房间管理

房间管理

  • 房间管理地址

请求URL

  • https://192.168.1.123:3300/console 

请求方式

7、根据流id获取流

根据流id 获取流

  • 根据流id 获取流接口

请求URL

  • https://192.168.43.100:3006/rooms/{roomID}/streams/{steamID}

请求方式

  • GET

参数

参数名

必选

类型

说明

roomID

string

房间id

steamID

string

流id

返回示例

 {

    "id": "803814272342767000",

    "type": "forward",

    "media": {

        "audio": {

            "status": "active",

            "format": {

                "codec": "opus",

                "sampleRate": 48000,

                "channelNum": 2

            },

            "source": "mic",

            "optional": {

                "format": [

                    {

                        "codec": "isac",

                        "sampleRate": 16000

                    },

                    {

                        "codec": "isac",

                        "sampleRate": 32000

                    },

                    {

                        "codec": "g722",

                        "sampleRate": 16000,

                        "channelNum": 1

                    },

                    {

                        "codec": "pcma"

                    },

                    {

                        "codec": "pcmu"

                    },

                    {

                        "codec": "aac",

                        "sampleRate": 48000,

                        "channelNum": 2

                    },

                    {

                        "codec": "ac3"

                    },

                    {

                        "codec": "nellymoser"

                    },

                    {

                        "codec": "ilbc"

                    }

                ]

            }

        },

        "video": {

            "status": "active",

            "source": "camera",

            "optional": {

                "format": [

                    {

                        "codec": "h264",

                        "profile": "CB"

                    },

                    {

                        "codec": "h264",

                        "profile": "B"

                    },

                    {

                        "codec": "vp9"

                    }

                ],

                "parameters": {

                    "resolution": [

                        {

                            "width": 480,

                            "height": 360

                        },

                        {

                            "width": 426,

                            "height": 320

                        },

                        {

                            "width": 320,

                            "height": 240

                        },

                        {

                            "width": 212,

                            "height": 160

                        },

                        {

                            "width": 160,

                            "height": 120

                        },

                        {

                            "width": 320,

                            "height": 240

                        },

                        {

                            "width": 352,

                            "height": 288

                        }

                    ],

                    "framerate": [

                        6,

                        12,

                        15,

                        24

                    ],

                    "bitrate": [

                        "x0.8",

                        "x0.6",

                        "x0.4",

                        "x0.2"

                    ],

                    "keyFrameInterval": [

                        100,

                        30,

                        5,

                        2,

                        1

                    ]

                }

            },

            "original": [

                {

                    "format": {

                        "codec": "vp8"

                    },

                    "parameters": {

                        "resolution": {

                            "width": 640,

                            "height": 480

                        },

                        "framerate": 30

                    }

                }

            ]

        }

    },

    "info": {

        "type": "webrtc",

        "owner": "HGb-2PQOVV9aou8zAAAE",

        "inViews": [

            "common"

        ]

    }

}

  • 更多返回错误代码请看首页的错误代码描述

8、输出视频流接口

输出视频流接口

  • 输出视频流接口

请求URL

  • https://192.168.43.100:3006/rooms/5fdc3de35450ee5d40ea6235/streaming-outs

请求方式

  • POST

请求body体

{

  "protocol": "rtmp" ,

  "url": "rtmp://seetec3.xiaokuai.com:32002/seetec/out2",

  "media": {

    "audio": {

        "from": "5fdc3de35450ee5d40ea6235-common"

    },

    "video": {

        "from": "5fdc3de35450ee5d40ea6235-common",

        "parameters": {

          "keyFrameInterval": 2

        }

    }

  }

}

请求头参数

参数名

类型

说明

Content-type

String

application/json

返回示例

  {

    "error_code": 0,

    "data": {

      "uid": "1",

      "username": "12154545",

      "name": "吴系挂",

      "groupid": 2 ,

      "reg_time": "1436864169",

      "last_login_time": "0",

    }

  }

备注

  • 更多返回错误代码请看首页的错误代码描述

9、加入外部视频流接口

加入外部视频流接口

  • 加入外部视频流接口

请求URL

  • https://192.168.43.100:3006/rooms/5fdc3de35450ee5d40ea6235/streaming-ins

请求方式

  • POST

请求body

{

  "url": "rtmp://58.200.131.2:1935/livetv/cctv2",

  "transport":{

    "protocol": "udp",

    "bufferSize": 2048000

  },

  "media": {

    "audio": "auto",

    "video": "auto"

  }

}

请求参数

参数名

必选

类型

说明

Content-type

string

application/json

返回body

{ "id": "478239393172736000", "type": "forward", "media": { "audio": { "status": "active", "format": { "codec": "aac" }, "optional": { "format": [ { "codec": "opus", "sampleRate": 48000, "channelNum": 2 }, { "codec": "isac", "sampleRate": 16000 }, { "codec": "isac", "sampleRate": 32000 }, { "codec": "g722", "sampleRate": 16000, "channelNum": 1 }, { "codec": "pcma" }, { "codec": "pcmu" }, { "codec": "aac", "sampleRate": 48000, "channelNum": 2 }, { "codec": "ac3" }, { "codec": "nellymoser" }, { "codec": "ilbc" } ] } }, "video": { "status": "active", "optional": { "format": [ { "codec": "vp8" }, { "codec": "h264", "profile": "CB" }, { "codec": "h264", "profile": "B" }, { "codec": "vp9" } ], "parameters": { "resolution": [ { "width": 768, "height": 432 }, { "width": 682, "height": 384 }, { "width": 512, "height": 288 }, { "width": 340, "height": 192 }, { "width": 256, "height": 144 }, { "width": 640, "height": 480 }, { "width": 320, "height": 240 }, { "width": 352, "height": 288 } ], "framerate": [ 6, 12, 15, 24, 30, 48, 60 ], "bitrate": [ "x0.8", "x0.6", "x0.4", "x0.2" ], "keyFrameInterval": [ 100, 30, 5, 2, 1 ] } }, "format": { "codec": "h264", "profile": "M" }, "parameters": { "resolution": { "width": 1024, "height": 576 } } } }, "info": { "type": "streaming", "owner": "admin", "inViews": [] } }

备注

  • 更多返回错误代码请看首页的错误代码描述
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

喜文BLOG

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值