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:
    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:
    4. Set Transcoder/Templates to audioonly.xml:
  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 -->
    			<!-- Example Encode block for source, not required unless Member of StreamNameGroup. --> 
    					<!-- H.264, PassThru, Disable -->
    					<!-- AAC, PassThru, Disable -->
  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
    Test in Silverlight
    Test in Flash OSMF player
    Test in MPEG-DASH player
Originally Published: 10-31-2011.  

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