IOS RTMP live stream audio

Hi guys hopefully some of you will be able to help me.
I am trying to stream audio from a live RTMP feed using the NetConnection and NetStream classes. I've managed to get my app running no problem on Android, however I am having some major difficulties getting it to play the audio back on iPad. Interestingly it works in the device emulators when debugging, however I'm assuming this is not really an accurate representation. I've tried streaming the RTMP in both AAC and MP3, but with no luck from either. I can verify through debug that it has connected to the stream, however I just get no audio playing.
Everything I've read about seems to suggest that this is possible on IOS as I'm only interested in audio and not video. Can anyone help?
Code sample below (it's quick and dirty! ).
THanks in advance!
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark" title="Audio" creationComplete="init()">
          <s:layout>
                    <s:VerticalLayout paddingLeft="10" paddingRight="10"
                                                              paddingTop="10" paddingBottom="10"/>
          </s:layout>
          <fx:Script>
                    <![CDATA[
                              import flash.media.Video;
                              import flash.net.NetConnection;
                              import flash.net.NetStream;
                              import mx.core.UIComponent;
                              private var vid:Video;
                              private var videoHolder:UIComponent;
                              private var nc:NetConnection;
                              private var defaultURL:String="[STREAM]";
                              private var streamName:String="[STREAMNAME]";
                              private var ns:NetStream;
                              private var msg:Boolean;
                              private var intervalMonitorBufferLengthEverySecond:uint;
                              private function init():void
                                        vid=new Video();
                                        vid.width=864;
                                        vid.height=576;
                                        vid.smoothing = true;                           
                                        //Attach the video to the stage             
                                        videoHolder = new UIComponent();
                                        videoHolder.addChild(vid);
                                        addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
                                        grpVideo.addElement(videoHolder);
                                        connect();
                              public function onSecurityError(e:SecurityError):void
                                        trace("Security error: ");
                              public function connect():void
                                        nc = new NetConnection();
                                        nc.client = this;
                                        nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                                        nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
                                        nc.connect(defaultURL);      
                              public function netStatusHandler(e:NetStatusEvent):void
                                        switch (e.info.code) {
                                                  case "NetConnection.Connect.Success":
                                                            trace("audio - Connected successfully");
                                                            createNS();                
                                                            break;
                                                  case "NetConnection.Connect.Closed":
                                                            trace("audio - Connection closed");                
                                                            //connect();
                                                            break; 
                                                  case "NetConnection.Connect.Failed":
                                                            trace("audio - Connection failed");                
                                                            break;
                                                  case "NetConnection.Connect.Rejected":
                                                            trace("audio - Connection rejected");                                  
                                                            break; 
                                                  case "NetConnection.Connect.AppShutdown":
                                                            trace("audio - App shutdown");                                 
                                                            break;         
                                                  case "NetConnection.Connect.InvalidApp":
                                                            trace("audio - Connection invalid app");                                   
                                                            break; 
                                                  default:
                                                            trace("audio - " + e.info.code + "-" + e.info.description);
                                                            break;                                                                                                    
                              public function createNS():void
                                        trace("Creating NetStream");
                                        ns=new NetStream(nc);
                                        //nc.call("FCSubscribe", null, "live_production"); // Only use this if your CDN requires it
                                        ns.addEventListener(NetStatusEvent.NET_STATUS, netStreamStatusHandler);
                                        vid.attachNetStream(ns);
                                        //Handle onMetaData and onCuePoint event callbacks: solution at http://tinyurl.com/mkadas
                                        //See another solution at http://www.adobe.com/devnet/flash/quickstart/metadata_cue_points/
                                        var infoClient:Object = new Object();
                                        infoClient.onMetaData = function oMD():void {};
                                        infoClient.onCuePoint = function oCP():void {};        
                                        ns.client = infoClient;
                                        ns.bufferTime = 0;   
                                        ns.play(streamName);  
                                        ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
                                        function asyncErrorHandler(event:AsyncErrorEvent):void {
                                                  trace(event.text);
                                        intervalMonitorBufferLengthEverySecond = setInterval(monPlayback, 1000);
                              public function netStreamStatusHandler(e:NetStatusEvent):void
                                        switch (e.info.code) {
                                                  case "NetStream.Buffer.Empty":
                                                            trace("audio - Buffer empty: ");
                                                            break;
                                                  case "NetStream.Buffer.Full":
                                                            trace("audio - Buffer full:");
                                                            break;
                                                  case "NetStream.Play.Start":
                                                            trace("audio - Play start:");
                                                            break;
                                                  default:
                                                            trace("audio - " + e.info.code + "-" + e.info.description);
                                                            break;
                              public function monPlayback():void {
                                        // Print current buffer length
                                        trace("audio - Buffer length: " + ns.bufferLength);
                                        trace("audio - FPS: " + ns.currentFPS);
                                        trace("audio - Live delay: " + ns.liveDelay);
                              public function onBWDone():void {
                                        //Do nothing
                              public function onFCSubscribe(info:Object):void {      
                                        // Do nothing. Prevents error if connecting to CDN.    
                              public function onFCUnsubscribe(info:Object):void {    
                                        // Do nothing. Prevents error if connecting to CDN.    
                    ]]>
          </fx:Script>
          <s:Group id="grpVideo">
          </s:Group>
</s:View>

Just an update on this for anyone coming along after me.
I've managed to get this working on MP3 but not AAC (I guess AAC just isn't supported?).
My problem was the buffertime. The docs seemed to indicate it shoudl be set to 0 for live streaming, however switching it to "1" solved my problem on the particular stream I was pointing at.
So essentially justchanged the above line:
                                        ns.bufferTime = 0;  
to
                                        ns.bufferTime = 1;  
Would be great to find out if anyone has gotten AAC working however...

Similar Messages

  • Live streaming audio on flash site

    Hello,
    I am new to Flash and I am working on a web page using flash, the page itself is going to be pretty basic, but the situation I am in is this,  we would like to but a live streaming audio feed on the site and I am having trouble figuring out how to add that.  The server it is from is a Broadwave server, and it does stream in MP3.  I would like the audio stream to start automatically when the web page is open.  Any help would be greatly appriciated.

    You could build your own player but if you are new to Flash, you might want to just embed or place on the Web page a prebuilt player. For example:
    http://www.longtailvideo.com/players/jw-flv-player/
    or
    http://flowplayer.org/
    or
    http://ffmp3.sourceforge.net/
    each player will have it's own config setup for autoplay etc.
    Best wishes,
    Adninjastrator

  • How to open live streaming audio? Like live streaming audio

    like
    i can't play some asf files
    i need help
    i suscribed to a radio station and can't listen to it
    also how can I use Window media player to open some live streaming audio or video instead of quicktime ?

    Install Flip4Mac to enable QuickTime to handle Windows Media files.

  • Live streaming audio

    I'm sure this topic has been discussed several times and I just can't find the answer.  However, I recently purchased a Pre and I cannot listen to any live streaming audio.  Some formats the device won't support and the formats the device will play only plays for 30 seconds.
    Post relates to: Pre p100eww (Sprint)

    Hi, and welcome to the Palm Support Community.
    I haven't tried it yet on my Pre, but it can handle some formats.  I suggest you go to the webOS software board, then use the Search field at the bottom and enter streaming audio.  You'll find several pages of hits including this thread, and links to other sources with lists of stations which work.
    smkranz
    I am a volunteer, and not an HP employee.
    Palm OS ∙ webOS ∙ Android

  • Disk Management for RTMP live streams

    Hello,
    Can anyone tell me if there is anything similar to DiskManagement functionality (available for HTTP streams) available to RTMP live streams in AMS?
    I'm having trouble with INDEX files that are being created for the live+DVR streams (we are serving 24/7 streaming), even though I delete RAW DVR files which are old, INDEX files constantly grow and FMS crashes CPU after few days.
    Any suggestions are appreciated.

    Hi,
    The methods that are mentioned as missing as expected by FMLE as it makes calls to them. They are defined in the sample live application that comes with the installation. The code for these can be picked up from the samples folder under the FMS installation from the application live. You can add these in all of your server side scripts to make them more relevant.
    Thank you !

  • Problem of republishing remote rtmp live stream with AMF

    Hi, Guys
    I am trying recieving one live stream from a remote rtmp server and republishing this stream in AMF.
    a remote rtmp (rtmp://192.168.1.100/live/remotestream)
    AMF instance(codes in application/app/main.asc) recieve and republish to another AMF instance.
    I can watch with url(rtmp://192.168.1.100/live/remotestream ) in a player (ex. OSMF player).
    But,no data from remote rtmp streaming can be recieved in AMF.
    Here is the log:
    NetConnection.Connect.Success
    Sending error message: Method not found (onBWDone).
    mystream.onStatus: NetStream.Publish.Start
    mystream.onStatus: NetStream.Play.Reset
    My codes in application/app/main.asc
    application.onAppStart = function()
              mystream = Stream.get("myvideo");
              myRemoteConn = new NetConnection();
              myRemoteConn.connect("rtmp://192.168.1.100/live");
              myRemoteConn.onStatus =function(info){
               trace(info.code);
               if(info.code == "NetConnection.Connect.Success"){
                    mystream.play("remotestream", -1, -1, true, myRemoteConn);
                    //mystream.play("sample", 0, -1, true);<-----if play a local flv video file ,it works.republish fine.
              nc = new NetConnection();
              nc.connect("rtmp://localhost/demo");
              ns = new NetStream(nc); 
              ns.setBufferTime(2);
        mystream.onStatus = function(sinfo)
            trace("mystream.onStatus: "+sinfo.code);
            if(sinfo.code == "NetStream.Publish.Start")
                                  attach_retVal = ns.attach(mystream);
                if(attach_retVal==true){
                        ns.publish(mystream.name,"live");

    On the Macintosh side there is the Camtwist app which allows you to do this and it works smoothly with FMLE. On the PC side I´m not sure but there just got to be more apps capable of this than on the mac side.

  • RTMP Live Streaming Works, HTTP HLS/HDS Streaming Doesnt

    I am running Flash Media Server on my Windows 2008 R2 server, and am trying to get HTTP live streaming working. I am using Flash Media Live Encoder to stream to the server. I can get a basic RTMP stream to work without issue, however anytime I setup to stream to a basic HTTP live stream, I get the generic "We are having problems with playback. We apologize for the inconvenience." in the basic Flash Media Playback player. I can confirm the stream is being published to the server in the Admin Console using the livepkgr application successfully, and I can even get an RTMP stream to work when it is streaming to the livepkgr application.
    Here are the FMLE settings I am using to publish the stream:
    Stream URL: rtmp://184.69.238.58/livepkgr
    (yes, thats my IP, the stream is live continuously, test for yourself!)
    Stream Name: livestream?adbe-live-event=liveevent
    my embeded html for viewing the stream is as follows:
    <object width="640" height="480"> <param name="movie" value="http://fpdownload.adobe.com/strobe/FlashMediaPlayback_101.swf"> </param> <param name="flashvars" value="src=http://<myipgoeshere>/livepkgr/liveevent/livestream.f4m"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param>  <embed src="http://fpdownload.adobe.com/strobe/FlashMediaPlayback_101.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="700" height="500" flashvars="src=http://<myipgoeshere>/livepkgr/liveevent/livestream.f4m">
    While this gives me the error, the RTMP version (publishing to the livepkgr) works fine like this:
    <object width="640" height="480"> <param name="movie" value="http://fpdownload.adobe.com/strobe/FlashMediaPlayback_101.swf"> </param> <param name="flashvars" value="src=rtmp://<myipgoeshere>/livepkgr/livestream"> </param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param>  <embed src="http://fpdownload.adobe.com/strobe/FlashMediaPlayback_101.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="700" height="500" flashvars="src=rtmp://<myipgoeshere>/livepkgr/livestream"> </embed>  </object>
    Can anyone explain to me what is happening here? I need HTTP streaming so I can eventually handle multi-bit rate streaming. Is there any further configuration beyond the standard "out of the box" FMS installation I need to consider on my server? There are no firewall issues at play here as all ports for standard streaming are open.

    I had about 2 hours of downtime last night to move my server. Try again? It will be live all day.
    Dustin Rogers
    [email protected]
    780.293.6632

  • Rtmp live streaming of videos!

    I am loving Azure Platform. I am having certain problems, i hope you can help me resolve them.
    Problem : I want to live stream videos using rtmp. The input for rtmp will be using ffmpeg running in my azure VM. I am new to using rtmp. Any help is welcome. Thank you.

    hi i met a problem
    ffmpeg -v verbose -y -i sample.mp4  -strict -2 -c:a aac -b:a 16k -ar 24000 -r 30 -g 60 -b:v 2m -c:v libx264 -f flv rtmp://livetest1-tracyone.channel.mediaservices.chinacloudapi.cn:1935/live/1ea048c582e34115b9d76cb98c6e9fb6
    Parsing...
    Parsed protocol: 0
    Parsed host    : livetest1-tracyone.channel.mediaservices.chinacloudapi.cn
    Parsed app     : live
    RTMP_Connect1, ... connected, handshaking
    RTMP_Connect1, handshake failed.
    rtmp://livetest1-tracyone.channel.mediaservices.chinacloudapi.cn:1935/live/1ea048c582e34115b9d76cb98c6e9fb6: Unknown error occurred

  • Using netStream.time on rtmp live stream (broadcaster!=receiver)

    I am trying to synchronize a live stream (which is
    broadcasted from the flash player plugin) with some scripted
    actions. The problem is, that the displayed frames of the rtmp
    stream do not correlate to the netStream.time property on the
    receiver side. In fact, i do not understand at all, how the
    property is rendered on the receiver, since i can not recognize any
    dependencies to e.g. bufferLength.
    Does anybody now, how it is calculated? I tried with Red5 and
    Wowza and they seem to behave similar. I guess, FMS would not make
    any difference (if so: lease let me know!), since i assume that the
    property is rendered during the encoding process i.e. by the
    plugin.

    Hello Jay,
    thank you for your answer! NetStream.send() seems to be at
    least a possibility to solve my problem with a workaround.
    I just want to synchronize the time information of the up-
    and downstream: both should have the same time information when
    they show the same visual content (which i called "frame" in the
    former post).
    What i would suppose the netstream.time to be is that if i
    shake my camera on upstream.time=10.0 then downstream.time should
    equal 10.0 when this camera shaking is played back. This is the
    behaviour that i am used to from streaming prerecorded FLVs. But
    with live streams things work out diffferently.
    In fact my downstream.time is bigger than upstream.time. And
    i can not imagine how this can be. If i streamed up for let's say
    20 seconds and i start the downstream after about 10 seconds, i
    would expect my downstream.time to start with 10 seconds and then
    increase continually. But against this, my downstream.time starts
    with something above 20. How can this be? Or back to my initial
    question: how is the downstream.time rendered?
    This behaviour seems not to be dependent on the
    downstream.bufferTime.
    With netStream.send() i could send the upstream.time
    information via the upstream to render an offset for
    downstream.time on receiver side. This should work (have to check
    it), but is a workaround, no "clean" solution.

  • Live Streaming audio not working

    I have a HP Pavilion Elite m9040n with Vista that is not giving me AUDIO on a LIVE STREAMING site where I am taking Continuing Education webcast.  I am using Mozilla Firefox and did put in the newest plugin.  I can hear u-tube audio (those video load very slowly and stop and start).  I have Hughes Net satellite broadband connection.  I tried disabling my McAfee while doing the program but that did not help.

    What version do you see for Flash in System Preferences > Flash > Advanced

  • How to play rtmp live streaming through VideoElement??

    Hi , i'm trying to play live streaming by using VideoElement
    like this :
    <s:VideoElement>
    <s:StreamingVideoSource serverURI="rtmp://192.168.0.136/tv" live="true">
    <s:StreamItem streamName="stream" />
    </s:StreamingVideoSource>
    </s:VideoElement>
    but nothing occurred ........did i use the wrong syntax @@a  or....?

    Anyone?

  • Motorola Droid - Live Streaming Audio Doesn't Work

    When I try to listen to a live audio stream from http:\\kalx.berkeley.edu, I get a message stating "Cannot download.  The size of the item cannot be determined."  Is there any way I can fix this?

    Solution found!  Download and install XiaaLive (formerly known as DroidLive) from the Google Apps Store for $3.99.  It supports AAC+, aac, m3u, pls, mp3, mp4, m4a and mpeg audio formats!

  • RTMP Live Stream does not resume with Spark VideoPlayer Component

    Hi all
    The Flex 4 framework brought along the VideoPlayer component, which supposedly can automatically choose the best stream in terms of bitrate from a list of available multi-bitrate streams, play live videos and everything.
    See http://help.adobe.com/en_US/flex/using/WSc78f87379113c38b-669905c51221a3b97af-8000.html for some information about it.
    Here's a working example for an MXML application under the Flex 4.1 framework:
    <s:VideoPlayer width="100%" height="100%">
        <s:source>
            <s:DynamicStreamingVideoSource streamType="live" host="rtmp://88.87.56.214:1935/live/">
                <s:DynamicStreamingVideoItem streamName="euronews_tmo_h.stream" bitrate="19200"/>
                <s:DynamicStreamingVideoItem streamName="euronews_tmo_h.stream" bitrate="9000"/>
                <s:DynamicStreamingVideoItem streamName="euronews_tmo_h.stream" bitrate="3600"/>
            </s:DynamicStreamingVideoSource>
        </s:source>
    </s:VideoPlayer>
    The streams are valid and they play. However, I'm bumping into a problem when the stream is paused: it will not resume.
    The player state alternates correctly between 'playing' and 'pause' when you keep clicking the play/pause button. However, once the first stream pause(or stop) occurs, the image and sound seem to freeze...forever.
    Any help ore guidance are most appreciated!

    I'm also facing the same problem.. Any developments in that ?

  • Live streaming audio/video

    I'm looking for advice on how to stream live video, full
    screen at high quality 640x480 30 fps. I need to be able to carry
    on a teleconference between two instances of the program, but also
    support 640x480 at 30 fps. What programs might be needed (encoder?,
    server?)

    Hi tony45371,
    The replies from in2mobile are 100% correct.
    For live video, some server is required. Flash Media Server
    is the required server offered by Adobe (there are competitors
    including open source competitors to Flash Media Server). Also an
    alternative to putting up your own Flash Media Server, may CDNs
    offer Flash Media Server services. You can find a list of CDN
    partners here:
    http://www.adobe.com/products/flashmediaserver/fmsp/
    Are your live events webcasts (e.g. 1 presenter, w/ many
    attendees)? Or 2-way (e.g. multiple presenters)?
    I assume that you require 2-way since your post said "I need
    to be able to carry on a teleconference between two instances of
    the program".
    Following below are links into the browsable version of the
    product documentation (adobe.com/livedocs). Easier to read PDF
    versions can be downloaded here:
    Flash Media Server Developer Guide
    http://livedocs.adobe.com/flashmediaserver/3.0/hpdocs/flashmediaserver_dev_guide.pdf
    All Flash Media Server Documentation
    http://www.adobe.com/support/documentation/en/flashmediaserver/
    2-WAY VIDEO CONFERENCE
    For 2-way you can find a related sample application (with
    explanation and downloadable source code) here:
    Video Conference with Flex & FMS
    http://renaun.com/blog/2006/11/08/147/
    Video Conference with Flex & FMS, Live Demo and Source
    Code
    http://renaun.com/blog/2006/10/28/139/
    You can also find additional code examples in the Flash Media
    Server product documentation here:
    http://www.adobe.com/livedocs/flashmediaserver/3.0/hpdocs/00000082.html
    (Above link, in the PDF version, is in Chapter 4: Developing
    live video applications)
    1-WAY WEBCASTS
    For live webcast events, Flash Media Server includes a free
    companion program "Flash Media Live Encoder 2.5" (aka FMLE). FMLE
    offers higher quality video (H.264 & VP6), and audio (MP3 and
    with a 3rd party plug-in AAC). Details on FMLE here:
    http://www.adobe.com/products/flashmediaserver/flashmediaencoder/
    Following is a link into the product documentation on using
    FMLE 2.5 w/ FMS3:
    Using the live service
    http://www.adobe.com/livedocs/flashmediaserver/3.0/hpdocs/00000031.html
    (Above link, in the PDF version, is in Chapter 2: Streaming
    services)
    You can also find an article written against the older Flash
    Media Server 2 with an earlier version of FMLE here:
    http://www.adobe.com/devnet/flashmediaserver/articles/webcasting_fme.html
    Please post back regarding whether the above answers your
    question, and if you find it helpful :-)
    Best regards,
    g

  • Timecode/TimeStamp in RTMP live streaming using Adobe Media Server and FMLE

    HI There,
    Am trying to stream a video on to Adobe media server(using RTMP) through FMLE and play it on my web site using JWPlayer. i could stream the video successfully, but know i want to get the timestamp/timecode on the stream. does Adobe media server and FMLE support this kind of use-case ? if not is there any other way to achieve the same. any comments/suggestion/pointers appreciated .
    Thanks in Advance
    Regards
    Deepak

    If you're talking about nonstop, continuous streaming, your subscribing client will need to close and reconnect the stream every couple of days, as the server will run out of timestamps for the stream.

Maybe you are looking for

  • Photo sensitive switch problem

      Hello, I am a non-engineer type trying to figure out how to alert an operator that an indicator light is flashing at another location.  Basic parameters are:  Outside daylight operation. Can't be hard wired.  Peel and stick is the desired connectio

  • Photo Stream gone and useless junk.

    Less of a question and more of a statement that I shouldn't have to make.  I have been a loyal iPhone consumer since 2008, late to the party, but I started with the first model. Have had every model besides the 4s and 5c. Apple had two real things go

  • Excise duty payable amount in words

    hi kings I show the tax amount split in pld's .but our customers need to show the amount in words when Excise duty comes.but when using group the value store in single variable how i show the amount in words excise duty only Thanks & Best Regards B.L

  • Can't download the trial of the LiveCycle ES4 - Designer

    I'm trying to download the trial of the LiveCycle ES4 - Designer, but when I click on "download" on the "LiveCycle Trial Downloads" page, I get a page reading "413  Header Length too Large." What does this mean? How can I download the trial?

  • Low level hum

    Hi there I am getting a low level hum from the the mbp when I have headphones plugged in. When I place my hands on the laptop, the humming stops. Any ideas. By the way, I've had the mbp for about a month now, and I love it! Expensive, but well worth