【问题标题】:WOWZA Streaming engine REST API not updating RTMP urlWOWZA 流引擎 REST API 未更新 RTMP url
【发布时间】:2016-09-19 12:09:21
【问题描述】:

我正在尝试通过 wowza 流引擎重新流式传输实时“RTMP”流。为此,我正在使用 wowza REST API。我能够创建流文件,但 RTMP URI 目标未在此文件中创建/更新。以下是遵循的详细步骤和获得的结果。 1. 使用以下请求创建流文件

POST: `http://<server-ip>:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/<app-name>/streamfiles`

标题:

  Accept :application/json 
     Content-Type: application/json

身体

{
  "name": "test_stream",
  "uri": "rtmp://ingest-sgp-01.lb.nanocosmos.de:80/live/<stream-name>"
}

结果

{
  "success": true,
  "message": "",
  "data": null
}

当我使用 Stream status 检查状态时,RTMP URL 未在属性中创建。详情如下 获取:

`http://<server-ip>:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/<app-name>/streamfiles/test_stream/adv`

BODY
 {
      "enabled": false,
      "canRemove": true,
      "name": "uri",
      "valuhttp://<server-ip>:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/<app-name>/streamfiles/test_stream/adve": null,
      "defaultValue": null,
      "type": "String",
      "sectionName": "Common",
      "section": null,
      "documented": true
    }

我再次向服务器发送 PUT 请求,其中包含以下详细信息。

http://<server-ip>:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/<app-name>/streamfiles/test_stream/adv

身体

{
   "advancedSettings": [
{
"enabled": true,
"canRemove": true,
"name": "uri",
"value": "rtmp://ingest-sgp-01.lb.nanocosmos.de:80/live/Q0f8HNVJ1P",
"defaultValue": null,
"type": "String",
"sectionName": "Common",
"section": null,
"documented": true
},
{
"enabled": true,
"canRemove": true,
"name": "streamTimeout",
"value": "0",
"defaultValue": "12000",
"type": "Integer",
"sectionName": "Common",
"section": null,
"documented": true
},
{
"enabled": true,
"canRemove": true,
"name": "reconnectWaitTime",
"value": "0",
"defaultValue": "3000",
"type": "Integer",
"sectionName": "Common",
"section": null,
"documented": true
}
],
  "serverName": "_defaultServer_"
}

结果

{
  "success": true,
  "message": "",
  "data": null
}

但仍在流文件详细信息中 URI 为空 结果

{
      "enabled": false,
      "canRemove": true,
      "name": "uri",
      "value": null,
      "defaultValue": null,
      "type": "String",these End points were hit with. swagger-ui tool provided by wowza, POST man tool with chrome, and nodej
      "sectionName": "Common",
      "section": null,
      "documented": true
    }

我不知道为什么这个 RTMP URL 不是通过不同的请求创建/更新的?这些 REST 端点受到了打击。

  1. wowza提供的swagger-ui工具,
  2. 带有 chrome 的 POST 人工工具,
  3. nodejs 请求 API。

所有结果都相同。在 wowza 服务器的 Server.xml 文件中,REST 服务设置为无身份验证。

【问题讨论】:

    标签: rest wowza


    【解决方案1】:

    要通过 REST API 创建流文件,请尝试以下操作。

    curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/streamfiles/test_stream -d'
    {
       "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/streamfiles",
       "streamFiles": [
          {
             "id": "connectAppName=live&appInstance=_definst_&mediaCasterType=rtp",
             "href": "http://localhohst:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/streamfiles/connectAppName=live&appInstance=_definst_&mediaCasterType=rtp"
          }
       ]
    }'
    

    要更新现有的流文件,您还需要在 JSON 正文中使用 resturi 参数,类似于以下内容:

    curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/streamfiles/test_stream/adv -d'
    {
    "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/streamfiles/test_stream/adv",
    "version": "1430601267443",
    "advancedSettings": [
    {
    "enabled": true,
    "canRemove": true,
    "name": "uri",
    "value": "rtmp://ingest-sgp-01.lb.nanocosmos.de:80/live/Q0f8HNVJ1P",
    "defaultValue": null,
    "type": "String",
    "sectionName": "Common",
    "section": null,
    "documented": true
    },
    {
    "enabled": true,
    "canRemove": true,
    "name": "streamTimeout",
    "value": "0",
    "defaultValue": "12000",
    "type": "Integer",
    "sectionName": "Common",
    "section": null,
    "documented": true
    },
    {
    "enabled": true,
    "canRemove": true,
    "name": "reconnectWaitTime",
    "value": "0",
    "defaultValue": "3000",
    "type": "Integer",
    "sectionName": "Common",
    "section": null,
    "documented": true
    }
    ]
    }'
    

    【讨论】:

      猜你喜欢
      • 2016-03-18
      • 2014-06-29
      • 2016-04-27
      • 1970-01-01
      • 2017-09-05
      • 2019-03-22
      • 2012-06-14
      • 2013-11-20
      • 2016-10-26
      相关资源
      最近更新 更多