关于Wowza Push Publishing功能所支持的推送目的服务器或CDN
转载请注明:文章来自www.wowza.cn
注意: 要访问最新的技术资料,请访问http://www.ttstream.com/wowza/
这篇文章提供了Wowza Streaming Engine软件Push Publishing功能所支持的推送目的服务或CDN的所有例子Map文件。

注意: 要了解如何使用Wowza的push Publishing功能,请参考如何使用wowza 的Push Publishing 功能?
1、按流传输协议分

Wowza Streaming Engine (SecureToken 和 RTMP 认证)
Adobe Media Server (RTMP 认证)
Apple HLS (cupertino)
Adobe HDS (sanjose)
MPEG-2 Transport Stream (MPEG-TS)
Real-time Transport Protocol

2、按流媒体服务器和CDN分

Mirror Image Internet
BitGravity
Limelight
Akamai (RTMP)
Akamai HTTP (Apple HLS, Adobe HDS)
EdgeCast
Level 3

3、按流服务提供商分

Livestream
Justin.tv
Ustream.tv
YouTube Live

一、各种流传输协议


Wowza Streaming Engine

将流推送到另一台运行Wowza Streaming Engine的服务器时,请使用rtmp profile。 UserNamePassword 两个参数用于RTMP推流认证。

下面是一个将流myStream推送到另一台Wowza Streaming Engine服务器的例子,目的服务器的域名是wowza.myserver.com, 假定它启用了RTMP推流认证,并使用下面的用户名密码:

  • User Name: myUser
  • Password: myPassword

map映射文件的例子:
myStream={profile:"rtmp", streamName:"myStream", host:"wowza.myserver.com", userName:"myUser", password:"myPassword"}

针对多码率自适应流的场景,map映射文件稍微复杂点。它要求关键帧必须对齐。例如,下面三个流做多码率自适应:

  • myStream_480p: 500Kbps
  • myStream_360p: 750Kbps
  • myStream_720p: 1000Kbps

map映射文件如下:
myStream_480p={profile:"rtmp", streamName:"myStream_480p", userName:"myUser", password:"myPassword", adaptiveStreaming:true}
myStream_360p={profile:"rtmp", streamName:"myStream_360p", userName:"myUser", password:"myPassword", adaptiveStreaming:true}
myStream_720p={profile:"rtmp", streamName:"myStream_720p", userName:"myUser", password:"myPassword", adaptiveStreaming:true}

为支持多码率自适应功能,你必须在目的Wowza服务器[install-dir]/content目录下建立一个Synchronized Multimedia Integration Language (SMIL)文件才能。SMIL文件类似如下:
Code:
<smil>
    <head>
    </head>
    <body>
        <switch>
            <video src="myStream_480p" video-bitrate=400000  audio-bitrate=96000  width=320 height=180>
                <param name="videoCodecId" value="avc1.66.12" valuetype="data"/>
                <param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
            </video>
            <video src="myStream_360p" video-bitrate=650000  audio-bitrate=96000  width=476 height=268>
                <param name="videoCodecId" value="avc1.66.21" valuetype="data"/>
                <param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
            </video>
            <video src="myStream_720p" video-bitrate=900000  audio-bitrate=96000  width=640 height=360>
                <param name="videoCodecId" value="avc1.66.31" valuetype="data"/>
                <param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
            </video>
        </switch>
    </body>
</smil>

播放这个流:


  1. 打开[install-dir]/examples/LiveVideoStreaming/FlashRTMPPlayer/player.html.
  2. Server输入框输入Wowza Streaming Engine 服务器的地址和应用名,格式为rtmp://[wowza-ip-address]/[application]/.
  3. Stream的输入框中输入stream name
  4. 点击 Connect.

Adobe Media Server

推流到一台Adobe Media Server服务器,请使用rtmp profile。当Adobe Media Server启用RTMP推流认证时,要使用UserNamePassword两个参数。

下面是一个例子,它将myStream推送到一个远端的Adobe Media Server,并假定启用了RTMP认证,并采用下面的用户名和密码:

  • User Name: myUser
  • Password: myPassword

示例如下:
myStream={profile:"rtmp", streamName:"myStream", userName:"myUser", password:"myPassword", originalTimecodeThreshold:0x100000}

播放这个流:


  1. 打开[install-dir]/examples/LiveVideoStreaming/FlashRTMPPlayer/player.html.
  2. Server输入框中输入Adobe Media Server 的IP地址和application的名字,格式为rtmp://[adobe-address]/[application]/.
  3. Stream输入框中输入stream的名字
  4. 点击Connect.

