400 028 6601

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

Howtopublishandplayalivestream(MPEG-TSbasedencoder)

  1. 英文原版配置,最后有简单操作步骤

    创新互联是专业的灯塔网站建设公司,灯塔接单;提供成都网站制作、网站设计、外贸网站建设,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行灯塔网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

This tutorial provides the basic steps for using a live encoder that publishes a stream using the MPEG2 Transport Stream protocol (MPEG-TS). Follow these steps to setup an application named live to stream live content to Adobe Flash player, Microsoft Silverlight player, Apple iOS devices, and RTSP/RTP based players & devices.

Updated for Wowza Media Server 2.2.0 (19 November 2010)

  1. Create application folder [install-dir]/applications/live

  2. Create configuration folder [install-dir]/conf/live and copy [install-dir]/conf/Application.xml into this new folder

  3. Edit the newly copied Application.xml file and make the following changes (some of these settings may already be present):

  1. Set the Streams/StreamType property to: live
    Code:
    live

  2. Set the HTTPStreamers property to: cupertinostreaming, smoothstreaming, sanjosestreaming
    Code:
    cupertinostreaming,smoothstreaming,sanjosestreaming

  3. Set the Streams/LiveStreamPacketizers property to: cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer:
    Code:
    cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer
    Note cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer are used for iOS, Silverlight and Flash HTTP clients. You can remove packetizers that you don't need.

  4. Set the RTP/Authentication/PlayMethod to: none
    Code:
    none
    Download: Right click Application.xml to download a pre-configured version of Application.xml.

  1. Using a text editor, create the file [install-dir]/content/mpegts.stream (有多个流的话此名称做如下变化test.stream test2.stream,mpegts可随意变化,stream不能变动)set the contents of this file to udp://0.0.0.0:10000 (if you are receiving a multicast stream, change the 0.0.0.0 part to the multicast address of the stream)(0.0.0.0可以设置成VLC的服务器IP,端口也可改变,但需要vlc也做相应改变)

  2. Using a text editor, edit the file [install-dir]/conf/admin.password and add a username and password that will be used to start and stop the publishing of the MPEG-TS stream (below is an example of the file with the username myuser and password mypassword):
    Code:
    # Admin password file (format [username][space][password])
    # username password
    myuser mypassword

  3. Start Wowza Media Server 2

  4. Configure the MPEG-TS based encoder to send a live stream to the IP address of the server running Wowza Server using port 10000

  5. Use the Stream Manager to start the MPEG-TS stream

  1. 在浏览器中打开 http://[wowza-address]:8086/streammanager,输入用户名、密码,做下面配置

  1. Open a web browser and enter the url: http://[wowza-address]:8086/streammanager

  2. Enter your admin username and password from above

  3. Click the [start-receiving-stream] link just below the live application folder

  4. Select the MediaCaster Type: rtp

  5. Enter mpegts.stream into the Stream Name field

  6. Click OK

Publishing:

Playback:

Multi-bitrate Live Streaming

Multi-bitrate live streaming to Flash, Apple iOS devices and Silverlight requires that you have an encoder that can generate multiple bitrate streams from the same source that are properly key-frame aligned. Once you have an encoder that can generate properly aligned streams then you need to create a Synchronized Multimedia Integration Language (SMIL) file that links the streams together for playback.

For example, let's say we have three live streams encoded at three different bitrates myStream_700.stream (700kbps total bitrate), myStream_350.stream(350kbps total bitrate) and myStream_200.stream (200kbps total bitrate). Using a text editor, create a SMIL file in the [install-dir]/content folder with the namemyStream.smil with the following content:

Code:


       
       
       
               
                       

       

You can see that there is a

Note: Silverlight Smooth Streaming will only switch between the video portion of the streams. The audio track of the first stream listed in the container will be used. If you want to use a stream other then the first stream for the audio track, add an

Code:


       
       
       
               
                       

       

Note: By default Silverlight Smooth Streaming will calculate video and audio bitrates for the Manifest data on the fly by inspecting the file. If you would like to instruct Wowza Server to use the bitrates in the SMIL file, add the following property to the HTTPStreams/Properties container in [install-dir]/conf/[application]/Application.xml (be sure to get the correct properties container - there are several in the Application.xml file). When running in this mode, Wowza will assume the video and audio system-bitrate values are only for the video and audio data only:

