2016-09-19 10 views
1

Я пытаюсь повторно транслировать поток «RTMP» через wowza Streaming engine. Для этого я использую API-интерфейс wowza REST. Мне удалось создать файл потока, но цель RTMP URI не создается и не обновляется в этом файле. Ниже приведены подробные шаги и полученные результаты. 1. создать файл поток с следующим запросомWOWZA Streaming engine REST API не обновляет URL-адрес RTMP

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

HEADERS:

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 
} 

Когда я проверил состояние с состоянием потока RTMP URL не было создано в свойствах. Детали следующим образом GET:

`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 
} 

, но до сих пор в streamfile детали 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 
    } 

Я невежественный, почему этот URL RTMP не создан/обн с помощью различных запросов? эти конечные точки REST были поражены.

  1. чванство-UI инструмент, предоставляемый Wowza,
  2. POST человек инструмент с хромом,
  3. nodejs запрос API.

все результаты такой же. Служба REST настроена на отсутствие аутентификации в файле Server.xml сервера wowza.

ответ

0

Чтобы создать файл потока через 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" 
     } 
    ] 
}' 

Чтобы обновить существующий файл потока, вам необходимо будет также использовать resturi параметр в вашем теле JSON, похожее на следующее:

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 
} 
] 
}'