Transcode only the audio channel of an incoming stream with Wowza Streaming Engine

Wowza Streaming Engine™ media server software can transcode only the audio portion of the stream. The default audio-only template that comes with Wowza Streaming Engine enables you to ingest a source stream with G.711 (µ-law and A-law)/MPEG-1 Layer 1/2/MPEG-1 Layer 3 (MP3)/Vorbis/Opus audio and convert it to AAC for compatibility with additional player technologies. If your source stream includes video, it's ignored by Transcoder when using this template. This article describes how to use the default audio-only template to create AAC audio stream renditions and play them with different player technologies.

Configure the Transcoder


Transcoder uses a templating system to match incoming streams to an encoding template that controls the encoding parameters of the resultant transcoded streams. Wowza Streaming Engine has default templates for the most common workflows, including an audio-only transcoding workflow. The default audio only template is specifically intended to ingest a supported audio stream and an H.264 video stream (as passthrough) and convert the audio format to AAC.

Enable the Transcoder

 
  1. In the Applications contents panel in Wowza Streaming Engine Manager, select your live application, and then click Transcoder.
  2. On the details page, click Enable Transcoder.



     
  3. Restart the application when prompted.

Configure the Transcoder to use the audio-only template

 
  1. Click the Applications tab at the top of the page in Wowza Streaming Engine Manager, and then select your application in the contents panel.
     
  2. In the contents panel, click Transcoder, and then click Edit.



     
  3. Clear the Match source stream name to template name check box, and set the Fallback Template to Audio Only (Default). This means that all incoming streams will use the default audio-only template.


     
  4. Click Save, and restart the application when prompted.

Configure the encoding preset

The default audio-only template has one encoding preset (aac), which transcodes the audio channel of your source stream to AAC and passes the video channel through (if there is one).

Important: The aac encoding preset can be used with the default settings. No additional configuration is required to produce AAC audio renditions of your stream.

The default aac encoding preset has the following settings:

  • Preset Nameaac
     
  • Outgoing Stream Namemp4:${SourceStreamName}_aac. This names the transcoded stream by appending _aac to the end of the source stream's name. For example, myStream_aac.
     
  • Video CodecPassthrough. Passes the source video, if present, through to the output renditions without any changes. Because the video is ignored by default, no other video-related settings are configured. Setting the Video Codec to Disabled removes any video that's present from the transcoded stream.
     
  • Audio Codec – AAC
     
  • Audio Bitrate – 48000
Note: To resample audio, you can add the <Resample> property to the encoding preset within the <Audio> container element and set the <Enable> property to true. This must be done by editing the template's XML configuration directly.
<Resample>
   <Enable>true</Enable>
   <SampleRate>48000</SampleRate>
   <Channels>2</Channels>
</Resample>

If you want, you can edit the default aac encoding preset or create new encoding presets. However, if you change an encoding preset's Video Codec to a value other than Passthrough or Disabled, the video and audio will both be transcoded. If that's what you want to do, consider using the other default templates that are designed for transcoding both video and audio instead. See Configuring the Transcoder in Wowza Streaming Engine Manager.

For more information about editing an existing encoding preset or creating a new encoding preset, see Configure an encoding preset.

XML configuration

Note: If you configured the audio only templates in Wowza Streaming Engine Manager, you can skip this section. If you make changes to transcoder template files in a text editor and you're using Wowza Streaming Engine software, any supported settings are displayed in the manager the next time it's started. 

The default audio-only template ([install-dir]/transcoder/templates/audioonly.xml) has the following layout and contents:

<?xml version="1.0" encoding="UTF-8" ?>
<!-- Example template for audio only transcoding to AAC from any support audio codec -->
<Root version="1">
    <Transcode>
        <Description>Default audioonly.xml file</Description>
        <PostProcess>
            <SortBuffer>
                <Enable>true</Enable>
                <!-- milliseconds -->
                <BufferSize>750</BufferSize>
                <FlushInterval>75</FlushInterval>
            </SortBuffer>
        </PostProcess>
        <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, H.265, VP8, VP9, PassThru, Disable -->
                    <Codec>PassThru</Codec>
                    <Bitrate>${SourceVideoBitrate}</Bitrate>
                    <Parameters>
                    </Parameters>
                </Video>
                <Audio>
                    <!-- AAC, Vorbis, Opus, PassThru, Disable -->
                    <Codec>AAC</Codec>
                    <Bitrate>48000</Bitrate>
                    <Parameters>
                    </Parameters>
                </Audio>
                <Properties>
                </Properties>
            </Encode>
        </Encodes>
        <Decode>
        </Decode>
        <StreamNameGroups>
        </StreamNameGroups>
        <Properties>
        </Properties>
    </Transcode>
</Root>

Before this template can be used in a transcoding session, it must be specified in the Transcoder section of your live application.

  1. Using a text editor, open [install-dir]/conf/[application]/Application.xml and set the <Transcoder>/<LiveStreamTranscoder> to transcoder:
    <LiveStreamTranscoder>transcoder</LiveStreamTranscoder>
  2. Next, set the <Transcoder>/<Templates> to audioonly.xml:
    <Templates>audioonly.xml</Templates>
  3. Save the changes just made.

Playing streams produced by the audio only template


Playback URLs for AAC stream renditions

To play the stream renditions produced by the default audio only template, the URLs using each of the player technologies would be the following:

HLS

http://[wowza-ip-address]:1935/myApplication/myStream_aac/playlist.m3u8

MPEG-DASH

http://[wowza-ip-address]:1935/myApplication/myStream_aac/manifest.mpd

Where [wowza-ip-address] is the IP address of your Wowza Streaming Engine server and myStream_aac is the name of the stream rendition produced by the audio only template.

Note: By default, the name of a stream rendition produced by the audio only template is a combination of the source stream name (for example, myStream), followed by an underscore (_) and the encoding preset name (aac).

HLS

For streams that you deliver to iOS-based devices, use the following encoding settings:

  • Video:
    • Apple iPhone, iPod, and iPod touch – Use H.264 Baseline Profile Level 3.0 and don't use B-frames
    • Apple iPad — Use H.264 Main Profile Level 3.1
  • Audio: AAC-LC up to 48 kHz, stereo audio

For streams you deliver to Android devices, you might need to add the cupertinoPacketizeAllStreamsAsTS property to your application. For more information, see Improving bitrate switching between audio streams.

If you're unsuccessful getting your transcoded renditions to play and your outgoing stream doesn't need to include video, you can create an audio-only stream that complies with the Apple App Store requirements using the method described in Create Apple App Store compliant streams (audio only rendition) with Wowza Streaming Engine.