Code:


       smoothStreamingUseSMILBitrates
       true
       Boolean

Note: When streaming out using RTSP/RTP you can force the output to MPEG-TS (which is needed by many set-top boxes) by adding the following two properties to the RTP/Properties (be sure to get the correct container) in [install-dir]/conf/[application]/Application.xml:

Code:


       forceMPEGTSOut
       true
       Boolean


       rtpWrapMPEGTS
       true
       Boolean

Note: Wowza Server can output AAC audio using two different packetization methods; mpeg4-generic and mp4a-latm (3gpp). The default packetization method ismpeg4-generic. To switch to mp4a-latm (3gpp) add the following property to the RTP/Properties container in [install-dir]/[application]/Application.xml (be sure to get the correct Properties container - there are several in Application.xml):

Code:


       audioPacketizerAAC
       com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LATM

Note: Some MPEG-TS based encoders send out video and audio in such a way that the media frames are not aligned on PES packet boundaries. This will cause the video and audio to not play. Wowza Server can re-aligned unaligned streams but it requires a property be added to [install-dir]/conf/[application]/Application.xml to enable this feature.

To turn on the code to fix audio alignment, add the following property to the RTP/Properties container in [install-dir]/[application]/Application.xml (be sure to get the correct Properties container - there are several in Application.xml):

Code:


               audioIsAligned
               false
               Boolean

To turn on the code to fix video alignment, add the following property to the RTP/Properties container in [install-dir]/[application]/Application.xml (be sure to get the correct Properties container - there are several in Application.xml) (Wowza Media Server 3 or greater is required):

Code:


               videoIsAligned
               false
               Boolean

Note: Some (not many) MPEG-TS encoders send do not properly align TS packets in UDP packets. When this happens you will see lots of the following warning messages in the logs:

Code:

RTPDePacketizerMPEGTS.handleRTPPacket: Out of sync: 0x[nn]

Add the following property to the RTP/Properties container in [install-dir]/[application]/Application.xml (be sure to get the correct Properties container - there are several in Application.xml):

Code:


       rtpDePacketizerWrapper
       com.wowza.wms.rtp.depacketizer.RTPDePacketizerWrapperReChunkMPEGTS

Wowza Server only allows a single rtpDePacketizerWrapper value. If you have setup a jitter buffer or packet recorder that uses the samertpDePacketizerWrapper they must be removed.

Optional Configuration for Flash RTMP Clients Only

If your application will only stream to Flash RTMP clients you can, optionally, change StreamType "rtp-live", then you will not need to use StreamManager (steps 8a-f above). The first Flash client that plays the stream will trigger Wowza to start re-streaming.

Code:

rtp-live

Also make the /conf/[app-name]/Application.xml /Streams /LiveStreamPacketizers empty:

Code:

源文档

  1. 简单中文操作步骤参考

第一步:建立发布点application、conf目录下建立发布点live

第二步:修改conf/live下的Application。xml

第三步:在content下建立mpegts.stream(流),mpegts可以随意修改,stream不可修改。修改文件内容为udp://0.0.0.0:10000(地址和端口都是vlc的)

第四步:打开http://wowzaip:8086/streammanager添加rtp流,流名称填写mpegts.stream(或自定义的流名称)

第五步:播放,rtmp://wowzaip:1935/live/mpegts.stream

<>

<>

VLC编码配置

vlc -vvv "mms://lmdb.nbradio.com/jjpd" --sout

"#transcode{venc=x2

64{keyint=60,profile=baseline,level=3.0,nocabac},vcodec=x264,vb=150,scale=0.5,acodec=mp4a,ab=96,channels=2,samplerate=48000}:rtp{dst=192.168.0.52,port=10000,mux=ts}"

dst=192.168.0.52指wowza服务器IP

port=10000 指端口,可进行变化,变化收[wowza-install]/content/mpegts.stream 中的端口也需要变化。


标题名称:Howtopublishandplayalivestream(MPEG-TSbasedencoder)
网站链接:http://mzwzsj.com/article/iipocd.html

其他资讯

让你的专属顾问为你服务