如何检查是否直播(仅音频)高达上wowza与否[修正] [英] How to check whether LiveStream (Audio Only) is up on wowza or not [Fixed]

查看:273
本文介绍了如何检查是否直播(仅音频)高达上wowza与否[修正]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 Wowza到手机(Android版)流媒体。我使用的 Vitamio 流媒体库。实际流量是喜欢,Wowza没有现场直播了,但是当我的应用程序打wowza,但经过一段时间Wowza得到现场直播了。现在我要再次打wowza检查是否现场直播或没有。

我要的是,我的应用程序应该打在Wowza每5秒检查流涨不跌。

请帮忙。

感谢。


解决方案

这听起来像你只需要查询您的Wowza服务器,看看你的流激活。如果是这样,那么你可以使用一个Wowza REST API命令查询输入数据流(你需要至少4.2版+)。

例如,要查询应用活的所有输入流,可以通过HTTP发送下面的命令:

 卷曲-X GET --header接受:应用/ JSON的;字符集= UTF-8 http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_

您会得到类似的回应:

<$p$p><$c$c>{\"serverName\":\"_defaultServer_\",\"incomingStreams\":[{\"sourceIp\":\"<hidden>\",\"isPTZEnabled\":false,\"applicationInstance\":\"_definst_\",\"name\":\"wowzademo.stream\",\"isRecordingSet\":false,\"isStreamManagerStream\":true,\"isPublishedToVOD\":false,\"isConnected\":true,\"ptzPollingInterval\":2000}],\"outgoingStreams\":[],\"recorders\":[],\"streamGroups\":[],\"name\":\"_definst_\"}

这说明我有一个名为wowzademo.stream(除其他事项外)的输入流。你也可以改变你的回应是XML而不是JSON,如果你preFER。

希望与您的演示帮助。

I am streaming from Wowza to Mobile (Android). I am using Vitamio streaming library. The actual flow is like, Wowza don't have live stream up, when my app hits the wowza, but after a while Wowza gets live stream up. Now I again want to hit the wowza to check whether live stream up or not.

All I want is, My app should hit the Wowza in every 5 sec to check the stream up or not.

Please help.

Thanks.

解决方案

It sounds like you just need to query your Wowza server to see if your stream is active or not. If so, then you can use a Wowza REST API command to query Incoming Streams (you need at least version 4.2+).

For example, to query application "live" for all Incoming Streams, you can send the following command via HTTP:

curl -X GET --header 'Accept:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_

You would get a response similar to:

{"serverName":"_defaultServer_","incomingStreams":[{"sourceIp":"<hidden>","isPTZEnabled":false,"applicationInstance":"_definst_","name":"wowzademo.stream","isRecordingSet":false,"isStreamManagerStream":true,"isPublishedToVOD":false,"isConnected":true,"ptzPollingInterval":2000}],"outgoingStreams":[],"recorders":[],"streamGroups":[],"name":"_definst_"}

Which shows that I have an Incoming Stream called "wowzademo.stream" (among other things).You can also change your response to be xml instead of json, if you prefer.

Hope that helps with your demo.

这篇关于如何检查是否直播(仅音频)高达上wowza与否[修正]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