MPEG-2 Transport Stream (MPEG-TS)

将MPEG-TS 流推送到组播地址239.1.1.1:10000, 采用下面的映射例子:
myStream={profile:"mpegts", streamName:"myStreamMPEGTS", host:"239.1.1.1", port:10000, rtpWrap:false}

Real Time Transport Protocol (RTP 单播或组播)

将native RTP包推送到组播地址239.1.1.1, 端口 10002-10005, 采用下面的映射例子:
myStream={profile:"rtp", streamName:"myStreamRTP", host:"239.1.1.1", videoPort:10002, audioPort:10004}
注意:
  • 当你使用native RTP包来推送时,视频和音频各使用两个UDP端口。你必须确认VideoPortAudioPort 必须是偶数。这样做就可以将第二个端口预留出来。

  • 当你使用MPEG-TS 或 native RTP包来推送时,在[install-dir]/applications/[application]/sdp文件夹下会自动产生一个.sdp文件。这个SDP文件的名字是你的映射文件中目的地址的StreamName参数,支持组播的播放器可以直接使用这个文件来播放流。

  • 当你使用MPEG-TS 或 native RTP包来推送时到单播或组播地址时,两者的推送配置基本是一样的,唯一的区别在于组播要使用正确的组播地址。关于组播地址范围的介绍,请参考:Multicast address.

  • 当在一台有多个网卡的Linux服务器上接收组播流时,在某些内核的系统上,可能会遇到一些问题。要了解更多,请参考CentOS 6 - Problems with Multicast.

二、流媒体服务器和CDN网络


Mirror Image Internet

要推流到Mirror Image, 你需要使用rtmp协议。并且还需要以下账户信息:

  • User Name
  • Password
  • Host
  • Application

下面是将流myStream推动到Mirror Image的例子,并假定使用以下认证信息:

  • User Name: myUser
  • Password: myPassword
  • Host: origin address provided during provisioning
  • Application: channel

映射条目的示例:
myStream={profile:"rtmp", host:"Origin Address", application:"channel", appInstance:"_definst_/doPublish=myPassword"}

播放流:


  1. 打开[install-dir]/examples/LiveVideoStreaming/FlashRTMPPlayer/player.html.
  2. Server输入框中输入地址,格式为rtmp://[CNAME created during provisioning]:1935/channel/.
  3. Stream输入框中输入stream name.
  4. Click Connect.

BitGravity

要推流到BitGravity, 你需要使用rtmp协议。但前提是你必须先在BitGravity 的控制界面创建一个直播流。

下面是将myStream推流到BitGravity的例子,并假定你已经在BitGravity的控制界面上创建了直播流,如下所示:

  • Server: rtmp://rtpdev1.iad1.bitgravity.com/rtmp/push
  • Stream: test@test.com/71d73d4cfd1e2f2fed77238021a2cbbe/test/live/feed01

其中,Server的URL将被Wowza按如下方式解析:

  • Host: rtpdev1.iad1.bitgravity.com
  • Application: rtmp
  • AppInstance: push

下面是映射条目的例子:
myStream={profile:"rtmp", streamName:"test@test.com/71d73d4cfd1e2f2fed77238021a2cbbe/test/live/feed01", host:"rtpdev1.iad1.bitgravity.com", application:"rtmp", appInstance:"push"}

Limelight

要推送到,你需要使用rtmp-limelight 协议。这个rtmp-limelight 协议是一个预设推送的Limelight CDN的协议。 当推送时,你还需要以下账户信息:

  • User Name
  • Password

下面是将流myStream推送到Limelight的例子,并假定使用下面的认证信息:

  • User Name: myUser
  • Password: myPassword

推送映射条目的例子:
myStream={profile:"rtmp-limelight", streamName:"myStream", userName:"myUser", password:"myPassword", originalTimecodeThreshold:0x100000}

播放流:


  1. 打开[install-dir]/examples/LiveVideoStreaming/FlashRTMPPlayer/player.html.
  2. Server输入框,输入地址,格式为rtmp://[username].fc.llnwd.net/[username].
  3. Stream输入框,输入stream name.
  4. 点击Connect.

Akamai (RTMP)

要推送到Akamai, 你要使用rtmp-akamai协议。rtmp-akamai 协议是一个预制的推送到Akamai HD Network的协议。 在推送时,你还需要下面的账户:

  • StreamId
  • User Name
  • Password

