wowza拉流和推流接口备忘

本文详细介绍了Wowza流媒体服务器的各种管理接口,包括添加、连接、断开及删除流文件的操作步骤与方法,同时提供了推流接口的具体实现。

拉流接口地址:https://www.wowza.com/docs/stream-management-query-examples#

推流接口地址:https://www.wowza.com/docs/stream-targets-query-examples-push-publishing

  概述:wowza的接口地址是将部分参数拼在URL里的,并且是以键值对的形式存在的。

Add a stream file

  作用:添加一个流文件到wowza服务器中。

  URL:http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/streamfiles

  参数:{"name": "creedence","serverName": "_defaultServer_","uri": "udp://1.2.3.4:10000" }

  header:Accept:application/json; charset=utf-8' ;'Content-Type:application/json

  提交方式:post

  参数解释:

    localhost:8087:wowza设备的IP和端口

    key:servers,value:_defaultServer_

    key:vhosts,value:_defaultVHost_

    key:applications,value:live

    name:流文件的唯一标识,在其他地方通常叫ID

    serverName:servers的值

    uri:添加流文件最重要的参数

Connect a stream file

  作用:wowza服务器里的流文件有两种创建方式,一种是通过Add a stream file接口添加进来的,第二种是从其他服务器推送过来的。不管wowza里的流文件是哪种来源方式,都需要调用Connect a stream file接口连接流后才可以使用。

  URL:http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/streamfiles/creedence/actions/connect?connectAppName=live&appInstance=_definst_&mediaCasterType=rtp

   参数:全部拼接在URL里了

  header:Accept:application/json; charset=utf-8' ;'Content-Type:application/json

  提交方式:put

  参数解释:

     creedence:Add a stream file接口中的name属性值

    connectAppName:Add a stream file接口中的application的属性值

      key:appInstance,value:_definst_

      key:mediaCasterType,value:rtp

  备注:一台wowza服务器可以有多个application,一个application可以有多个appInstance,不过通常会创建多个application而每个application只有一个appInstance

Disconnect a stream file

  作用:Connect a stream file接口的相反操作,由于断开流文件的连接

  URL:http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/incomingstreams/creedence.stream/actions/disconnectStream

   header:Accept:application/json; charset=utf-8' ;'Content-Type:application/json

  提交方式:put

  参数:全部拼接在URL里了

    参数解释:

     creedence:Add a stream file接口中的name属性值

  备注:流文件要先断开再移除

Remove a stream file

  作用:从wowza设备中移除一个流文件

  URL:http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/streamfiles/creedence

    header:Accept:application/json; charset=utf-8

  提交方式:delete

   参数:全部拼接在URL里了

  参数解释:

    creedence:Add a stream file接口中的name属性值

Create a stream target

  作用:推流接口,将流文件从服务器A推到服务器B(这句话很重要),设置服务器B的一些属性。

    URL:http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/pushpublish/mapentries/ppsource

  header:Accept:application/json; charset=utf-8;Content-type:application/json

  提交方式:post

  参数:{ "serverName": "_defaultServer_", "sourceStreamName": "myStream", "entryName": "ppsource", "profile": "rtmp", "host": "localhost", "application": "live", "userName": "testUser", "password": "pass", "streamName": "myStream" }

  参数解释:

    ppsource:是下面的entryName属性值

    serverName:服务器B的servers属性,就是Add a stream file接口里的servers属性

    sourceStreamName:服务器A的流文件name属性

    entryName:推流的任务id(wowza喜欢讲ID叫做name),推流任务的唯一标识。

    profile:传输协议,我用的是rtmp

    host:服务器B的IP

    application:服务器B的application属性

    userName:如果服务器B开启验证的话,服务器A的推流参数里要设置服务器B认可的用户名和密码才能给服务器B推流

    password:看上一条

    streamName:流文件在服务器B的唯一标识,可以和sourceStreamName(流文件在服务器A的唯一标识)相同,但不能没有

  备注:官网的这个推流文档里没有将服务器B的端口写上去,你可以将服务器B的端口拼在host属性值后面,也可以增加port属性。

    最后:十分感恩robin在我研读文档期间给我的支持和帮助,谢谢你。

 

转载于:https://www.cnblogs.com/iMichaelHuang/p/7506400.html

Wowza IDE User’s Guide》,英文版,PDF 格式,大小 285 KB。截至 20130925,Wowza 官方公布的最新 IDE 用户手册。 内容简介: What is the Wowza IDE? Wowza IDE is an integrated development environment for creating extensions, configuring and managing the Wowza Media Systems product line. It is an application built on top of the popular Eclipse application framework from the Eclipse Foundation. You can learn more about Eclipse at http://www.eclipse.org. The Wowza IDE is available for the Windows and Mac OS X platforms. This version of the Wowza IDE includes the Eclipse version 3.5.1 Java development tools as well as custom IDE features to enhance the development of Wowza Media Server modules and server extensions. The remainder of this document covers the process for developing Java server extensions. 目录: Introduction.......................................................................................................................5 Before Installation.................................................................................................................................................5 Installing the Wowza IDE......................................................................................................................................6 Extending Wowza Media Server Using Java.....................................................................7 Project and Module Class Creation.......................................................................................................................7 Import ModuleServerSide Example.....................................................................................................................10 Application.xml Configuration.............................................................................................................................10 Server Startup....................................................................................................................................................11 Module Testing...................................................................................................................................................12 Server Extension Wizards...................................................................................................................................13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值