How to set up a Flash application to publish H.264 video and Speex audio to Wowza Transcoder

Steps for transcoding an RTSP, native RTP, or MPEG-TS stream with Wowza Transcoder.

  1. In the Wowza media server software, create an application named live.
     
    1. Set <Streams>/<StreamType> to live.
       
    2. Set <Streams>/LiveStreamPacketizers> to cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer,mpegdashstreamingpacketizer.
       
      Note: You can exclude packetizers that you won't be using. The mpegdashstreamingpacketizer is only supported in Wowza Streaming Engine™ software.
    3. Set <Transcoder>/<LiveStreamTranscoder> to transcoder.
       
    4. Set <Transcoder>/<Templates> to transcodeAudio.xml.

    Many IP cameras have H.264 video but an audio codec that's not supported in Flash, iOS, and Silverlight players. Refer to the "Audio (decoding)" list in the Wowza Transcoder overview. This template transcodes this kind of carrier.
     
  2. Create a file named transcodeAudio.xml in the /transcoder/templates folder.
     
  3. Copy the following XML code into transcodeAudio.xml. It configures a Transcoder template with one Encode block. The <Video>/<Codec> is set to PassThru and <Video>/<BitRate> is set to ${SourceVideoBitrate}. The <Video>/<Profile> is changed to baseline. The <Audio>/<Codec> is AAC to transcode the unsupported audio codec.
    <Root>
    	<Transcode>
    		<Encodes>
    			<Encode>
    				<Enable>true</Enable>
    				<Name>RTP</Name>
    				<StreamName>mp4:${SourceStreamName}_rtp</StreamName>
    				<Video>
    					<!-- H.264, PassThru -->
    					<Codec>PassThru</Codec>
    					<!-- default, QuickSync, NVENC -->
    					<Implementation>default</Implementation>
    					<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>
  4. Start the Wowza media server software in standalone mode (/bin/startup.bat).
     
  5. Start the RTSP, native RTP, or MPEG-TS stream using Stream Manager 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 the Transcoder start in the console running the Wowza media server when you start camera.stream in Stream Manager.
     
  6. Play the stream.

    Playback with the example Flash RTMP player [install-dir]/examples/LiveVideoStreaming/FlashRTMPPlayer/player.html

     
    Server: rtmp://[wowza-ip-address]:1935/live
    Stream: camera.stream_rtp

    Playback in iOS device

     
    http://[wowza-ip-address]:1935/live/camera.stream_rtp/playlist.m3u8

    Playback with Microsoft Silverlight

     
    http://[wowza-ip-address]:1935/live/camera.stream_rtp/Manifest

    Playback in Adobe Flash OSMF player

     
    http://[wowza-ip-address]:1935/live/camera.stream_rtp/manifest.f4m

Originally Published: 11-03-2011.
 

If you're having problems or want to discuss this article, post in our forum.