如何检查Wowza上的LiveStream(仅音频)是否打开? [英] How to check whether LiveStream (Audio Only) is up on Wowza or not?

查看:177
本文介绍了如何检查Wowza上的LiveStream(仅音频)是否打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 Wowza流式传输到Mobile(Android).我正在使用 Vitamio 流媒体库.实际的流程是,当我的应用程序点击Wowza时,Wowza没有实时流,但是过一会儿Wowza就会进行实时流.现在,我再次想点击Wowza来检查直播是否正常播放.

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.

我想要的是,我的应用程序应每5秒点击一次Wowza,以查看是否流式传输.

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

推荐答案

听起来您只需要查询Wowza服务器即可查看流是否处于活动状态.如果是这样,则可以使用Wowza REST API命令来查询传入流(至少需要使用4.2+版本).

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+).

例如,要查询所有传入流的应用程序实时",可以通过HTTP发送以下命令:

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_"}

这表明我有一个名为"wowzademo.stream"的传入流(除其他外).如果愿意,还可以将响应更改为xml而不是json.

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.

针对您的评论,我要补充:

In response to your comment, I would add:

  1. 确保您使用的版本至少为4.2+;我实际上建议使用版本4.3,因为最新版本上有一些REST API修复;

  1. make sure that you are on at least version 4.2+; I would actually recommend using version 4.3 since there were some REST API fixes on the latest version;

如果您使用的是版本4.3,则通过在conf/Server.xml文件的Root/Server/RESTInterface容器下将<AuthenticationMethod><DocumentationServerAuthenticationMethod>设置为none来测试禁用身份验证;

If you are on version 4.3, then test with disabling authentication by setting <AuthenticationMethod> and <DocumentationServerAuthenticationMethod> to none under the Root/Server/RESTInterface container of the conf/Server.xml file;

确保添加restUserHTTPHeaders属性,使其值为"Access-Control-Allow-Origin:* | Access-Control-Allow-Methods:‌OPTIONS,GET,PUT,DELETE,POST | Access-Contr‌ol-Allow-Headers:Con‌tent-Type.

Make sure that you add the restUserHTTPHeaders property to have the value "Access-Control-Allow-Origin:*|Access-Control-Allow-Methods:‌​OPTIONS,GET,PUT,DELE‌​TE,POST|Access-Contr‌​ol-Allow-Headers:Con‌​tent-Type".

如果以上方法仍然无法满足您的要求,请尝试通过将<DiagnosticURLEnable>设置为true,然后在RESTInterface容器中添加<debugEnable>(设置为true/Boolean类型)属性来启用调试属性.您可以通过检查logs/目录中的访问日志来查看生成的日志.

If the above still does not work for you, try enabling the debug properties by setting <DiagnosticURLEnable> to true, and adding <debugEnable> (set to true/Boolean type) property in the RESTInterface container. You can view the logs generated by checking the access logs in the logs/ directory.

这篇关于如何检查Wowza上的LiveStream(仅音频)是否打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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