听起来您只需要查询您的 Wowza 服务器以查看您的流是否处于活动状态。如果是这样,那么您可以使用 Wowza REST API 命令来查询传入流(您至少需要 4.2+ 版本)。
例如,要查询应用程序“实时”的所有传入流,您可以通过 HTTP 发送以下命令:
curl -X GET --header 'Accept:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_
你会得到类似的响应:
{"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。
更新
针对您的评论,我会补充:
确保您至少使用 4.2+ 版本;我实际上建议使用 4.3 版,因为在最新版本上修复了一些 REST API;
-
如果您使用的是 4.3 版,则通过在 conf/Server.xml 文件的 Root/Server/RESTInterface 容器下将 <AuthenticationMethod> 和 <DocumentationServerAuthenticationMethod> 设置为 none 来测试禁用身份验证;
确保添加 restUserHTTPHeaders 属性,使其值为“Access-Control-Allow-Origin:*|Access-Control-Allow-Methods:OPTIONS,GET,PUT,DELETE,POST |Access-Control-Allow-Headers:Content-Type"。
如果上述方法仍然对您不起作用,请尝试通过将 <DiagnosticURLEnable> 设置为 true 并在 RESTInterface 容器中添加 <debugEnable>(设置为 true/布尔类型)属性来启用调试属性。您可以通过查看logs/目录下的访问日志来查看生成的日志。