# Generating audio-only stream with HLS adaptive bitstream

**URL:** <https://community.wowza.com/t/generating-audio-only-stream-with-hls-adaptive-bitstream/34901>\
**Category:** Wowza Streaming Engine\
**Created:** [July 24, 2013, 5:11pm UTC](https://community.wowza.com/t/generating-audio-only-stream-with-hls-adaptive-bitstream/34901 "2013-07-24T17:11:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Buckle](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Simon\_Buckle](https://community.wowza.com/u/Simon_Buckle)\
**Post date:** [July 24, 2013, 5:11pm UTC](https://community.wowza.com/t/generating-audio-only-stream-with-hls-adaptive-bitstream/34901/1 "2013-07-24T17:11:45Z")

</div>

I’m running the latest version of Wowza (3.6.2) on Linux and I’m using the Transcoder Add-on to generate multiple renditions of a live stream. I’m trying to produce an audio-only stream but I don’t seem to be able to get it to work.

The **live** application configuration file has the stream type set to live and the transcoder turned on. The input stream has H.264 video and AAC audio.

I added a element to the stream name group (in transrate.xml):

```auto
<StreamNameGroup>
	<Name>all</Name>
	<StreamName>${SourceStreamName}_all</StreamName>
	<Members>
		<Member>
			<EncodeName>source</EncodeName>
		</Member>
		<Member>
			<EncodeName>360p</EncodeName>
		</Member>
		<Member>
			<EncodeName>160p</EncodeName>
		</Member>
		<Member>
			<EncodeName>160p</EncodeName>
			<MediaListRendition>
				<WowzaAudioOnly>true</WowzaAudioOnly>
			</MediaListRendition>
		</Member>
	</Members>
</StreamNameGroup>

```

When I published to the **live** application, I tried to retrieve the playlist and this is what I got:

```auto
$ curl http://[wowza-ip-address]:1935/live/ngrp:myStream_all/playlist.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=726994,CODECS="avc1.77.40,mp4a.40.2",RESOLUTION=480x210
chunklist_w947278958_b726994.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=977238,CODECS="avc1.77.31,mp4a.40.2",RESOLUTION=822x360
chunklist_w947278958_b977238.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=327238,CODECS="avc1.66.21,mp4a.40.2",RESOLUTION=366x160
chunklist_w947278958_b327238.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=127238,CODECS="avc1.66.21,mp4a.40.2",RESOLUTION=366x160
chunklist_w947278958_b127238_ao.m3u8

```

The CODECS attribute of the last element, which I assume is the audio-only stream, contains the video codec information for some reason. The BANDWIDTH seems to be incorrect too. My understanding is that the audio-only stream should be 64K. I then retrieved the audio-only playlist and got this:

```auto
$ curl http://[wowza-ip-address]:1935/live/ngrp:myStream_all/chunklist_w947278958_b127238_ao.m3u8
#EXTM3U
#EXT-X-ENDLIST

```

It’s always empty. The other streams in the playlist play fine. I also tried adding my own encode block and referencing it in the stream name group but I got the same result:

```auto
<Encode>
   <Enable>true</Enable>
   <Name>audio-only</Name>
   <StreamName>mp4:${SourceStreamName}_aac</StreamName>
   <Video>
        <!-- H.264, PassThru, Disable -->
        <Codec>Disable</Codec>
        <Bitrate>${SourceVideoBitrate}</Bitrate>
        <Parameters>
        </Parameters>
    </Video>
    <Audio>
         <!-- AAC, PassThru, Disable -->
         <Codec>AAC</Codec>
         <Bitrate>64000</Bitrate>
         <Parameters>
         </Parameters>
     </Audio>
     <Properties>
     </Properties
</Encode>

```

Any thoughts?

---

<div class="post-metadata">

**Author:** ![Jason\_Hilton](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/jason_hilton/32/437_2.png) [@Jason\_Hilton](https://community.wowza.com/u/Jason_Hilton)\
**Post date:** [July 25, 2013, 10:47am UTC](https://community.wowza.com/t/generating-audio-only-stream-with-hls-adaptive-bitstream/34901/2 "2013-07-25T10:47:45Z")

</div>

Hi,

If the audio codec is already AAC you can set the audio part of the encode block called audio-only to:

PassThru

Also you will need to add this Property, completing point 1 from the following guide to the Application.xml/LiveStreamPacketizer/Properties container.

```auto
<Property>
    <Name>cupertinoCreateAudioOnlyRendition</Name>
    <Value>true</Value>
    <Type>Boolean</Type>
</Property>

```

The guide can be found here,

[https://www.wowza.com/docs/how-to-create-apple-app-store-compliant-streams](https://www.wowza.com/docs/how-to-create-apple-app-store-compliant-streams)

Please let me know how you get on with this and if your successful with publishing the audio only stream.

Jason

---

<div class="post-metadata">

**Author:** ![Simon\_Buckle](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Simon\_Buckle](https://community.wowza.com/u/Simon_Buckle)\
**Post date:** [July 25, 2013, 1:07pm UTC](https://community.wowza.com/t/generating-audio-only-stream-with-hls-adaptive-bitstream/34901/3 "2013-07-25T13:07:28Z")

</div>

Hi Jason,

Thanks for your response. I am now able to create an audio-only stream, although I had to make a few tweaks. Here’s what I did:

I set **LiveStreamPacketizer/Properties** in **Application.xml** to this:

```auto
<Property>
    <Name>cupertinoCreateAudioOnlyRendition</Name>
    <Value>true</Value>
    <Type>Boolean</Type>
</Property>

```

The first thing I did was to set the **MediaRendition/WowzaAudioOnly** to true on the 160p encode in the stream name group - so not using my custom encoder definition. Here’s what I get when I retrieve the playlist:

```auto
$ curl http://[wowza-ip-address]/live/ngrp:myStream_all/playlist.m3u8 
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=726994,CODECS="avc1.77.40,mp4a.40.2",RESOLUTION=480x210
chunklist_w1752152784_b726994.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=977238,CODECS="avc1.77.31,mp4a.40.2",RESOLUTION=822x360
chunklist_w1752152784_b977238.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=327238,CODECS="avc1.66.21,mp4a.40.2",RESOLUTION=366x160
chunklist_w1752152784_b327238.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=127238,CODECS="avc1.66.21,mp4a.40.2",RESOLUTION=366x160
chunklist_w1752152784_b127238_ao.m3u8

```

Again, the BANDWIDTH figure for the audio-only playlist is not set to the correct value and the CODECS property still contains the video codec information. My understanding is that the client uses the CODECS property to figure out which of the streams is audio only, which I am not sure it would be able to if the video codec information is present as well. However, now when I retrieve the audio-only playlist, I get the AAC segments:

```auto
$ curl http://[wowza-ip-address]/live/ngrp:myStream_all/chunklist_w1752152784_b127238_ao.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:12
#EXT-X-MEDIA-SEQUENCE:3
#EXTINF:10.88,
media_w1752152784_b127238_ao_3.aac
#EXTINF:8.36,
media_w1752152784_b127238_ao_4.aac
#EXTINF:9.76,
media_w1752152784_b127238_ao_5.aac

```

To solve the issue with the CODECS property, I modified my custom encoder to this:

```auto
<Encode>
     <Enable>true</Enable>
     <Name>audio-only</Name>
     <StreamName>mp4:${SourceStreamName}_aac</StreamName>
     <Video>
           <!-- H.264, PassThru, Disable -->
           <Codec>Disable</Codec>
           <Bitrate>0</Bitrate>
           <Parameters>
           </Parameters>
     </Video>
     <Audio>
           <!-- AAC, PassThru, Disable -->
           <Codec>AAC</Codec>
           <Bitrate>48000</Bitrate>
           <Parameters>
           </Parameters>
      </Audio>
      <Properties>
      </Properties>
</Encode>

```

I had to set the video bitrate to zero otherwise the calculated bandwidth figure came out wrong. The input audio is 48K but when I set the audio codec to ‘PassThru’ and the bitrate to ‘${SourceAudioBitRate}’ the bandwidth figure was 127238 for some reason. I then modified the stream name group to look like this:

```auto
<StreamNameGroup>
	<Name>all</Name>
	<StreamName>${SourceStreamName}_all</StreamName>
	<Members>
		<Member>
			<EncodeName>source</EncodeName>
		</Member>
		<Member>
			<EncodeName>360p</EncodeName>
		</Member>
		<Member>
			<EncodeName>160p</EncodeName>
		</Member>
		<Member>
			<EncodeName>audio-only</EncodeName>
		</Member>
	</Members>
</StreamNameGroup>

```

Now, when I retrieve the playlist I get this:

```auto
$ curl http://[wowza-ip-address]/live/ngrp:myStream_all/playlist.m3u8 
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=726994,CODECS="avc1.77.40,mp4a.40.2",RESOLUTION=480x210
chunklist_w2002670409_b726994.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=977238,CODECS="avc1.77.31,mp4a.40.2",RESOLUTION=822x360
chunklist_w2002670409_b977238.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=327238,CODECS="avc1.66.21,mp4a.40.2",RESOLUTION=366x160
chunklist_w2002670409_b327238.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=48000,CODECS="mp4a.40.2"
chunklist_w2002670409_b48000.m3u8

```

The CODECS property now only contains the audio codec information.

Thanks

---

<div class="post-metadata">

**Author:** ![Jason\_Hilton](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/jason_hilton/32/437_2.png) [@Jason\_Hilton](https://community.wowza.com/u/Jason_Hilton)\
**Post date:** [July 30, 2013, 5:25pm UTC](https://community.wowza.com/t/generating-audio-only-stream-with-hls-adaptive-bitstream/34901/4 "2013-07-30T17:25:10Z")

</div>

Hi Simon,

Thanks for the detailed update, this will help many of our other users that read this post.

Jason