下面是将流myStream推送到Akamai的例子,并假定使用下面的用户认证信息:

  • StreamId: 12345
  • User Name: myUser
  • Password: myPassword

推送映射条目的例子:
myStream={profile:"rtmp-akamai", streamName:"myStream_1_500", akamai.streamId:12345, userName:"myUser", password:"myPassword"}

这个流会被推送到Akamai 的一个节点p.ep[stream-id].i.akamaientrypoint.net/EntryPoint/上,流的名字是myStream_1_500@[stream-id]。 就上面的例子来说,推送的节点为p.ep12345.i.akamaientrypoint.net/EntryPoint/ ,流的名字为myStream_1_500@12345。 此外,还有一个可选的参数,叫做akamai.sendToBackupServer,如果将它设置为True,那么推送的节点将变为b.ep12345.i.akamaientrypoint.net/EntryPoint/

要配置一个备份的推送节点,请在备份的Wowza Streaing Engine上的映射条目中添加akamai.sendToBackupServer:true参数,并设置为true。当主Wowza Streaming Engine上的推送异常中断时,这个备份的Wowza Streaming Engine将继续向Akamai推流。

映射条目的例子:
myStream={profile:"rtmp-akamai", streamName:"myStream_1_500", akamai.streamId:12345, userName:"myUser", password:"myPassword", akamai.sendToBackupServer:true}

注意: 当用RTMP推流到Akamai HD Network时,目标的流名子的格式必须为[name]_[angle]_[bitrate]

  • [name] 可以是任何字符,但必须在所有直播流中保持唯一,这样Akamai HD Network 将把它当作一个不同的直播流。
  • [angle] 可以是任何字符,但建议用它来标识视频的摄像角度。
  • [bitrate] 是音视频流的总码率,单位为kbps。
  • 下划线(_) 是唯一合法的分割符。

在总码率(bitrate)之后的任何字段都将被忽略。如果流的名字没有严格采用这个格式,那这个流是无法播放成功的。
如果你推流到original AMS network, 将akamai.hdNetwork 设置为 false 可以使得流的名字不用按照以上的格式的限制。
对于多码率自适应传输,映射条目会略有些复杂,它要确保这几个流的关键帧是对齐的。www.wowza.cn 举个例子,有下面这三个码率自适应流:

  • myStream_480p: 500Kbps
  • myStream_360p: 750Kbps
  • myStream_720p: 1000Kbps

推送到Akamai,并保持关键帧对齐的映射条目如下:
myStream_480p={profile:"rtmp-akamai", streamName:"myStream_1_500", akamai.streamId:12345, userName:"myUser", password:"myPassword", adaptiveStreaming:true, sendOriginalTimecodes:true, originalTimecodeThreshold:0x100000}
myStream_360p={profile:"rtmp-akamai", streamName:"myStream_1_750", akamai.streamId:12345, userName:"myUser", password:"myPassword", adaptiveStreaming:true, sendOriginalTimecodes:true, originalTimecodeThreshold:0x100000}
myStream_720p={profile:"rtmp-akamai", streamName:"myStream_1_1000", akamai.streamId:12345, userName:"myUser", password:"myPassword", adaptiveStreaming:true, sendOriginalTimecodes:true, originalTimecodeThreshold:0x100000}

播放这些流(RTMP):


要用RTMP播放这些Akamai network 提供的流,你可以用以下Akamai 提供的播放器:

  • 针对 new HD network:
  • 针对以前的Flash network:
    • http://support.akamai.com/flash/index.html. You must create the stream URL from the streamName and streamID specified in your map file and from the hostname found in the Akamai configuration screens, in the following form:
      rtmp://<HostName>/<streamName>@<streamID>

采用Adobe HDS播放流:


要用Adobe HDS播放Akamai network 提供的流(只针对HD network), 你可以使用下面的Akamai 测试播放器: http://mediapm.edgesuite.net/edgeflash/public/zeri/debug/Main.html. 你必须用在映射条目中定义的streamID、[name] 、[angle] 组合为一个播放的留名字。在Akamai 的配置界面中可以找到主机地址, 播放URL格式如下:
http://<HostName>.akamaihd.net/z/[name]_[angle]@<streamID>/manifest.f4m

注意: ;假定你的Akamai配置中已经启用了HDS传输。

采用Apple HLS播放流:


