How to transcode only the audio channel of an incoming stream

With Wowza Streaming Engine™ live streaming software, you can use Wowza™ Transcoder to transcode only the audio portion of the stream. The default audio only template that comes with Wowza Streaming Engine software enables you to ingest a source stream with G.711 (µ-law and A-law)/MPEG-1 Layer 1/2/MPEG-1 Layer 3 (MP3)/Speex/Vorbis/Opus audio and convert it to AAC for compatibility with additional player technologies. If your source stream includes video, it's ignored by the 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.

Notes:

Contents


Create a live application in Wowza Streaming Engine to ingest the live source video
Configure the Transcoder in Wowza Streaming Engine Manager Playing streams produced by the audio only template

Create a live application in Wowza Streaming Engine to ingest the live source


You must set up an encoder that publishes a live stream to an application in the Streaming Engine for transcoding. Use the tutorial below that matches your encoder to create a live streaming application named live in Wowza Streaming Engine:
 

Configure the Transcoder in Wowza Streaming Engine Manager


Wowza Transcoder uses a templating system to match incoming streams to an encoding template that controls the encoding parameters of the resultant transcoded streams. Wowza media server software 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

To enable the Transcoder, do the following:
 
  1. In the Applications contents panel, click live, and then click Transcoder. Then in the details page, click Enable Transcoder.


     
  2. Restart the application when prompted.

Configure the Transcoder to use the audio only template

To configure the Transcoder to use the audio only template in Wowza Streaming Engine Manager, do the following:
 
  1. Sign in to the Wowza Streaming Engine Manager, click the Applications tab at the top of the page, and then click live in the contents panel.
     
    Note: This article uses the live application that installs with Wowza Streaming Engine. If you want to use a different live application, select it instead from 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 present).
 
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 Name - aac
     
  • Outgoing Stream Name - mp4:${SourceStreamName}_aac. This names the transcoded stream by appending _aac to the end of the source stream's name. For example, myStream_aac.
     
  • Video Codec - Passthrough. This means the source video, if present, is passed 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 video (if present) from the transcoded stream.
     
  • Audio Codec - AAC
     
  • Audio Bitrate - 48000
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. Wowza Media Server™ software doesn't support Wowza Streaming Engine Manager, so you must edit the transcoder template files in a text editor if you're running Wowza Media Server.
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.263, 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 within 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:

Adobe Flash Player (Adobe HDS/San Jose)
http://[wowza-ip-address]:1935/live/myStream_aac/manifest.f4m
Apple iOS device (Apple HLS/Cupertino)
http://[wowza-ip-address]:1935/live/myStream_aac/playlist.m3u8
Microsoft Silverlight (Smooth Streaming)
http://[wowza-ip-address]:1935/live/myStream_aac/Manifest
DASH players (DASH Streaming)
http://[wowza-ip-address]:1935/live/myStream_aac/manifest.mpd
Where [wowza-ip-address] is the IP address of your Wowza media 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).

Apple HLS

For streams that you intend to deliver to iOS-based devices be sure to use the following encoding settings:
 
  • Video:
     
    • Apple iPhone, iPod, and iPod touch - H.264 Baseline Profile Level 3.0. Don't use B-frames when targeting iPhone and iPod devices.
    • Apple iPad - H.264 Main Profile Level 3.1
  • Audio: AAC-LC up to 48 kHz, stereo audio
For streams you intend to play on 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 is compliant with the Apple App Store requirements using the method described in How to create Apple App Store compliant streams.

Microsoft Smooth Streaming

For streams that you intend to deliver to Microsoft Silverlight players (Smooth Streams), your encoding must have both audio and video and the keyframe interval (GOP size) must be between 1 and 4 seconds (we recommend a keyframe frequency of 2 seconds).

If your stream doesn't have video, you must make it behave like it does. To accomplish this, you can use the ModuleAVMix module to create a video stream and attach it to your audio-only stream(s). For more information, see How to mix audio and video from different live sources.
Originally Published: For Wowza Streaming Engine on 11-03-2016.
 

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