如何使用 Wowza Streaming Engine 安排流式传输

How to schedule streaming with Wowza Streaming Engine

我正在尝试在 Wowza 服务器上安排播放列表,以便连续播放视频(如电视频道)。我开始学习本教程:

http://www.wowza.com/forums/content.php?145-How-to-schedule-streaming-with-Wowza-Streaming-Engine-%28ServerListenerStreamPublisher%29

/usr/local/WowzaStreamingEngine/conf/Server.xml 中,我在 ServerListeners 中添加了这个:

<ServerListener
   <BaseClass>com.wowza.wms.plugin.collection.serverlistener.ServerListenerStreamPublisher</BaseClass>
</ServerListener>

/usr/local/WowzaStreamingEngine/conf/Application.xml 中,我在模块中添加了这个:

<Module>
  <Name>streamPublisher</Name>
  <Description>Schedules streams and playlists.</Description>
  <Class>com.wowza.wms.plugin.collection.module.ModuleStreamPublisher</Class>
</Module>

我在 /usr/local/WowzaStreamingEngine/content/ana.smil 中创建了一个包含以下内容的 smil 文件:

<?xml version="1.0" encoding="UTF-8"?>
<smil>
    <head>
    </head>
    <body>

        <stream name="live"></stream>

        <playlist name="pl1" playOnStream="live" repeat="true" scheduled="2013-09-25 16:00:00">
            <video src="mp4:sample.mp4" start="5" length="5"/>
            <video src="mp4:sample.mp4" start="50" length="5"/>
            <video src="mp4:sample.mp4" start="150" length="5"/>
        </playlist>
    </body>
</smil>

我重启了服务器...

现在我期待看到流进入我的应用程序 "live through the Stream called "live"...但没有任何显示。

我想我错过了一步,可能添加 streamPublisherSmilFile 属性 就像 Wowza 中所说的 link 我在上面发布了...但是我在哪里设置它?

感谢您的帮助。 问候, 约翰

您需要同时添加服务器和应用程序属性

服务器属性

/usr/local/WowzaStreamingEngine/conf/Server.xml

 <!-- Properties defined here will be added to the IServer.getProperties() collection -->
<Properties>
   <Property>
      <Name>...</Name>
      <Value>...</Value>
      <Type>...</Type>
   </Property>
</Properties>

应用程序属性

/usr/local/WowzaStreamingEngine/conf/{APP_NAME}/Application.xml

例如:对于 live 应用程序:

/usr/local/WowzaStreamingEngine/conf/live/Application.xml

  <!-- Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections -->
<Properties>
   <Property>
      <Name>...</Name>
      <Value>...</Value>
      <Type>...</Type>
   </Property>
</Properties>

您还需要将模块 .jar 文件从附加组件复制到:

/usr/local/WowzaStreamingEngine/lib

然后重启Wowza。

前置要求:在wowza中,配置文件的层次结构是这样的:

1- wowza-dir/conf/specific_application_name/Application.xml    
2- wowza-dir/conf/Application.xml   
3- wowza-dir/Server.conf

如果在这 3 个配置文件中设置了某些内容(设置、配置、...), wowza 将 select 最具体的配置文件 。这意味着如果您在 conf/your_app/Application.xmlconf/Application.xml 中都设置了内容目录,wowza 将选择 conf/Application.xml 中提到的目录。同样的规则也适用于其他东西,例如 smil 文件和...。

好的,现在让我们回到我们的问题: wowza定时直播有两种方式:
1- Server Listener:您在服务器配置文件中设置流式传输和调度设置(Application.xml)
2- 应用程序模块:您在应用程序配置文件中设置设置(Application.xml)

例如,如果您的 my_app_content_directory 中有包含 stream_schedule 的 my_stream_sched.smil 文件,在服务器侦听器模式下,当服务器启动时加载 smil 文件,如果您想更改它,需要重启服务器!在应用模块中,只需要重启应用即可。

我们需要将 link 中给定的服务器和应用程序属性添加到应用程序的 Server.xml 和 Application.xml 中。

Link : http://www.wowza.com/forums/content.php?145-How-to-schedule-streaming-with-Wowza-Streaming-Engine-%28ServerListenerStreamPublisher%29

并将 jar 复制到 /usr/local/WozaStreamingEngine/lib/ ,然后重新启动 WowzaStreaming 引擎。

请检查加载两个模块的日志 i:e ServerListenerStreamPublisher 和 ModuleStreamPublisher。

编辑 /usr/local/WowzaStreamingEngine/content/ana.smil 文件以安排流,并重新启动应用程序 only.No 需要重新启动服务器。