How to set up a Flash application to publish H.264 video and Speex audio to Wowza Transcoder AddOn
Published on 11-03-2011 03:37 PM
Number of Views: 7909
Transcoding an RTSP, native RTP or MPEG-TS stream with the Wowza Transcoder.
- In Wowza Media Server, create an application named "live"
- /Streams /StreamType "live"
- /Streams /LiveStreamPacketizers "cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer"
(You can exclude packetizers that you will not be using)
- /Transcoder /LiveStreamTranscoder "transcoder"
- /Transcoder /Templates "transcodeAudio.xml"
Many IP cameras have h.264 video but an audio codec that is not supported in Flash, iOS and Silverlight players. Refer to the list Audio (decoding) in the Transcoder Overview. This template will transcode this kind of carrier
- Create a file named "transcodeAudio.xml" in the /transcoder/templates folder then copy the xml below to this new file.
This Transcoder template has just one Encode block. The /Video /Codec set to "PassThru" and /BitRate "${SourceVideoBitrate}", only the /Profile is changed to "baseline". The /Audio /Codec is "AAC" to transcode the unsupported audio codec.
Code:
<Root>
<Transcode>
<Encodes>
<Encode>
<Enable>true</Enable>
<Name>RTP</Name>
<StreamName>mp4:${SourceStreamName}_rtp</StreamName>
<Video>
<!-- H.264, PassThru -->
<Codec>PassThru</Codec>
<!-- default, CUDA, QuickSync -->
<Transcoder>default</Transcoder>
<FrameSize>
<!-- letterbox, fit-width, fit-height, crop, stretch, match-source -->
<FitMode>fit-height</FitMode>
<Width>320</Width>
<Height>240</Height>
</FrameSize>
<Profile>baseline</Profile>
<Bitrate>${SourceVideoBitrate}</Bitrate>
<KeyFrameInterval>
<FollowSource>true</FollowSource>
<Interval>60</Interval>
</KeyFrameInterval>
<Overlays>
<Overlay>
<Enable>false</Enable>
<Index>0</Index>
<ImagePath>${com.wowza.wms.context.VHostConfigHome}/content/wowzalogo.png</ImagePath>
<Opacity>100</Opacity>
<Location>
<X>5</X>
<Y>5</Y>
<Width>${ImageWidth}</Width>
<Height>${ImageHeight}</Height>
<!-- horiz: left, right, hcenter - vert: top, bottom, vcenter -->
<Align>left,top</Align>
</Location>
</Overlay>
</Overlays>
<Parameters>
</Parameters>
</Video>
<Audio>
<!-- AAC, PassThru -->
<Codec>AAC</Codec>
<Bitrate>${SourceAudioBitrate}</Bitrate>
</Audio>
<Properties>
</Properties>
</Encode>
</Encodes>
<Decode>
<Video>
<Deinterlace>false</Deinterlace>
<Overlays>
<Overlay>
<Enable>false</Enable>
<Index>0</Index>
<ImagePath>${com.wowza.wms.context.VHostConfigHome}/content/wowzalogo.png</ImagePath>
<Opacity>100</Opacity>
<Location>
<X>5</X>
<Y>5</Y>
<Width>${ImageWidth}</Width>
<Height>${ImageHeight}</Height>
<!-- horiz: left, right, hcenter - vert: top, bottom, vcenter -->
<Align>left,top</Align>
</Location>
</Overlay>
</Overlays>
<Parameters>
</Parameters>
</Video>
<Properties>
</Properties>
</Decode>
<Properties>
</Properties>
</Transcode>
</Root>
- Start Wowza in stand-alone mode (/bin/startup.bat)
- Start the RTSP, native RTP or MPEG-TS stream using StreamManager with MediaCaster type "rtp" on Application "live/_definst_"
For this example, the stream is camera.stream, a text file that contains the RTSP URL to an IP camera with h.264 video and G.711 audio. You should see Transcoder start in the console running Wowza when you start camera.stream in StreamManager.
- Playback
- Playback with Wowza /examples/LiveVideoStreaming/client/live.html
Server: rtmp://[wowza-address]:1935/live
Stream: camera.stream_rtp
- Playback in iOS
Code:
http://[wowza-address]:1935/live/camera.stream_rtp/playlist.m3u8
- Playback Smooth streaming in Silverlight
Code:
http://[wowza-address]:1935/live/camera.stream_rtp/Manifest
- Playback in SanJose streaming in Flash OSMF player
Code:
http://[wowza-address]:1935/live/camera.stream_rtp/manifest.f4m
Wowza Media