要用Apple HLS(仅针对HD network)播放Akamai network 提供的流,你可以使用任何一个HLS 播放器,例如stock iOS media player 或 Safari。www.wowza.cn 你必须用在映射条目中定义的streamID、[name] 、[angle] 组合为一个播放的留名字。在Akamai 的配置界面中可以找到主机地址, 播放URL格式如下:
http://<HostName>.akamaihd.net/i/[name]_[angle]@<streamID>/master.m3u8

注意: 假定你的Akamai配置中已经启用了HLS传输。

Akamai HTTP (Apple HLS, Adobe HDS)

要推送Apple HLS 或 Adobe HDS 到Akamai,在映射条目上你必须要使用cupertino-akamaisanjose-akamai profile。 这些profile被预设为推流到Akamai HD Network。 为了保证这个推流正常运行,Wowza media server 上的应用必须是一个直播应用,并且必须在配置文件的<Stream>/LiveStreamPacketizers中启用cupertinolivestreampacketizersanjoselivestreampacketizer。 如果这个配置没有被启用,那么在推流时在Log中会有相应的警告信息。

Streams pushed to Akamai must be provisioned through the Luna Control Center. Be sure to use the appropriate configuration type for each stream. For example, Apple HLS streams must be configured as HD iPhone/iPad Live. You must also provision a stream with the following information:

  • StreamId
  • HostId

StreamIdStream Name中(@)符后面的部分,HostIdHost Name / Status 的值。 你不需要自己输入HostId信息。 如果没有设置,HostId 将会用默认的example-i。 在这个例子中,我们将使用我们已经创建的用于测试的Apple HLS 流,并采用下面的配置:

  • StreamId: 215930
  • HostId: wowzadevapple-i

在映射条目中只需要这两个信息。

推送cupertino-akamai的映射条目例子:
myStream={profile:"cupertino-akamai", streamName:"myStreamHLS", cupertino.renditions:"audiovideo", akamai.streamId:215930, akamai.hostId:"wowzadevapple-i", akamai.eventName:"test", adaptiveGroups:"group2", debugLog:false}

推送sanjose-akamai 的映射条目例子:
myStream={profile:"sanjose-akamai", streamName:"myStreamHDS", sanjose.representationId:"myRep", akamai.streamId:123456, akamai.hostId:"wowzadevhds-i", akamai.eventName:"test", adaptiveGroups:"group1", debugLog:true}

The definitions for these fields are in the table at the top of this article. However, the adaptiveGroups field requires some additional explanation.

The adaptiveGroups field is a method for creating adaptive bitrate streams from single bitrate pushes. It groups all the streams that use the same adaptive group name into a single adaptive bitrate stream with a unique adaptive bitrate playback URL. The URL formats are enumerated above. A single stream can belong to multiple adaptive bitrate groups. All streams in the same adaptive bitrate group must share the same akamai.streamId, akamai.hostId, akamai.eventName, and akamai.sendToBackupServer (if defined). Following is an example of a set of HLS streams that result in two adaptive groups—group1 and group2:
myStream1={profile:"cupertino-akamai", streamName:"myStream1", cupertino.renditions:"audiovideo", akamai.streamId:215930, akamai.hostId:"wowzadevapple-i", akamai.eventName:"test", adaptiveGroups:"group1", debugLog:false}
myStream2={profile:"cupertino-akamai", streamName:"myStream2", cupertino.renditions:"audiovideo", akamai.streamId:215930, akamai.hostId:"wowzadevapple-i", akamai.eventName:"test", adaptiveGroups:"group1|group2", debugLog:false}
myStream3={profile:"cupertino-akamai", streamName:"myStream3", cupertino.renditions:"audiovideo", akamai.streamId:215930, akamai.hostId:"wowzadevapple-i", akamai.eventName:"test", adaptiveGroups:"group2", debugLog:false}

In this example, group1 includes myStream1 and myStream2, and group2 includes myStream2 and myStream3.

You can also control how many items are maintained in a stream's playlist by using the http.playlistCount settings. By default, the value of http.playlistCount is set to 0, which maintains a sliding window live stream that has three segments. Set this to higher values to maintain a longer DVR playlist on Akamai for DVR functionality. You can also set http.playlistAcrossSessions to true to instruct the push publisher to try to maintain a playlist across push publishing sessions. The http.playlistTimeout is used to control the time limit for how long non-running playlists are maintained.

Example cupertino-akamai map entry that uses many of the configuration options:
myStream={profile:"cupertino-akamai", streamName:"myStream", cupertino.renditions:"audiovideo|audioonly", akamai.streamId:215930, akamai.hostId:"wowzadevapple-i", akamai.destinationServer:"redundant", akamai.eventName:"test", http.playlistCount:10, http.playlistAcrossSessions:true, adaptiveGroups:"group1|group2", debugLog:true}

