• How to convert Flash Player 11 output from H.264 + Speex audio to H.264 + AAC audio using Wowza Transcoder

    With Flash 11, you can now publish H.264 video using its built-in encoder. Previous versions of Flash were limited to Sorenson Spark video. However the audio option is still limited to Speex, which is not supported in non-Flash clients. This article shows how to set up a Flash application to publish H.264 video and Speex audio to a Wowza Transcoder application using a template to transcode the Speex audio to AAC. The video is set to Baseline 3.

    A modified version of the Wowza VideoChat clientFlex example can be downloaded here. This Flash publisher has Speex settings for Microphone, and the H.264 settings for Netstream. The stream is encoded at 320x240, 30fps, 2-second keyframe interval.

    The above download includes a ready-to-use application in the /bin-release folder, and a /src folder. To setup the source in Flash Builder, create a new application in Flash Builder.

    1. Create a new Flex Application named H264SpeexPublish.

      1. Flex SDK: 4.5.1
      2. Flex Compiler tab, set to Flash player: 11.0.0
      3. Flex Compiler tab, add compile option -swf-version=13

    2. In Wowza media server, create an application named videochat.

      1. Set Streams/StreamType to live:
        <StreamType>live</StreamType>
      2. Set Streams/LiveStreamPacketizers to cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer,mpegdashstreamingpacketizer (you can exclude packetizers that you won't be using):
        <LiveStreamPacketizers>cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, mpegdashstreamingpacketizer</LiveStreamPacketizers>
      3. Set Transcoder/LiveStreamTranscoder to transcoder:
        <LiveStreamTranscoder>transcoder</LiveStreamTranscoder>
      4. Set Transcoder/Templates to audioonly.xml:
        <Templates>audioonly.xml</Templates>

    3. Using a text editor, create a file named audioonly.xml in the [install-dir]/transcoder/templates folder with the following content:

      <!-- Example template for audio only transcoding to AAC from any support audio codec -->
      <Root>
      	<Transcode>
      		<Encodes>
      			<!-- Example Encode block for source, not required unless Member of StreamNameGroup. --> 
      			<Encode>
      				<Enable>true</Enable>
      				<Name>aac</Name>
      				<StreamName>mp4:${SourceStreamName}_aac</StreamName>
      				<Video>
      					<!-- H.264, PassThru, Disable -->
      					<Codec>PassThru</Codec>
      					<Bitrate>${SourceVideoBitrate}</Bitrate>
      					<Parameters>
      					</Parameters>
      				</Video>
      				<Audio>
      					<!-- AAC, PassThru, Disable -->
      					<Codec>AAC</Codec>
      					<Bitrate>48000</Bitrate>
      				</Audio>
      				<Properties>
      				</Properties>
      			</Encode>
      		</Encodes>
      		<Decode>
      		</Decode>
      		<StreamNameGroups>
      		</StreamNameGroups>
      		<Properties>
      		</Properties>
      	</Transcode>
      </Root>
    4. Start the Wowza media server in standalone mode (/bin/startup.bat).

    5. Connect to the videochat application with the Flash publisher in the download above, then click the Publish button. You should see Transcoder start in the console running Wowza media server.

    6. Test within the application by clicking the Play button next to testing_acc:

      Test in iOS
      http://[wowza-ip-address]:1935/videochat/testing_acc/playlist.m3u8
      Test in Silverlight
      http://[wowza-ip-address]:1935/videochat/testing_acc/Manifest
      Test in Flash OSMF player
      http://[wowza-ip-address]:1935/videochat/testing_acc/manifest.f4m
      Test in MPEG-DASH player
      http://[wowza-ip-address]:1935/videochat/testing_acc/manifest.mpd


    Originally Published: 10-31-2011.