• How to create Apple App Store compliant streams (audio only rendition)

    This article descibes a method for instructing the Wowza media server to automatically generate a multi-bitrate live and video on demand stream for delivery to Apple iOS devices. This method supports both single stream and SMIL-based streams. This feature makes it easier to get an application through the Apple AppStore. It makes it easier to generate a 64 Kbps or lower stream for conformance to the Apple AppStore rules for 3G delivery.

    Configure live streaming application

    Configure your application for live streaming using one of the following tutorials:



    Configure Application.xml

    Open [install-dir]/conf/live/Application.xml in a text editor and make the following changes:

    1. (Live only) Add the following property to the LiveStreamPacketizer/Properties container:
      Code:
      <Property>
          <Name>cupertinoCreateAudioOnlyRendition</Name>
          <Value>true</Value>
          <Type>Boolean</Type>
      </Property>
    2. Add the following properties to the HTTPStreamer/Properties container:
      Code:
      <Property>
          <Name>cupertinoAutoCreateMultibitratePlaylist</Name>
          <Value>true</Value>
          <Type>Boolean</Type>
      </Property>
      <Property>
          <Name>cupertinoUseCalculatedVideoBitrate</Name>
          <Value>true</Value>
          <Type>Boolean</Type>
      </Property>
      <Property>
          <Name>cupertinoUseCalculatedAudioBitrate</Name>
          <Value>true</Value>
          <Type>Boolean</Type>
      </Property>
      <Property>
          <Name>cupertinoDefaultVideoBitrate</Name>
          <Value>250000</Value>
          <Type>Integer</Type>
      </Property>
      <Property>
          <Name>cupertinoMaxCalculatedVideoBitrate</Name>
          <Value>0</Value>
          <Type>Integer</Type>
      </Property>
      <Property>
          <Name>cupertinoDefaultAudioBitrate</Name>
          <Value>64000</Value>
          <Type>Integer</Type>
      </Property>
      <Property>
          <Name>cupertinoMaxCalculatedAudioBitrate</Name>
          <Value>64000</Value>
          <Type>Integer</Type>
      </Property>
      <Property>
          <Name>cupertinoBitrateAdjustmentFactor</Name>
          <Value>110</Value>
          <Type>Integer</Type>
      </Property>


    With this in place, the Wowza media server will create/packetize an audio-only rendition of all incoming streams. This stream is available for use in any playlist. If you simply play any live or video on demand stream directly, the Wowza media server will generate a multi-bitrate playlist with the two renditions. One rendition will include the audio and video and the other rendition will be audio-only. As long as the audio portion of the live or video on demand stream is 64 Kbps or less, the stream will conform to Apple AppStore 3G rules.

    If you want to use Synchronized Multimedia Integration Language (SMIL) files to describe a multi-bitrate stream and use the audio from one of the live or video on demand streams as one of the playlist items, then you can add the <param name="audioOnly" value="TRUE" valuetype="data"/> statement to the <video> element in the SMIL file to select only the audio track. For example, if you have 2 live streams called hi-livestream and low-livestream and you want to create a 3 stream multi-bitrate playlist with the 3rd rendition being the audio from low-livestream, the SMIL file should look like this:
    Code:
    <smil>
        <head>
        </head>
        <body>
            <switch>
                <video src="hi-livestream" system-bitrate="500000"/>
                <video src="lo-livestream" system-bitrate="250000"/>
                <video src="lo-livestream" system-bitrate="64000">
                    <param name="audioOnly" value="TRUE" valuetype="data"/>
                </video>
            </switch>
        </body>
    </smil>
    To test this, you can play the audio-only stream directly:
    Code:
    http://[wowza-ip-address]:1935/[app-name]/[stream-name]/playlist.m3u8?wowzaaudioonly
    Note: When using a live repeater (origin/edge) configuration with this setup, be sure to set the LiveStreamPacketizers value on the edge to cupertinostreamingrepeater and set the above properties on both the origin and edge.

    Note: The behavior regarding bitrate-switching and audio-only streams has changed starting in iOS 6.x. It seems that switching between audio-only streams that are packetized as elementary audio streams and streams that are packetized as transport streams doesn't work as it did in the past. We have improved how this works starting in Wowza Media Server 3.5.0.01. To take advantage of the improved functionality add the following property to both the LiveStreamPacketizer/Properties and HTTPStreamer/Properties containers in [install-dir]/conf/[application]/Application.xml:
    Code:
    <Property>
        <Name>cupertinoPacketizeAllStreamsAsTS</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>

    Comments 127 Comments
    1. mustihi83 -
      Hello,

      should LiveStreamPacketizer/Properties be added in a live-record application?

      should the HTTPStreamer/Properties be added in an on-demand application?

      and for the Smil file I was using <video src="iphone_satranc_tanitim.mp4" system-bitrate="31490" wowza-audio-only="true"/> syntax. Is it still valid?


      best,
      Mustafa
    1. rrlanham -
      Mustafa,

      LiveStreamPacketizers should be populated with one or more of the packetizers in a live-record application depending on your requirements. If you are only streaming to Flash clients, it can be left empty.

      HTTPStreamer is populated by default. You should leave that as-is for live and vod applications. You could make it empty if you are only streaming to Flash clients, but I don't think there is any benefit to doing so.

      Richard
    1. mustihi83 -
      Quote Originally Posted by rrlanham View Post
      Mustafa,

      LiveStreamPacketizers should be populated with one or more of the packetizers in a live-record application depending on your requirements. If you are only streaming to Flash clients, it can be left empty.

      HTTPStreamer is populated by default. You should leave that as-is for live and vod applications. You could make it empty if you are only streaming to Flash clients, but I don't think there is any benefit to doing so.

      Richard
      what about for streaming to iPhone?
    1. rrlanham -
      IPhone requires the cupertino packetizers. This info is included in all the tutorials.

      http://www.wowza.com/forums/content.php?4-tutorials

      Richard
    1. brayster99 -
      How do we link to this for testing without the SMIL set up?

      ie in the form

      http://localhost:1935/vod/sample.mp4/playlist.m3u8

      Thanks,

      Joe
    1. rrlanham -
      You can open a link with that form directly in the iOS browser, or you can use HTML5 video tag:

      Code:
      <html>
      <head> 
        <title>Cupertino Streaming</title>
      </head>
      
      <body>
      <video controls src="http://[wowza-address]:1935/vod/sample.mp4/playlist.m3u8">
      </video>
      
      </body>
      </html>
      Richard
    1. brayster99 -
      Quote Originally Posted by rrlanham View Post
      You can open a link with that form directly in the iOS browser, or you can use HTML5 video tag:

      Code:
      <html>
      <head> 
        <title>Cupertino Streaming</title>
      </head>
      
      <body>
      <video controls src="http://[wowza-address]:1935/vod/sample.mp4/playlist.m3u8">
      </video>
      
      </body>
      </html>
      Richard
      I think you've misread my question. I wanted this

      http://&#91;server-ip]:1935/live/myStrea...wowzaaudioonly

      found the answer in http://www.wowza.com/forums/showthread.php?9680

      I am trying to use this in combination with this http://www.wowza.com/forums/content.php?207 (poster frames) for ios.. any reason why this wouldnt work?

      Regards,

      Joe

      Thanks,

      Joe
    1. rrlanham -
      They are meant to work together, as noted in the article. Check the image name, it must match the stream name, case sensitive.

      Richard
    1. brayster99 -
      Thanks Richard,

      Its still not playing nice. I get the module to give onAppStart but nothing else.

      ----------


      INFO server comment - ModuleCupertinoLiveAttachPicture.onAppStart[vod/_definst_]
      INFO application app-start _definst_ vod/_definst_
      INFO cupertino connect 638773911 -
      INFO stream create sample.mp4 -
      INFO cupertino connect 149098552 -
      INFO stream create sample.mp4 -
      INFO server comment - MediaReaderH264Cupertino.handlePacket: Audio info[vod/_definst_/sample.mp4]: {AACFrame: size: 0, rate: 48000, channels: 2, samples: 1024, errorBitsAbsent: true, profileObjectType: "LC"}
      INFO stream play sample.mp4 -
      INFO stream destroy sample.mp4 -
      INFO cupertino disconnect 638773911 -

      -------


      Any ideas? Does the image need to be a certain size?
    1. brayster99 -
      I got it working for some images but not others, is there a logic to which?
    1. charlie -
      There is a size limit. I seem to remember seeing somthing on the iOS developer site that stated the supported frame sizes. I think the limit might be 200x200. I see that referenced in general here:

      http://www.dalepreston.com/Blog/2007...-pictures.html

      I have not found a definitive reference.

      Charlie
    1. melgeo -
      Hello, can the authors kindly check the guidelines for this example? I have done a fresh install and followed every single step but the audio-only does not stream on iPhone device. My Wowza version is 2.2.3 build26454 and I am encoding with FMLS 3.2.


      Here is some output to get an idea:
      $ lynx -dump http://wowza:1935/live/livestream/playlist.m3u8
      #EXTM3U
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=584773
      http://wowza:1935/live/livestream/pl...nid=1186635798


      $ lynx -dump http://wowza:1935/live/livestream/pl...wowzaaudioonly
      #EXTM3U
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=586162
      http://wowza:1935/live/livestream/pl...wowzaaudioonly


      Shouldn't there be one more stream for the 64K audio?

      NOTE: I just copied and pasted the config lines from the two tutorials "How to publish and play a live stream (RTMP or RTSP/RTP based encoder)" and "Adding Multi-bitrate Audio-only Rendition to iOS Streams (AppStore 64Kbps)" so I assume something is missing from the tutorials.
    1. rrlanham -
      The audio track must be a AAC. It doesn't work with MP3.

      Richard
    1. melgeo -
      It is AAC.
    1. rrlanham -
      Have you tried to play this directly?:

      Code:
      http://wowza:1935/live/livestream/playlist.m3u8?wowzaaudioonly
      Code:
      <html>
      <head> 
        <title>Cupertino Streaming</title>
      </head>
      <body>
      <video controls src="http://wowza:1935/live/livestream/playlist.m3u8?wowzaaudioonly">
      </video>
      </body>
      </html>
      Have you looked at the access and error logs for anything out of order?

      The guide is complete, many folks have followed it (including me) and implemented this.

      Richard
    1. brayster99 -
      The on-demand works fine. However the live crashes my QT player and the iphone barfs too.

      I've tried changing the AAC bitrate and still the same

      Wowza Media Server 2 Developer 2.1.2.07 build26027 gives no info error messages.

      Regards,

      Joe
    1. rrlanham -
      Joe,

      Do you have a link we can try? You can send to support@wowza.com with reference to this thread.

      Richard
    1. charlie -
      Move up to Wowza 2.2.3 and install the most recent developer build:

      http://www.wowza.com/forums/content....lopment-Builds

      I believe all of this is now fixed.

      Charlie
    1. BiggyTV1 -
      Hi-

      I am sorry I can't figure this out.

      I setup the Audio Only configuration for Live Streaming. I checked it with Apple's mediastreamvalidator and it works perfect!

      However, I used the same Application.xml from the vods3 application application and made a new application for VOD. I removed the Property as directed from the Livepacketizer/Properties.

      When I test as follows: mediastreamvalidator validate http://stream.biggytv.com/vodsda/266.../playlist.m3u8 An audioonly stream is not created.

      Here is the log

      3540157 2011-02-03 17:09:56 26659_AV0701_01.mp4 -
      3540156 2011-02-03 17:09:53 SDA2 {viewers: "0", viewersRTMP: "0", viewersCupertino: "0", viewersSmooth: "0", viewersRTSP: "0"}
      3540155 2011-02-03 17:09:43 SDA2 {viewers: "0", viewersRTMP: "0", viewersCupertino: "0", viewersSmooth: "0", viewersRTSP: "0"}
      3540154 2011-02-03 17:09:33 SDA2 {viewers: "0", viewersRTMP: "0", viewersCupertino: "0", viewersSmooth: "0", viewersRTSP: "0"}
      3540153 2011-02-03 17:09:30 - MediaReaderH264Cupertino.indexFile:java.lang.NullPointerException
      3540152 2011-02-03 17:09:30 26659_AV0701_01.mp4 MediaReaderH264.open[1]: java.io.IOException: MediaCacheRandomAccessReader.open: Item not in cache: 26659_AV0701_01.mp4
      3540151 2011-02-03 17:09:30 - MediaCache.createNewCachItem: Cannot find MediaCacheSource for (26659_AV0701_01.mp4).
      3540150 2011-02-03 17:09:30 - MediaCache.createNewCachItem: Cannot find MediaCacheSource for (26659_AV0701_01.mp4).
      3540149 2011-02-03 17:09:30 26659_AV0701_01.mp4 -
      3540148 2011-02-03 17:09:29 1823560513 -
      3540147 2011-02-03 17:09:29 - ModuleStreamNameAlias.nameToAlias[play]: streamName:26659_AV0701_01.mp4 alias:{pattern: "*" alias:"${Stream.Name}" wildcardMatches:{[0]: "26659_AV0701_01.mp4"}} result:26659_AV0701_01.mp4
    1. rrlanham -
      You should start with /conf/Application.xml. This has /StreamType "default", it is a basic Application.xml for vod streaming. Follow the guide to add audio-only rendition using this file.

      Richard