Sending iOS camera stream to FMS

I'm currently developing an app that requires video conferencing for iOS. I've used a fairly basic approach with Flex that streams the camera and microphone on H.264 with Speex to FMS. It does actually produce a stream but I pressume the quality is so increadibly bad because iOS does not officially support RTMP but instead requires HTTP Live Streaming (HLS). Thus I have a few questions because there is meant to be reasonable FMS support for iOS.
1) Is it possible to convert the camera/mic stream directly to HLS in Flex?
2) Is it possible to at least convert the audio stream to AAC where FMS can then do the work of converting the H.264/AAC stream with livepkgr to HLS for recieving on iOS.
3) If not where should I look for information on streaming from iOS in general to FMS?
Thanks

ffmpeg do a right job... generate meta data are valid. You
can try FLVMetaData injector for your meta but I think that your
problem come that your are not putting your flv in the stream
folder. You can specify stream folder and an alias in your
configuration files of FMS. If it's a video, in your code specifify
stream without .flv in the file name like this :
aliasName/yourFileName

Similar Messages

  • Radio Streaming with FMS (aac, mp3, ogg, wma)

    Hi
    I use a program that encodes in many audio format (acc, wma,
    ogg, mp3, etc) and connects to shoutcast, icecast, windows media
    server, live365, to distribute the web radio.
    Willing to use FMS as the distribution server, I tried to
    send the stream to FMS port but without succes. Online docs doenst
    treat the argument.
    Is it correct to say that FMS is not set up to accept a
    Windows Media, AAC+,MP3 or Ogg incoming stream and redistribute the
    radio to swf players?
    Best
    Jo

    I've done a similar setup before for a radio station
    (x1fmradio.com)
    What we did was setup 2 computers on the studio, one computer
    receives the input from console and encodes output to shoutcast and
    also outputs audio to the second computer running Flash Media
    Encoder 2, which publishes audio to Flash Media Server.
    If you want an all-in-one solution I would recommend using a
    Digital Rapids system, which is not free, but you only need one
    computer and you can publish audio/video to several servers at the
    same time, including Flash Media Server.

  • Archiving live stream at FMS and injecting metadata: VP6 good h264 not

    When I record a live stream at FMS, one in which I've injected  metadata in my main.asc file, the archived file plays back fine.  The  metadata plays back too.  I'm able to retreive it just fine - if I  encode VP6.
    If I encode h.264 the file plays back but  the metadata does not.  The fact that the archived file is created and  plays back tells me things are wired correctly.  The only thing I  changed is the format.
    According to FMS docs (http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/WS5b3ccc516d4fbf351e63e3d11a11afc9 5e-7e42.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7f35)
    ..."The recording format is determined by the filename you pass to the Stream.get()
    method."
    So my record code looks like the following:
    application.onPublish = function(client, stream) {
         trace("onPublish");
         s = Stream.get("mp4:streamname.f4v");
         if(s){
             s.record();
         this.doRepublish(this.nc, stream);
    My code that injects the data in to the stream looks like this:
    Client.prototype.sendDataEvent = function(data) {
         trace("Call to sendDataEvent...");
         this.newStream = Stream.get("mp4:streamname.f4v");
         this.newStream.send("onTextData",data);
    All must be wired  correctly because the metadata comes through during the live stream.  On  play back of the archive though, the metadata doesn't appear to be  there.
    Any thoughts?
    Thanks

    My apologies on the s.play() confusion.  I had been trying different versions of the code and posted the one without it.
    Whether I include s.play() or not the file gets created.  Here are the various versions of the onPublish() function I've tried (differences in red):
    1.
    application.onPublish = function(client, stream) {
        trace("onPublish");   
        s = Stream.get("mp4:streamname.f4v");
        if(s){
            s.record();
            s.play("mp4:streamname.f4v");
        this.doRepublish(this.nc, stream);
    2.
    application.onPublish = function(client, stream) {
        trace("onPublish");   
        s = Stream.get("mp4:streamname.f4v");
        if(s){
            s.record();
            s.play(stream);
        this.doRepublish(this.nc, stream);
    3.
    application.onPublish = function(client, stream) {
         trace("onPublish");   
         s = Stream.get("mp4:streamname.f4v");
         if(s){
             s.record();
         this.doRepublish(this.nc, stream);
    All produce the same result - an archived file called mp4:streamname.f4v in my streams folder.  This file plays back fine but does not play back the commands.
    On your other question, about things working fine for VP6, it works fine for FLV.  A file called streamname.flv is produced.  This file plays back fine and does indeed play back commands baked into the file as well.  This is what makes me believe the code is not the problem.  If it works perfectly for one format, there would seem to be very little I could do in my code to break things for the other.
    Can you try this using the record() code snippets in the live docs Stream.record() section?
    http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/WS5b3ccc516d4fbf351e63e3d11a11afc9 5e-7e42.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7f35
    All you'd need is the code snippets there to record your live stream and another server side function to inject commands into that live stream. Here is that function:
    Client.prototype.sendDataEvent = function(data) {
        trace("Call to sendDataEvent...");
        this.newStream = Stream.get("mp4:streamname.f4v");
        this.newStream.send("onTextData",data);
    Do something simple like call onTextData and pass some text in the data parameter.  Then on the client side viewer, handle the onTextData method.  It will receive the text.  Display it in a text area or something.
    If you record while injecting this text into your stream, the text should display on playback of the archived file.  It will if you encode VP6/FLV, but not if you encode H.264/F4V.
    Let me know what you discover.

  • Air iOS Camera Upload

    Currently, I am encountering problem with Adobe Flash CS6 tutorial at http://www.fizixstudios.com/labs/do/view/id/air-ios-camera-and-uploading-photos. After creating and naming the instances & type the coding in ActionScript file, I can't seems to execute and make it work and looking forward to hear from you all soon.

    Thanks
    Attached is the screenshot to my button instance name and Below is the code
    package 
      import flash.display.MovieClip;
      import flash.events.MouseEvent;
      import flash.events.TouchEvent;
      import flash.ui.Multitouch;
        import flash.ui.MultitouchInputMode;
      import flash.media.Camera;
      import flash.media.CameraUI;
      import flash.media.CameraRoll;
      import flash.media.MediaPromise;
        import flash.media.MediaType;
      import flash.events.MediaEvent;
      import flash.events.Event;
      import flash.events.ErrorEvent;
      import flash.utils.IDataInput;
      import flash.events.IEventDispatcher;
      import flash.events.IOErrorEvent;
      import flash.utils.ByteArray;
      import flash.filesystem.File;
      import flash.filesystem.FileMode;
      import flash.filesystem.FileStream;
      import flash.errors.EOFError;
      import flash.net.URLRequest;
      import flash.net.URLVariables;
      import flash.net.URLRequestMethod;
      public class CameraTest extends MovieClip
      // Define properties
      var cameraRoll:CameraRoll = new CameraRoll(); // For Camera Roll
      var cameraUI:CameraUI = new CameraUI(); // For Taking a Photo
      var dataSource:IDataInput; // Data Source
      var tempDir; // Our temporary directory
      public function CameraTest()
      Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
      // Start the home screen
      startHomeScreen();
      // =================================================================================
      // startHomeScreen
      // =================================================================================
      public function startHomeScreen()
      trace("Main Screen Initialized");
      // Add main screen event listeners
      if(Multitouch.supportsGestureEvents)
      mainScreen.startCamera.addEventListener(TouchEvent.TOUCH_TAP, initCamera);
      mainScreen.startCameraRoll.addEventListener(TouchEvent.TOUCH_TAP, initCameraRoll);
      else
      mainScreen.startCamera.addEventListener(MouseEvent.CLICK, initCamera);
      mainScreen.startCameraRoll.addEventListener(MouseEvent.CLICK, initCameraRoll);
      // =================================================================================
      // initCamera
      // =================================================================================
      private function initCamera(evt:Event):void
      trace("Starting Camera");
      if( CameraUI.isSupported )
      cameraUI.addEventListener(MediaEvent.COMPLETE, imageSelected);
      cameraUI.addEventListener(Event.CANCEL, browseCancelled);
      cameraUI.addEventListener(ErrorEvent.ERROR, mediaError);
      cameraUI.launch(MediaType.IMAGE);
      else
      mainScreen.feedbackText.text = "This device does not support Camera functions.";
      // =================================================================================
      // initCameraRoll
      // =================================================================================
      private function initCameraRoll(evt:Event):void
      trace("Opening Camera Roll");
      if(CameraRoll.supportsBrowseForImage)
      mainScreen.feedbackText.text = "Opening Camera Roll.";
      // Add event listeners for camera roll events
      cameraRoll.addEventListener(MediaEvent.SELECT, imageSelected);
      cameraRoll.addEventListener(Event.CANCEL, browseCancelled);
      cameraRoll.addEventListener(ErrorEvent.ERROR, mediaError);
      // Open up the camera roll
      cameraRoll.browseForImage();
      else
      mainScreen.feedbackText.text = "This device does not support CameraRoll functions.";
      // =================================================================================
      // imageSelected
      // =================================================================================
      private function imageSelected(evt:MediaEvent):void
      mainScreen.feedbackText.text = "Image Selected";
      // Create a new imagePromise
      var imagePromise:MediaPromise = evt.data;
      // Open our data source
      dataSource = imagePromise.open();
      if(imagePromise.isAsync )
      mainScreen.feedbackText.text += "Asynchronous Mode Media Promise.";
      var eventSource:IEventDispatcher = dataSource as IEventDispatcher;
      eventSource.addEventListener( Event.COMPLETE, onMediaLoaded );
      else
      mainScreen.feedbackText.text += "Synchronous Mode Media Promise.";
      readMediaData();
      // =================================================================================
      // browseCancelled
      // =================================================================================
      private function browseCancelled(event:Event):void
      mainScreen.feedbackText.text = "Browse CameraRoll Cancelled";
      // =================================================================================
      // mediaError
      // =================================================================================
      private function mediaError(event:Event):void
      mainScreen.feedbackText.text = "There was an error";
      // =================================================================================
      // onMediaLoaded
      // =================================================================================
      function onMediaLoaded( event:Event ):void
      mainScreen.feedbackText.text += "Image Loaded.";
      readMediaData();
      // =================================================================================
      // readMediaData
      // =================================================================================
      function readMediaData():void
      mainScreen.feedbackText.text += "Reading Image Data.";
      var imageBytes:ByteArray = new ByteArray();
      dataSource.readBytes( imageBytes );
      tempDir = File.createTempDirectory();
      // Set the userURL
      var serverURL:String = "http://www.example.com/upload.php";
      // Get the date and create an image name
      var now:Date = new Date();
      var filename:String = "IMG" + now.fullYear + now.month + now.day + now.hours + now.minutes + now.seconds;
      // Create the temp file
      var temp:File = tempDir.resolvePath(filename);
      // Create a new FileStream
      var stream:FileStream = new FileStream();
      stream.open(temp, FileMode.WRITE);
      stream.writeBytes(imageBytes);
      stream.close();
      // Add event listeners for progress
      temp.addEventListener(Event.COMPLETE, uploadComplete);
      temp.addEventListener(IOErrorEvent.IO_ERROR, ioError);
      // Try to upload the file
      try
      mainScreen.feedbackText.text += "Uploading File";
      //temp.upload(new URLRequest(serverURL));
      // We need to use URLVariables
      var params:URLVariables = new URLVariables();
      // Set the parameters that we will be posting alongside the image
      params.userid = "1234567";
      // Create a new URLRequest
      var request:URLRequest = new URLRequest(serverURL);
      // Set the request method to POST (as opposed to GET)
      request.method = URLRequestMethod.POST;
      // Put our parameters into request.data
      request.data = params;
      // Perform the upload
      temp.upload(request);
      catch( e:Error )
      trace(e);
      mainScreen.feedbackText.text += "Error Uploading File: " + e;
      removeTempDir();
      // =================================================================================
      // removeTempDir
      // =================================================================================
      function removeTempDir():void
      tempDir.deleteDirectory(true);
      tempDir = null;
      // ==================================================================================
      // uploadComplete()
      // ==================================================================================
      function uploadComplete(event:Event):void
      mainScreen.feedbackText.text += "Upload Complete";
      // ==================================================================================
      // ioError()
      // ==================================================================================
      function ioError(event:Event):void
      mainScreen.feedbackText.text += "Unable to process photo";

  • Recording Live Streams on FMS remotely

    Hi,
    We're using FMSS 3 to stream live feeds from cameras.
    However, we'd also like to have the ability to (via an
    administration site) record these live streams and allow the user
    to view pre-recorded streams instead of the live ones.
    Does anyone know of an example of how I can tell FMS to start
    recording a stream (via a web service or AS), and then how to stop
    it? Just for clarification - we don't want FMS to record a stream
    from the user's own camera. We want to record the live streams that
    are already streaming on FMS.
    Thanks,
    Filip Stanek
    bloodforge.com

    you can creat an app folder in fms folder which is inside of
    ur setup folder,
    for details u can mail at [email protected]

  • How Do I Wrap Text Like the iOS Camera App?

    Hello. I am in yearbook, and I have been challenged with designing the cover of the yearbook, and I have been having a few problems along the way. One of these problems is to wrap text. Specifically, I'm stuck on how I would wrap text like the iOS camera app on the bottom of the screen. The words seem like they are wrap around a 3D object to give it that effect, but I can't really tell. If anyone can help me, it would be greatly appreciated.

    JJMack wrote:
    There is a big difference between being a casual user than real work or development. I own a iPod its a great MP3 player and a device I can display my pictures on out of my pocket. I'll even Facetime my kids at time to see my grand kids or help fix something.  My wife has a mini iPad for quick internet access and quire music and uses her iPod to entertain our two year old grandson with games.   She uses a Canon 1D mark 4 and I a Cannon 1D mark II.  The only use the iPad and iPod cameras get is Facetime. No iOS apps are use to work on images  they have no value when you have Photoshop. The iPod is better for displaying image then the iPad mini it has a 3:2 aspect ratio display and travels better the the mini iPad which has a 4:3 aspect ratio display.  I also crop image for display on wall mounted HDTV. The iPad is better for casual internet access then the iPod. All our kids have iPhones and they all use computers either Mac or PC for work and internet access.  When you have a Unix or Windows why would you want to touch an iOS device for work or serious internet access.  Apple mobile devices are convenient for casual use and grand kids don't get that dirty finger painting on them as they do using real paint. Nothing of real value is maintained on an iOS device.
    Well...there's Photoshop Touch and Photoshop Mix as well as Lightroom Mobile. It could be argued that they're don't exactly mirror their desktop cousins, yes, but they weren't meant to be. They were meant as extensions to the desktop experience.  (e.g., Lightroom Mobile lets one work with the RAW images they have in their Lightroom desktop collections.)
    The more powerful Windows tablets can run Photoshop desktop (like Photoshop CC) too.
    @bluebocat: Are you looking for text with a perspective? Like it has a vanishing point? As if it was turned in a certain direction in 3D space?

  • When FMLE stopped,Remote RTMP stream to FMS 4.5 with rtmfp?

    When FMLE stopped,Remote RTMP stream to FMS 4.5 with rtmfp?
    edit  "applications/multicast/main.asc" ?
    HELP ME !!! THANKS!!!
    * File: main.asc
    * The server-side portion of the multicast sample application.
    * This app accepts publish and unpublish requests from FMLE, and republishes
    * the live stream from FMLE into a target Flash Group.
    // General Constants
    // "Constants" representing multicast event types.
    var TYPE_FUSION = 1;
    var TYPE_IP = 2;
    var TYPE_P2P = 3;
    // StreamContext Description, Constants and Functions
    * Type: StreamContext
    * This application tracks the context for live streams published to the server
    * that are being republished into a Flash Group. The StreamContext "type" used
    * for this is just an Object containing the following members:
    *   client         - The encoding/publishing client.
    *   streamName     - The source Stream name as published by the client.
    *   type           - The multicast event type.
    *   groupspec      - The groupspec identifying the Flash Group and capabilities.
    *   address        - IP multicast address (optional for pure P2P events).
    *   netConnection  - A loopback NetConnection used for the mcastNetStream.
    *   mcastNetStream - The NetStream used to republish the source Stream into
    *                    the Flash Group.
    *   netGroup       - An (optional) NetGroup handle for the target Group.
    *                    Only present for Fusion or P2P events.
    *   state          - One of the state constants defined immediately below
    *                    this comment.
    var STATE_INIT            = 0; // Starting state for a StreamContext.
    var STATE_CONNECTING      = 1; // Establishing loop-back connection.
    var STATE_CONNECTED       = 2; // Connection established.
    var STATE_PUBLISH_PENDING = 3; // Attempting to publish.
    var STATE_REPUBLISHING    = 4; // Actively republishing to multicast.
    var STATE_UNPUBLISHING    = 5; // Shutting down multicast republish.
    var STATE_UNPUBLISHED     = 6; // Unpublished successfully.
    var STATE_DISCONNECTING   = 7; // Shutting down loopback connection.
    var STATE_DISCONNECTED    = 8; // Connection shut down. Done.
    * Registers a source Stream published by the specified client, along with the
    * context for the multicast event, as a StreamContext Object.
    * @param client - The Client publishing the stream.
    * @param streamName - The source Stream name.
    * @param params - The parameters resulting from parsing the source Stream's
    *                 query string.
    * @return The new StreamContext Object for the registered Stream.
    function registerStream(client, streamName, params)
        var streamContext = { "client": client,
                              "streamName": streamName,
                              "type": params["fms.multicast.type"],
                              "groupspec": params["fms.multicast.groupspec"] };
    if (params["fms.multicast.interface"])
      streamContext["interfaceAddress"] = params["fms.multicast.interface"];
        if (params["fms.multicast.address"])
            streamContext["address"] = params["fms.multicast.address"],
        streamContext.state = STATE_INIT;
        updateStreamContextLookups(streamContext);
        trace("Registered multicast context for source stream: " + streamName);
        return streamContext;
    * Updates the indexed lookups installed for the passed StreamContext Object
    * with the application.
    * @param streamContext - The StreamContext Object to (re)index.
    function updateStreamContextLookups(streamContext)
        application.streamTable[streamContext.streamName] = streamContext;
        if (streamContext.netConnection)
            application.netConnTable[streamContext.netConnection] = streamContext;
        if (streamContext.mcastNetStream)
            application.mcastNetStreamTable[streamContext.mcastNetStream] = streamContext;
        if (streamContext.netGroup)
            application.netGroupTable[streamContext.netGroup] = streamContext;
    * Provides access to the StreamContext Object for a registered source Stream
    * by name.
    * @param streamName - A registered source Stream name.
    * @return The associated StreamContext Object; undefined if the source Stream
    *         name is not registered.
    function getStreamContextForSourceStream(streamName)
        return application.streamTable[streamName];
    * Provides access to the StreamContext Object for a given server-side
    * NetConnection hosting a multicast NetStream.
    * @param netConnection - A server-side NetConnection.
    * @return The associated StreamContext Object; undefined if the passed
    *         NetConnection is not indexed to a StreamContext.
    function getStreamContextForNetConnection(netConnection)
        return application.netConnTable[netConnection];
    * Provides access to the StreamContext Object for a given multicast NetStream.
    * @param netStream - A multicast NetStream.
    * @return The associated StreamContext Object; undefined if the passed
    *         NetStream is not indexed to a StreamContext.
    function getStreamContextForMulticastNetStream(netStream)
        return application.mcastNetStreamTable[netStream];
    * Provides access to the StreamContext Object for a given NetGroup associated
    * with a multicast NetStream.
    * @param netGroup - A NetGroup.
    * @return The associated StreamContext Object; undefined if the passed
    *         NetGroup is not indexed to a StreamContext.
    function getStreamContextForNetGroup(netGroup)
        return application.netGroupTable[netGroup];
    * Unregisters the StreamContext from the application.
    * @param streamContext - The StreamContext Object to unregister.
    function unregisterStreamContext(streamContext)
        if (streamContext.netConnection)
            delete application.netConnTable[streamContext.netConnection];
        if (streamContext.mcastNetStream)
            delete application.mcastNetStreamTable[streamContext.mcastNetStream];
        if (streamContext.netGroup)
            delete application.netGroupTable[streamContext.netGroup];
        trace("Unregistered multicast context for source stream: " +
              streamContext.streamName);
    // Application callback functions
    * Initializes global StreamContext lookup tables.
    application.onAppStart = function()
        application.streamTable = {};
        application.netConnTable = {};
        application.mcastNetStreamTable = {};
        application.netGroupTable = {};
    * Handles a publish event for the application by validating the request
    * and bridging the published stream into a target Flash Group. Invalid
    * publish requests are ignored and the publishing client's connection
    * is closed.
    * @param client - The publishing client.
    * @param stream - The published stream.
    application.onPublish = function(client, stream)
        //trace("Handling publish request for source stream: " + stream.name);
        var params = parseQueryString(stream.publishQueryString);
        if (!validateStreamParams(params))
            application.disconnect(client);
            return;
        var prevContext = getStreamContextForSourceStream(stream.name);
        if (prevContext)
            forceCloseStreamContext(prevContext);
        // Register source Stream, and kick off the async process that will
        // eventually wire-up the associated multicast NetStream.
        var streamContext = registerStream(client, stream.name, params);
        openMulticastConnection(streamContext);
    * Handles an unpublish event for the application by shutting down
    * any associated multicast NetStream.
    * @param client - The unpublishing client.
    * @param stream - The source stream being unpublished.
    application.onUnpublish = function(client, stream)
        trace("Handling unpublish request for source stream: " + stream.name);
        var streamContext = getStreamContextForSourceStream(stream.name);
        if (streamContext && (streamContext.state <= STATE_REPUBLISHING))
            destroyStreamContext(streamContext);
    // Callback functions for NetConnection and multicast NetStream/NetGroup wiring.
    * First step in setting up a republished multicast NetStream; open the loopback
    * connection it requires.
    * @param streamContext - The StreamContext Object for the publish event.
    function openMulticastConnection(streamContext)
        var nc = new NetConnection();
        nc.onStatus = netConnectionStatusHandler;
        streamContext.netConnection = nc;
        updateStreamContextLookups(streamContext);
        streamContext.state = STATE_CONNECTING;
        nc.connect(resetUriProtocol(streamContext.client.uri, "rtmfp"));
    * Status event handler for the loopback NetConnection used by the multicast
    * NetStream. Advances setup upon successful connection, or triggers or advances
    * tear-down as a result of connection loss or an unpublish and clean shutdown.
    * @param info - The status info Object.
    function netConnectionStatusHandler(info)
        var streamContext = getStreamContextForNetConnection(this);
        trace("Multicast NetConnection Status: " + info.code +
              (streamContext ? ", Source stream: " + streamContext.streamName : ", Not associated with a source stream."));
        if (streamContext)
            switch (info.code)
            case "NetConnection.Connect.Success":
                streamContext.state = STATE_CONNECTED;
                // If event type is Fusion or P2p, wire up a NetGroup for neighbor
                // bootstrapping and maintenance ahead of (re)publishing the stream.
                var type = streamContext.type;
                if (type == TYPE_FUSION || type == TYPE_P2P)
                    initNetGroup(streamContext);
                else
                    initMulticastNetStream(streamContext);
                break;
            case "NetConnection.Connect.Failed":
            case "NetConnection.Connect.Rejected":
            case "NetConnection.Connect.AppShutdown":
                trace("MULTICAST PUBLISH ERROR: Failed to establish server-side NetConnection for use by multicast NetStream. " +
                      "Status code: " + info.code + ", description: " + info.description + ", Source stream: " +
                      streamContext.streamName);
                streamContext.state = STATE_DISCONNECTED;
                destroyStreamContext(streamContext);
                break;
            case "NetConnection.Connect.Closed":
                if (streamContext.state < STATE_DISCONNECTING)
                    trace("MULTICAST PUBLISH ERROR: Unexpected server-side NetConnection close. " +
                         "Status code: " + info.code + ", description: " + info.description + ", Source stream: " +
                         streamContext.streamName);
                streamContext.state = STATE_DISCONNECTED;
                destroyStreamContext(streamContext);
                break;
            default:
                // Ignore.
    * Initializes the multicast NetGroup following a successful connection of its
    * underlying loopback NetConnection. This hook is optional and only runs for
    * event types of Fusion and pure P2P.
    * @param streamContext - The StreamContext Object for the multicast publish.
    function initNetGroup(streamContext)
        var ng = null;
        try
            ng = new NetGroup(streamContext.netConnection, streamContext.groupspec);
        catch (e)
            trace("MULTICAST PUBLISH ERROR: Failed to construct NetGroup. Error: "
                  + e.name + (e.message ? " " + e.message : "") +
                  ", Source stream: " + streamContext.streamName);
            destroyStreamContext(streamContext);
            return;
        ng.onStatus = netGroupStatusHandler;
        streamContext.netGroup = ng;
        updateStreamContextLookups(streamContext);
    * Status event handler for the multicast NetGroup. Advances to initializing the
    * multicast NetStream upon successful NetGroup connect. Otherwise, triggers
    * shut down.
    * @param info - The status info Object.
    function netGroupStatusHandler(info)
        var streamContext = getStreamContextForNetGroup(this);
        trace("Multicast NetGroup Status: " + info.code +
              (streamContext ? ", Source stream: " + streamContext.streamName : ", Not associated with a source stream."))
        if (streamContext)
            switch (info.code)
            case "NetGroup.Connect.Success":
                initMulticastNetStream(streamContext);
                break;
            case "NetGroup.Connect.Failed":
            case "NetGroup.Connect.Rejected":
                trace("MULTICAST PUBLISH ERROR: Failed to connect multicast NetGroup. " +
                      "Status code: " + info.code + ", description: " + info.description +
                      ", Source stream: " + streamContext.streamName);
                destroyStreamContext(streamContext);
                break;
            case "NetGroup.MulticastStream.UnpublishNotify":
                // At this point, multicast publishers will be notified;
                // continue shut down.
                destroyStreamContext(streamContext);
                break;
            default:
                // Ignore.
    * Initializes the multicast NetStream following a successful connection of its
    * underlying loopback NetConnection.
    * @param streamContext - The StreamContext Object for the multicast publish.
    function initMulticastNetStream(streamContext)
        var ns = null;
        try
            ns = new NetStream(streamContext.netConnection, streamContext.groupspec);
        catch (e)
            trace("MULTICAST PUBLISH ERROR: Failed to construct multicast NetStream. Error: " +
                  e.name + (e.message ? " " + e.message : "") +
                  ", Source stream: " + streamContext.streamName);
            destroyStreamContext(streamContext);
            return;
        var type = streamContext.type;
        if (type == TYPE_FUSION || type == TYPE_IP)
      var iAddr = (streamContext.interfaceAddress) ? streamContext.interfaceAddress : null;
            try
                trace("Multicast NetStream will publish to IP address: " + streamContext.address +
          " on interface address: " + ((iAddr) ? iAddr : "default") +
                      ", Source stream: " + streamContext.streamName);
                ns.setIPMulticastPublishAddress(streamContext.address, iAddr);
            catch (e2)
                trace("MULTICAST PUBLISH ERROR: Failed to assign IP multicast address and port for publishing. Address: "
                      + streamContext.address + " on interface address: " + ((iAddr) ? iAddr : "default") +
          ", Source stream: " + streamContext.streamName);
                destroyStreamContext(streamContext);
                return;
        ns.onStatus = netStreamStatusHandler;
        streamContext.mcastNetStream = ns;
        updateStreamContextLookups(streamContext);
        streamContext.state = STATE_PUBLISH_PENDING;
    * Status event handler for the multicast NetStream. Advances state upon successful
    * connect and publish, or upon successful unpublish. Triggers tear-down if we fail
    * to attach to a source Stream to republish.
    * @param info - The status info Object.
    function netStreamStatusHandler(info)
        var streamContext = getStreamContextForMulticastNetStream(this);
        trace("Multicast NetStream Status: " + info.code +
              (streamContext ? ", Source stream: " + streamContext.streamName : ", Not associated with a source stream."))
        if (streamContext)
            switch (info.code)
            case "NetStream.Connect.Success":
                if (!this.attach(Stream.get(streamContext.streamName)))
                    trace("MULTICAST PUBLISH ERROR: Failed to attach multicast NetStream to source. Source stream: " +
                          streamContext.streamName);
                    destroyStreamContext(streamContext);
        //var stream;
                //stream = Stream.get("liveStream");
                    //return;
                }else{
                this.publish(streamContext.streamName, "live");
                break;
            case "NetStream.Publish.Start":
                streamContext.state = STATE_REPUBLISHING;
                break;
            case "NetStream.Unpublish.Success":
                streamContext.state = STATE_UNPUBLISHED;
                // Wait for unpublish notify event if the context has a NetGroup;
                // otherwise continue shut down now.
                if (!streamContext.netGroup)
                    destroyStreamContext(streamContext);
                    break;
            default:
                // Ignore.
    * The common tear-down hook. Other functions that manage or shut down
    * the StreamContext Object delegate to this function upon detecting a fatal
    * error or during shut down.
    * @param streamContext - The StreamContext Object for the source Stream and
    *                        (potentially wired-up) multicast NetStream.
    function destroyStreamContext(streamContext)
        // Unregister by Stream name immediately; lookups by NetConnection, NetGroup
        // and multicast NetStream remain in place until tear-down is complete.
        delete application.streamTable[streamContext.streamName];
        switch (streamContext.state)
        case STATE_REPUBLISHING:
            streamContext.mcastNetStream.attach(false);
            streamContext.mcastNetStream.publish(false);
            streamContext.state = STATE_UNPUBLISHING;
            return;
        case STATE_CONNECTING:
        case STATE_CONNECTED:
        case STATE_PUBLISH_PENDING:
        case STATE_UNPUBLISHED:
            // Delete status handler callbacks and cleanup in case we arrived here
            // as a result of a force close.
            if (streamContext.netGroup)
                delete streamContext.netGroup.onStatus;
            if (streamContext.mcastNetStream)
                streamContext.mcastNetStream.attach(false);
                delete streamContext.mcastNetStream.onStatus;
            streamContext.netConnection.close();
            streamContext.state = STATE_DISCONNECTING;
            return;
        default:
            // Fall-through.
        // At this point, we either never got to the republishing state or we've
        // proceeded through the clean shut down steps above. Everything for this
        // StreamContext can go away.
        unregisterStreamContext(streamContext);
    * Utility function used to force close a StreamContext in the event that we
    * start handling a republish of a Source stream before the context for its
    * prior incarnation has been torn down.
    * @param streamContext - The StreamContext Object for the source Stream.
    function forceCloseStreamContext(streamContext)
        trace("Force closing previous multicast context for source stream: " + stream.name);
        prevContext.state = STATE_UNPUBLISHED;
        destroyStreamContext(prevContext);
    // Client callback functions
    * A no-op. Answers the RPC in the fashion expected by encoders, but the real
    * work happens in application.onPublish.
    * @param streamName - The name of the stream being published.
    Client.prototype.FCPublish = function(streamName)
        this.call("onFCPublish",
                  null,
                  {code:"NetStream.Publish.Start", description:streamName});
    * A no-op. Answers the RPC in the fashion expected by encoders, but the real
    * work happens in application.onUnpublish.
    * @param streamName - The name of the stream being unpublished.
    Client.prototype.FCUnpublish = function(streamName)
        this.call("onFCUnpublish",
                  null,
                  {code:"NetStream.Unpublish.Success", description:streamName});
    * If the client invoker's ip matches what was captured for a currently publishing
    * stream, assume it's the same client and reset the stream. Otherwise, ignore.
    * @param streamName - The name of the stream being released.
    Client.prototype.releaseStream = function(streamName)
        var streamContext = getStreamContextForSourceStream(streamName);
        if (streamContext &&
            (streamContext.client.ip == this.ip) &&
            (streamContext.state <= STATE_REPUBLISHING))
            // Only tear-down an orphaned stream if it's not
            // already shutting down (see state check above).
            destroyStreamContext(streamContext);
    // Helper functions
    * Validates that a newly published stream has correct metadata (e.g. query
    * string parameters) to republish into a Flash Group. This function also
    * writes a message to the application log for any validation failures.
    * @param params - The quiery string parameters for the source Stream.
    * @return true if valid; otherwise false.
    function validateStreamParams(params)
        var empty = true;
        for (var param in params)
           empty = false;
           break;
        if (empty)
            trace("MULTICAST PUBLISH ERROR: Stream query string is empty.");
            return false;
        if (!params["fms.multicast.type"])
    trace("MULTICAST PUBLISH ERROR: Stream query string does not specify a 'fms.multicast.type'.");
            return false;
        var type = params["fms.multicast.type"];
        if (type != 1 && type != 2 && type != 3)
            trace("MULTICAST PUBLISH ERROR: 'fms.multicast.type' has invalid value: " + type);
            return false;
        if (!params["fms.multicast.groupspec"])
            trace("MULTICAST PUBLISH ERROR: Stream query string does not specify a 'fms.multicast.groupspec'.");
            return false;
        // Fusion and IP require an address:port.
        if ((type == 1 || type == 2) &&
            !params["fms.multicast.address"])
            trace("MULTICAST PUBLISH ERROR: Stream query string does not specify a 'fms.multicast.address'.");
            return false;
        // No obvious validation issues.
        return true;
    * Parses the supplied query string, and if valid, returns an Object populated
    * with the name-value pairs contained in the query string. The simple processing
    * here does not preserve multiple name-value pairings having the same name; the
    * last value seen wins. Parameters with no value are mapped to "" (empty String)
    * in the returned Object.
    * @param queryString - A query string portion of a URI, not including the leading
    *                     '?' character.
    * @return An Object containing a key-value mapping for each name-value parameter
    *         defined in the query string; Object is empty if the query string is
    *         invalid.
    function parseQueryString(queryString)
        var result = {};
        var decoded = "";
        try
            decoded = decodeURIComponent(queryString);
        catch (e) // Invalid URI component; return empty result.
            return result;
        if (decoded.length)
            var params = decoded.split('&');
            for (var i in params)
                var pair = params[i];
         var sepIndex = pair.indexOf('=');
                if (sepIndex != -1)
                    var name = pair.substr(0, sepIndex);
                    result[name] = pair.substr(sepIndex + 1);
                else
                    result[pair] = "";
        return result;
    * Utility function used to swap out the protocol (scheme) portion
    * of a given URI with an alternate.
    * @param uri - The full URI.
    * @param desiredProtocol - The replacement protocol.
    * @return The URI with its protocol replaced.
    function resetUriProtocol(uri, desiredProtocol)
        var sepIndex = uri.indexOf("://");
        return desiredProtocol + uri.substr(sepIndex);

    HELP ME !!! THANKS!!!

  • Can ATV2 serve as source for Airplay speakers?  I'd like to send non-ITunes streaming (e.g. Netflix movies) to Airplay wireless speakers.

    Can ATV2 serve as source for Airplay speakers?  I'd like to send non-iTunes streaming (e.g. Netflix movies) directly from ATV2 to Airplay wireless speakers.

    Welcome to the Apple Community.
    No that's not currently possible sorry.

  • How Do I Get Cam Stream To Appear in FMLE Using iGlasses Software?

    How Do I Get Cam Stream To Appear in FMLE Using iGlasses Software?
    Sair

    Hi Roger,
    Thanks for your reply and my apologies for taking longer than hoped to respond.  The problem I'm having is that the cover art shows on my iPad (e.g. for "Meet the Press", a weekly American news programme), but it doesn't in either iTunes on my Mac or (consequently) my iPod Nano.
    I'm not sure I understand why the image, if it's embedded, would appear on one device but not on another for iTunes?
    I tried going to the iTunes store and dragging the cover art across to iTunes on my Mac, but it only brings the link across (rather than the image).
    Any help you could provide would be most appreciated!
    Thanks and best regards,
    Tony

  • Publish camera stream to rootInstall/applications/multicast of FMS4.5 with no data?

    I try to publish my camera stream to FMS4.5 (applications/multicast) as a P2P stream on the client-side,and I get reponse:“NetStream.Publish.Start ” and “NetStream.Connect.Success” ,
    but the NetStream info is "currentBytesPerSecond=0 byteCount=0 maxBytesPerSecond=0 audioBytesPerSecond=0 audioByteCount=0 ....metaData=null xmpData=null uri=rtmfp://218.199.102.119/multicast resourceName=null isLive=true" .
    By the way, when I run another client  to join the same group to play the video stream ,it ends with "
    NetStream.Connect.Success
    NetStream.Play.Reset
    NetStream.Play.Start
    NetStream.Connect.Success
    NetStream.Play.Reset
    NetStream.Play.Start
    NetStream.MulticastStream.Reset "
    and it can't play any video,I don't know why,can someone help me? I will very appreciate for it.
    Here is  my pubish side key code:
    server = "rtmfp://218.199.102.119/multicast";
    case "NetConnection.Connect.Success":
                                                       groupSpecifier = new GroupSpecifier(videoName);//不透明的 groupspec 字符串。groupspec 指定 RTMFP 对等组
                                                       groupSpecifier.serverChannelEnabled = true; //设置允许创建到服务端的通道,方便服务器通告其他peers新增一个peer
                                                       groupSpecifier.ipMulticastMemberUpdatesEnabled = true;
                                                       groupSpecifier.multicastEnabled = true;//启用多播
                                                       groupSpecifier.postingEnabled = true;//为NetGroup启用发布
                                                       netGroup = new NetGroup(netConnection,groupSpecifier.groupspecWithAuthorizations());
                                                       netGroup.addEventListener(NetStatusEvent.NET_STATUS,NetStatus_Handler);                                                                                                      
                                                       break;
                                            case "NetGroup.Connect.Success":
                                                      trace(e.info.code);
                                                      netStream = new NetStream(netConnection,groupSpecifier.groupspecWithAuthorizations());
                                                      netStream.addEventListener(NetStatusEvent.NET_STATUS,NetStatus_H andler);
                                                      //发布视频
                                                      trace("to publish stream: "+videoName);
                                                      netStream.attachCamera(camera);
                                                      netStream.publish(videoName);
                                                      break;
                                            case "NetStream.Publish.Start":
                                                      trace(e.info.code+" "+" 成功发布");
                                                      trace("NetStream info: "+netStream.info.toString()); 
                                                      break;
                                            case "NetStream.Connect.Success":
                                                      trace(e.info.code+ " P2P连接成功");
                                                      break;
    when running the console print:
    Connecting sever rtmfp://218.199.102.119/multicast
    NetConnection.Connect.Success
    NetGroup.Connect.Success
    to publish stream: Video 1 (T306E Card 1)
    NetStream.Publish.Start  成功发布
    NetStream info: currentBytesPerSecond=0 byteCount=0 maxBytesPerSecond=0 audioBytesPerSecond=0 audioByteCount=0 videoBytesPerSecond=0 videoByteCount=0 dataBytesPerSecond=0 dataByteCount=0 playbackBytesPerSecond=0 droppedFrames=0 audioBufferLength=0 videoBufferLength=0 dataBufferLength=0 audioBufferByteLength=0 videoBufferByteLength=0 dataBufferByteLength=0 srtt=0 audioLossRate=0 videoLossRate=0 metaData=null xmpData=null uri=rtmfp://218.199.102.119/multicast resourceName=null isLive=true
    NetStream.Connect.Success P2P连接成功
    NetGroup.Neighbor.Connect

    I traced the NetStream info under case "NetGroup.Neighbor.Connect":
    this time it has data "NetStream info: currentBytesPerSecond=102558.79345603273 byteCount=2456888 maxBytesPerSecond=116816.66032712058 audioBytesPerSecond=0 audioByteCount=0 videoBytesPerSecond=102558.79345603273 videoByteCount=2456888 dataBytesPerSecond=0 dataByteCount=0 playbackBytesPerSecond=0 droppedFrames=0 audioBufferLength=0 videoBufferLength=0 dataBufferLength=0 audioBufferByteLength=0 videoBufferByteLength=0 dataBufferByteLength=0 srtt=0 audioLossRate=0 videoLossRate=0 metaData=null xmpData=null uri=rtmfp://218.199.102.119/multicast resourceName=null isLive=true".
    but 2nd client still results with:
    NetStream.Connect.Success P2P连接成功,启动播放...
    NetStream.Play.Reset
    NetStream.Play.Start
    NetStream.Connect.Success P2P连接成功,启动播放...
    NetStream.Play.Reset
    NetStream.Play.Start
    NetStream.MulticastStream.Rese
    Twice "NetStream.Connect.Success" and "NetStream.Play.Reset" ,and the video still can't play .....Help......

  • Online camera streams not working

    Hey
    When I go to a website to watch a live camera stream it doesn't work. It only keeps loading for ages and nothing happens. I've tried several websites. I tried Chatroulette and even that didn't work. Apparently it doesn't work to load my own cam either. It's not my firewall as I've already checked that. Does anyone know what the problem might be?
    Thanks

    I didn't even know what Chatroulette was but I went to the site and I could activate my camera and mic, at least. Had no idea, and didn't hang around long enough, to see if anyone popped in.
    Do your camera and mic work in Facetime, Skype, etc.? Can you see others images using those servers? Could your ISP be blocking access?
    Clinton

  • How to  send messages via shareobject in FMS

    How to send messages via shareobject in FMS
    I need some codes.
    I want to send some string messages via shareobject, the
    string messages can be retrieve in client.
    Can you give me some codes? Thank you for your help..
    /

    Thanks for your comment.
    en....I want to do something..I will maintenance a users list
    in charroom.
    I write a function in main.asc file , client can get users
    list via call the function.
    I write some codes in application.onConnect
    when a user connect, it will add users list.
    In application.onDisconnect, when a user disconnect, it will
    remove from users list.
    My hope when a user disconnect, I send a message to
    shareobject. the shareobject is called in other clients.
    Other client can retrieve the remove user message, they will
    call the function to get new users list.
    It is my idea. Can you give me some codes for my idea?
    Thank you very much.

  • Sending data with streams

    What is the best way to send files using java? I was trying datagrams, but it takes forever to write a file from byte[]'s. Any ideas?

    So we're talking streaming video (ergo: sending data with streams) I'm a bit slow today, apparently.
    From what I think I know about datagrams... it's the way to go for "broadcasting" any type of data... and whilste it can be a bit lossy (complete, in-order delivery is NOT garanteed), it usually works 100% A-OK on LAN's (on high-quality underlying network hardware, of course).
    The only thing I've ever done with datagrams is the typical noob chat-app (with a simple swing interface), which I posted on this forum ?years? ago... maybe you can still find it.
    Cheers. Keith/
    Edited by: corlettk on 30/12/2008 12:49 ~~ WAAAAAY too slow today. Apparently. Ignore this post (except the link).

  • Publish Live stream to FMS on RTMPE protocol

    Hi,
    I am trying to publish Live Stream to FMS using FMLE or third party encoders.
    Is it possible to have RTMPE or RTMPTE protocol used between encoder and FMS?
    Very urgent.
    thanks,
    Pooja Jain

    FMLE can only publish via rtmp or rtmpt.

  • Air iOS Camera Uploading Photo

    Currently, I am encountering problem with Adobe Flash CS6 tutorial at http://www.fizixstudios.com/labs/do/view/id/air-ios-camera-and-uploading-photos. After creating and naming the instances & type the coding in ActionScript file, I can't seems to execute and make it work and looking forward to hear from you all soon.

    Currently, I am encountering problem with Adobe Flash CS6 tutorial at http://www.fizixstudios.com/labs/do/view/id/air-ios-camera-and-uploading-photos. After creating and naming the instances & type the coding in ActionScript file, I can't seems to execute and make it work and looking forward to hear from you all soon.

Maybe you are looking for