EdgeCast

To push to EdgeCast, use the rtmp profile. The rtmp profile is pre-configured to push to an RTMP CDN. When pushing to EdgeCast, the following account information is required:

  • Host
  • ApplicationID
  • StreamName
  • Live Authentication Key

Following is an example entry to push the stream myStream to EdgeCast, assuming these credentials:

  • Host: fso.lax.0001.edgecastcdn.net
  • ApplicationID: 200001
  • StreamName: myStream
  • Live Authentication Key: 0123456

Example map entry:
myStream={profile:"rtmp", host:"fso.lax.0001.edgecastcdn.net", application:200001, streamName:"myStream?0123456", originalTimecodeThreshold:0x100000}

To playback the stream:


  1. Open [install-dir]/examples/LiveVideoStreaming/FlashRTMPPlayer/player.html.
  2. Enter the address in the Server box as rtmp://fml.0001.edgecastcdn.net:1935/ApplicationId/.
  3. Enter the stream name in the Stream box.
  4. Click Connect.

Level 3

To push to Level 3, use the rtmp profile. When pushing to Level 3, the following account information is required:

  • User Name
  • Password
  • Host
  • Application

Following is an example entry to push the stream myStream to Level 3, assuming these credentials:

  • User Name: myUser
  • Password: myPassword
  • Host: level3entry.com
  • Application: myaccount

Example map entry:
myStream={profile:"rtmp", streamName:"myStream", host:"level3entry.com", application:"myaccount", userName:"myUser", password:"myPassword", originalTimecodeThreshold:0x100000}

Streaming services


Livestream

To push to the original LiveStream platform, use the rtmp profile and the following map file entry information.

  • Host: publish.livestream.com
  • Application: mogulus
  • appInstance: myChannel/username=myUser/password=myPassword/isAutoLive=true

Note: Other options can be added to this, such as /aspectWidth=4, aspectHeight=3, and so on.
Example map entry:
myStream={profile:"rtmp", host:"publish.livestream.com", application:"mogulus", appInstance:"myChannel/username=myUser/password=myPassword/isAutoLive=true"}

To playback the stream:


Login to your Livestream account, and go to the Channel page.

Justin.tv

To push to Justin.tv, use the rtmp profile. On the channel Setup page, find the Stream Key link and use it as the stream name.

  • StreamName: ExampleStringKeyKFMpfXrssJhbq

Example map entry:
myStream={profile:"rtmp", host:"live.justin.tv", application:"app", streamName:"ExampleStringKeyKFMpfXrssJhbq"}

To playback the stream:


Login to your Justin.tv account and go to the Channel page. You should see the the live video start to play after an advertisement.

UStream.tv

To push to UStream.tv, use the rtmp profile. On the UStream Dashboard for your channel, find the Remote tab and get the URL and Stream Key. They will look something like this:

  • URL: rtmp://1.2345.fme.ustream.tv/ustreamVideo/67890
  • StreamName: ExampleStringKeyKFMpfXrssJhbq

The streaming URL is broken into the following components in the map data:

  • Host: 1.2345.fme.ustream.tv
  • Application: ustreamVideo
  • AppInstance: 67890

Example map entry:
myStream={profile:"rtmp", host: "1.2345.fme.ustream.tv", application:"ustreamVideo", appInstance: 67890, streamName:"ExampleStringKeyKFMpfXrssJhbq", originalTimecodeThreshold:0x100000}

To playback the stream:


Login to your Ustream account and go to the Channel page. You should see the the live video start to play after an advertisement.

Note: Ustream supports a ping/pong keepalive method. You can set the UstreamPingPong parameter to false to disable usage of this method.

YouTube Live

To push to YouTube Live, use the rtmp profile. After your account is created, you'll receive a Stream Name and two URLs. They will look something like this:

  • URL: rtmp://a.rtmp.youtube.com/live2
  • Backup URL: rtmp://b.rtmp.youtube.com/live2?backup=1
  • StreamName: myaccount.u8w0-z0pr-c4qx-7jt1

The streaming URLs are broken into the following components in the map data:

  • Host: a.rtmp.youtube.com
  • Application: live2

Example map entry:
myStream={profile:"rtmp, host:"a.rtmp.youtube.com", application:"live2", streamName:"myaccount.u8w0-z0pr-c4qx-7jt1"}

For more information, see How to use Push Publishing AddOn with YouTube.