Problem playing remote live stream from FMS

Hello all,
I'm having problems playing remote live streams from FMS (server-side) that I can play with any other player (client-side)
Example of server-side application which plays a remote live stream:
nc = new NetConnection();
nc.connect("rtmp://remoteserver/live");
stream = Stream.get("localStream");
stream.play("remoteStream.flv", -1, -1, true, nc);
This code works only sometimes.
Most of the times, FMS is able to connect to remote string and the localStream dispatches events:
   NetStream.Publish.Strart
   NetStream.Play.Reset
In this case, FMS is publishing the local stream but it is not playing the remoteStrem on it.
The rest of the times, localStream dispatches events:
   NetStream.Publish.Strart
   NetStream.Play.Reset
   NetStream.Play.Start
   NetStream.Data.Start
In this case FMS plays the remoteStream correctly.
Any hint to solve this issue?
Regards.

Thanks, I tried your code and it works when playing a remote live stream on another FMS.
But the remote live stream is not on a FMS but on a Wowza Server which re-streams an RTSP stream over RTMP.
With this code:
var nc;
var myStream;
application.onAppStart = function(){
     nc = new NetConnection();
     myStream = Stream.get("localstream");
     myStream.onStatus= function(info){
           trace(info.code);
     nc.onStatus = function(info){
           trace (info.code);
           if(info.code == "NetConnection.Connect.Success" ){
                myStream.play("remoteLive.sdp", -1, -1, true, nc);
     nc.connect("rtmp://remoteServer/live");
Every live stream player I tried was able to play the remote stream "remoteLive.sdp", but FMS play it only sometimes. This is the output log of the FMS application:
NetConnection.Connect.Success
NetStream.Publish.Start
NetStream.Play.Reset        <--------------------------------- Stuck there, stream won't play
Unloaded application instance wowza4/_definst_ <--- Reload app
NetConnection.Connect.Success
NetStream.Publish.Start
NetStream.Play.Reset        <--------------------------------- Stuck there, stream won't play
Unloaded application instance wowza4/_definst_ <--- Reload app
NetConnection.Connect.Success
NetStream.Publish.Start
NetStream.Play.Reset
NetStream.Play.Start         <--------------------------------- Stream is playing just fine
NetStream.Data.Start
Unloaded application instance wowza4/_definst_ <--- Reload app
NetConnection.Connect.Success
NetStream.Publish.Start
NetStream.Play.Reset       <--------------------------------- Stuck there, stream won't play
Any idea? Why FMS won't play it everytime?
Regards

Similar Messages

  • Could you play a live stream from safari to apple tv without going through itunes?

    could you play a live stream from safari to apple tv without going through itunes?

    There is no way to stream Safari content, with or without iTunes, to your AppleTV.
    The only way would be to use a mirroring feature given that you have an AppleTV 2nd gen or newer and a 2011 or newer MBP running mountain lion.
    If not, some third party software like AirParrot can also gives you way to mirror your MBP display on the TV.

  • Live Stream from FMS

    I have install the Flash Media Server and Flash Media Live Encoder. Everything run perfectly when I test the Live Stream through localhost, but if I try to embed to another machine, it is failed. Anybody have an idea how to fix it?

    Have you made sure your firewall allows incoming traffic on 1935 - i think it would be firewall issue.

  • Playback of low bitrate flv or f4v from live stream in FMS causes player buffer to empty

    We are experiencing a consistent issue when playing a low bitrate (300kbps or less) flv in a live stream from FMS.  Basically, the player will will start off with the appropriate buffer, say 5 seconds, then begin dropping until it empties out, and will have to rebuffer.  We've tried with a variety of flv and f4v files, all that are 300kbps or less, and we consistently get the issue.  Is this something Adobe can investigate in FMS?  Or are there any suggestions on how we can get around the issue?

    hey, i got the similar problem, logging like this
    2012-11-12
    18:50:12
    23434
    (e)2661034
    Connect failed ( , 5779212 ) : Connect failed: Connection refused (111)
    2012-11-12
    18:50:54
    23434
    (e)2661034
    Connect failed ( , 5779212 ) : Connect failed: Connection refused (111)
    2012-11-12
    18:51:36
    23434
    (e)2661034
    Connect failed ( , 1166880400 ) : Connect failed: Connection refused (111)
    2012-11-12
    18:54:14
    23434
    (e)2661034
    Connect failed ( , 1175301776 ) : Connect failed: Connection refused (111)
    2012-11-12
    18:54:55
    23434
    (e)2661034
    Connect failed ( , 1164775056 ) : Connect failed: Connection refused (111)
    2012-11-12
    18:55:37
    23434
    (e)2661034
    Connect failed ( , 16 ) : Connect failed: Connection refused (111)
    2012-11-12
    19:13:08
    23434
    (e)2661034
    Connect failed ( , 1158459024 ) : Connect failed: Connection refused (111)
    it seems that the port number is invalid, but we never use such ports.

  • Sending Live Stream from one FMS to another FMS

    Hey,
    Here's what I would like to do:
    1. The Flash Media Encoder sends a live stream to FMS 1
    2. On FMS 1, a connection to FMS 2 is set up and the live
    stream is sent to FMS 2.
    3. Every second, a message with metadata is sent to FMS 2
    using Stream.send()
    4. A Client connecting to FMS 2 receives the stream and the
    metadata that was sent along with it.
    I know this sounds pretty confusing, but the main problem is,
    that I don't have access to the FMS 2, so I can't call
    Stream.send() there. First I thought the solution would be using
    Stream.play() with a remote connection, but when I call the
    Stream.send() method nothing happens on the client side.
    Then I thought I could do the whole thing by using a client
    side application that connects to FMS 1, receives the stream,
    embeds the metadata and publishes it to FMS 2. Here's the code I
    used:
    // Connect to FMS 1 to get stream
    client_nc.connect("rtmp://localhost/encoder_stream/room_01",
    "Client");
    // Create input stream
    in_ns = new NetStream(client_nc);
    // Connect to FMS 2
    akamai_nc.connect("rtmp://localhost/akamai/room_01",
    "Client");
    // Create new stream, feed with in_ns and send to FMS2
    out_ns = new NetStream(akamai_nc);
    out_ns.publish("stream");
    out_ns.attachVideo(in_ns);
    Unfortunately the attachVideo method only accepts a camera
    and not a netstream object.
    So this is where I'm standing now... anyone any ideas?
    thanks

    Hello,
    i've asked our Akamai contact and they say it's not possible
    to install any scripts on their servers. I think the only way is to
    push the stream from FMS1 to FMS2, but since FMS doesn't support a
    push method, there i have to find another way *sigh*
    I've heard about FMS version 3 coming up soon, and I'd really
    like to play around with the alpha version. Any idea where you can
    get it from? On Steve Wolkoffs blog it says the new FMS is going to
    support a push method:
    http://blogs.adobe.com/dreaming/2006/10/fmsnext_feature_open_thread.html
    I've also played around with the Red5 server, but I couldn't
    find anything there to achieve a server side push method. Does
    anyone have any experience with Red5 and live streaming?
    Cheers!

  • About Live stream with FMS

    Hi,
    I am doing somthing FMS.I download the FMS4 and Adobe Flash Midea Encoder3.5 here.
    Installed to my PC,they are working without any configure.
    and now I want to develop a client base on gstreamer to play the RTMP:// videos.
    My client play VOD video on FMS as rtmp://MYIP/vod/sample.flv without any problem.
    When I change to play the live video published by Adobe Flash Midea Encoder3.5,rtmp://MYIP/live/livestream.flv,it can start,but stoped after about 2 second.
    I make some debug,it seems the server stop to send data to my client.And after this stoped ,it can not start again,must reboot my client;
    I have checked the server with rtmpdump + VLC,it works fine.
    The Log in FMS is:
    Accepted a connection from IP:192.168.0.95, referrer: , pageurl:
    Sending error message: Method not found (FCSubscribe).
    Sending error message: Response object not found (_result:2147483647).
    "Sending error message: Method not found (FCSubscribe)." this display also with rtmpdump.
    "Sending error message: Response object not found (_result:2147483647)." this only with my client,what's the reason?
    In my client,I see the following after about 2 second:
    WARNING: Stream corrupt?!
    ERROR: Wrong data size (16717496), stream corrupted, aborting!
    What's happen when my client connect to FMS?  What's the defference between VOD and LIVE?
    Anyone try this with gstreamer?

    Thanks a lot for you reply;
    With your tool link,it can play the live video from the my server;
    But my client is based on Linux,and can not support web browser,so I try to implament it with Gstreamer;
    I published the video with the default setting of Adobe Flash Media Encoder 2.5,just set video format to H264.
    Today,I make some more debug,
    please help to analyse it,maybe you can find some thing form the log;
    DEBUG: Parsing...
    DEBUG: Parsed protocol: 0
    DEBUG: Parsed host    : 192.168.0.143
    DEBUG: Parsed app     : live
    DEBUG: Protocol : RTMP
    DEBUG: Hostname : 192.168.0.143
    DEBUG: Port     : 1935
    DEBUG: Playpath : livestream
    DEBUG: tcUrl    : rtmp://192.168.0.143:1935/live
    DEBUG: app      : live
    DEBUG: live     : yes
    DEBUG: timeout  : 30 sec
    DEBUG: Setting buffer time to: 36000000ms
    DEBUG: RTMP_Connect1, ... connected, handshaking
    DEBUG: HandShake: Type Answer   : 03
    DEBUG: HandShake: Server Uptime : 558990173
    DEBUG: HandShake: FMS Version   : 4.0.0.1
    DEBUG: HandShake: Handshaking finished....
    DEBUG: RTMP_Connect1, handshaked
    DEBUG: Invoking connect
    Pipeline is PREROLLING ...
    DEBUG: HandleServerBW: server BW = 2500000
    DEBUG: HandleClientBW: client BW = 2500000 2
    DEBUG: HandleChangeChunkSize, received: chunk size change to 4096
    DEBUG: RTMP_ClientPacket, received: invoke 242 bytes
    DEBUG: (object begin)
    DEBUG: (object begin)
    DEBUG: Property: <Name:             fmsVer, STRING:     FMS/4,0,0,1121>
    DEBUG: Property: <Name:       capabilities, NUMBER:     255.00>
    DEBUG: Property: <Name:               mode, NUMBER:     1.00>
    DEBUG: (object end)
    DEBUG: (object begin)
    DEBUG: Property: <Name:              level, STRING:     status>
    DEBUG: Property: <Name:               code, STRING:     NetConnection.Connect.Success>
    DEBUG: Property: <Name:        description, STRING:     Connection succeeded.>
    DEBUG: Property: <Name:     objectEncoding, NUMBER:     0.00>
    DEBUG: Property: <Name:               data, OBJECT>
    DEBUG: (object begin)
    DEBUG: Property: <Name:            version, STRING:     4,0,0,1121>
    DEBUG: (object end)
    DEBUG: (object end)
    DEBUG: (object end)
    DEBUG: HandleInvoke, server invoking <_result>
    DEBUG: HandleInvoke, received result for method call <connect>
    DEBUG: sending ctrl. type: 0x0003,nTime: 0x12c
    DEBUG: Invoking createStream
    DEBUG: FCSubscribe: livestream
    DEBUG: Invoking FCSubscribe
    DEBUG: RTMP_ClientPacket, received: invoke 21 bytes
    DEBUG: (object begin)
    DEBUG: Property: NULL
    DEBUG: (object end)
    DEBUG: HandleInvoke, server invoking <onBWDone>
    DEBUG: Invoking _checkbw
    DEBUG: RTMP_ClientPacket, received: invoke 29 bytes
    DEBUG: (object begin)
    DEBUG: Property: NULL
    DEBUG: (object end)
    DEBUG: HandleInvoke, server invoking <_result>
    DEBUG: HandleInvoke, received result for method call <createStream>
    DEBUG: SendPlay, seekTime=0, stopTime=0, sending play: livestream
    DEBUG: Invoking play
    DEBUG: sending ctrl. type: 0x0003,nTime: 0x2255100
    DEBUG: RTMP_ClientPacket, received: invoke 119 bytes
    DEBUG: (object begin)
    DEBUG: Property: NULL
    DEBUG: (object begin)
    DEBUG: Property: <Name:              level, STRING:     error>
    DEBUG: Property: <Name:               code, STRING:     NetConnection.Call.Failed>
    DEBUG: Property: <Name:        description, STRING:     Method not found (FCSubscribe).>
    DEBUG: (object end)
    DEBUG: (object end)
    DEBUG: HandleInvoke, server invoking <_error>
    ERROR: rtmp server sent error
    DEBUG: RTMP_ClientPacket, received: invoke 16419 bytes
    DEBUG: (object begin)
    DEBUG: Property: NULL
    DEBUG: (object end)
    DEBUG: HandleInvoke, server invoking <_onbwcheck>
    DEBUG: Invoking _result
    DEBUG: HandleChangeChunkSize, received: chunk size change to 4096
    DEBUG: HandleCtrl, received ctrl. type: 0, len: 6
    DEBUG: HandleCtrl, Stream Begin 1
    DEBUG: RTMP_ClientPacket, received: invoke 162 bytes
    DEBUG: (object begin)
    DEBUG: Property: NULL
    DEBUG: (object begin)
    DEBUG: Property: <Name:              level, STRING:     status>
    DEBUG: Property: <Name:               code, STRING:     NetStream.Play.Reset>
    DEBUG: Property: <Name:        description, STRING:     Playing and resetting livestream.>
    DEBUG: Property: <Name:            details, STRING:     livestream>
    DEBUG: Property: <Name:           clientid, STRING:     oAA7AAAA>
    DEBUG: (object end)
    DEBUG: (object end)
    DEBUG: HandleInvoke, server invoking <onStatus>
    DEBUG: HandleInvoke, onStatus: NetStream.Play.Reset
    DEBUG: RTMP_ClientPacket, received: invoke 156 bytes
    DEBUG: (object begin)
    DEBUG: Property: NULL
    DEBUG: (object begin)
    DEBUG: Property: <Name:              level, STRING:     status>
    DEBUG: Property: <Name:               code, STRING:     NetStream.Play.Start>
    DEBUG: Property: <Name:        description, STRING:     Started playing livestream.>
    DEBUG: Property: <Name:            details, STRING:     livestream>
    DEBUG: Property: <Name:           clientid, STRING:     oAA7AAAA>
    DEBUG: (object end)
    DEBUG: (object end)
    DEBUG: HandleInvoke, server invoking <onStatus>
    DEBUG: HandleInvoke, onStatus: NetStream.Play.Start
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: RTMP_ClientPacket, received: notify 24 bytes
    DEBUG: (object begin)
    DEBUG: (object end)
    DEBUG: RTMP_ClientPacket, received: notify 487 bytes
    DEBUG: (object begin)
    DEBUG: (object begin)
    DEBUG: Property: <Name:             author, STRING:     >
    DEBUG: Property: <Name:          copyright, STRING:     >
    DEBUG: Property: <Name:        description, STRING:     >
    DEBUG: Property: <Name:           keywords, STRING:     >
    DEBUG: Property: <Name:             rating, STRING:     >
    DEBUG: Property: <Name:              title, STRING:     >
    DEBUG: Property: <Name:         presetname, STRING:     Custom>
    DEBUG: Property: <Name:       creationdate, STRING:     Thu Jun 09 08:55:02 2011
    >
    DEBUG: Property: <Name:        videodevice, STRING:     Syntek STK1150>
    DEBUG: Property: <Name:          framerate, NUMBER:     25.00>
    DEBUG: Property: <Name:              width, NUMBER:     320.00>
    DEBUG: Property: <Name:             height, NUMBER:     240.00>
    DEBUG: Property: <Name:       videocodecid, NUMBER:     7.00>
    DEBUG: Property: <Name:      videodatarate, NUMBER:     200.00>
    DEBUG: Property: <Name:           avclevel, NUMBER:     31.00>
    DEBUG: Property: <Name:         avcprofile, NUMBER:     66.00>
    DEBUG: Property: <Name:        audiodevice, STRING:     Realtek HD Audio Input>
    DEBUG: Property: <Name:    audiosamplerate, NUMBER:     22050.00>
    DEBUG: Property: <Name:      audiochannels, NUMBER:     1.00>
    DEBUG: Property: <Name:   audioinputvolume, NUMBER:     100.00>
    DEBUG: Property: <Name:       audiocodecid, NUMBER:     2.00>
    DEBUG: Property: <Name:      audiodatarate, NUMBER:     32.00>
    DEBUG: (object end)
    DEBUG: (object end)
    INFO: Metadata:
    INFO:   author
    INFO:   copyright
    INFO:   description
    INFO:   keywords
    INFO:   rating
    INFO:   title
    INFO:   presetname            Custom
    INFO:   creationdate          Thu Jun 09 08:55:02 2011
    INFO:   videodevice           Syntek STK1150
    INFO:   framerate             25.00
    INFO:   width                 320.00
    INFO:   height                240.00
    INFO:   videocodecid          7.00
    INFO:   videodatarate         200.00
    INFO:   avclevel              31.00
    INFO:   avcprofile            66.00
    INFO:   audiodevice           Realtek HD Audio Input
    INFO:   audiosamplerate       22050.00
    INFO:   audiochannels         1.00
    INFO:   audioinputvolume      100.00
    INFO:   audiocodecid          2.00
    INFO:   audiodatarate         32.00
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: ignoring too small video packet: size: 2
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: ignoring too small video packet: size: 2
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: ignoring too small audio packet: size: 0
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
    DEBUG: HandleCtrl, Stream BufferEmpty 1
    DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
    DEBUG: HandleCtrl, Stream BufferReady 1
    WARNING: Stream corrupt?!
    ERROR: Wrong data size (8059624), stream corrupted, aborting!
    DEBUG: RTMP_ReadPacket, m_nChannel: 167
    DEBUG: RTMP_ClientPacket, unknown packet type received: 0xe3
    DEBUG: RTMP_ReadPacket, m_nChannel: 6ad6
    DEBUG: RTMP_ReadPacket, m_nChannel: 3d7c
    DEBUG: RTMP_ClientPacket, unknown packet type received: 0x00
    DEBUG: HandleCtrl, received ctrl. type: 8760, len: 6
    DEBUG: HandleCtrl, Stream xx -1742407864
    DEBUG: RTMP_ClientPacket, unknown packet type received: 0x2a
    DEBUG: RTMP_ClientPacket, unknown packet type received: 0x2a
    DEBUG: RTMP_ClientPacket, unknown packet type received: 0x2a
    DEBUG: RTMP_ClientPacket, unknown packet type received: 0x2a
    DEBUG: RTMP_ClientPacket, unknown packet type received: 0x2a
    DEBUG: RTMP_ClientPacket, unknown packet type received: 0xff
    DEBUG: RTMP_ClientPacket, unknown packet type received: 0xff
    DEBUG: RTMP_ReadPacket, m_nChannel: 5260
    DEBUG: RTMP_ReadPacket, failed to allocate packet
    Got EOS from element "pipeline0".
    Execution ended after 69266417190 ns.
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    DEBUG: Invoking deleteStream
    Setting pipeline to NULL ...
    FREEING pipeline ...
    After a short transfers,the client can not get the data.It seems that the Connection reset by peer;

  • 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!!!

  • Live Streaming from Video File

    Hi everyone,,, im newbie in programming streaming video with flash....ater reading documentations i tried the instructions on doc, i got a question that i've not been solved. How to make a "live streaming" from "video file". It likes a live streaming from camera but it uses video file  as the source.... many thanks

    Do you mean you have video file but you want to publish it as live stream , am i right? If yes following is the solution, but before that let me clarify you will need server to do it , i mean there is no way Flash client (i.e. .swf file running in Flash Player) can publish file from local disk.
    Now let me tell you how to do it from server:
    Place your video file under "streams" folder of your application i.e. say "myVideo.flv" under  <FMS root>/applications/myApp/streams/_definst_
    Now write following code in your main.asc file (this file would be under <FMS root>/applications/myApp )
    var mystream;
    application.onAppStart = function(){
         mystream = Stream.get("livestream");
         mystream.play("myVideo",0,-1,true);
    This will publish "myVideo" file as live stream under name of "livestream". Client would have to subscriber using NetStream and
    use ns.play("livestream",-1,-1)
    You might have to write some extra code if you want to loop same file else once play of recorded file gets over , live publish will automatically stop.
    let me know if this solves your problem

  • 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.

  • Live stream on FMS issues when reaching 1600 concurrent users

    Hey all,
    We have an FMS 4.5.2 installation with 1x Origin and 2x Edge setup only for Live streaming. We are using FMLE latest version to stream to the Origin server and Edge servers are connecting to the Origin server. We are running four applications stream1, stream2, stream3 and stream4 all for live streaming (copied live) application. All servers have default configuration except edge/origin setup.
    All servers have 4Gbit connections in bonding and network traffic is nicely distributed across all bonds and uplink is 10Gbit to the ISP.
    Server is a 2 CPU / Quad Core HP DL 380 with 64Gbit of memory running Ubuntu 10.04 LTS
    Now to the problem.
    We are streaming live stream from FMLE with 700kbit/s to for example stream1 application and when we hit around 1600 concurrent users with 50% on edge1 and 50% on edge2 (800 concurrent users on each edge) in the player buffer drops and all people experience buffering issues at approx 30secs - 2minutes intervals. (network is not congested because if at that time do an SCP from the server outside network it copies 1Gbyte file within seconds.
    Funny thing is that If I start a second FMLE and stream live stream to for example stream2 application at same time and open up second player on client the video runs great without any buffer issues from the same server at the same time.
    edge1 server:
    application: stream1 with 800 concurrent users, player has buffer issues
    application: stream2 with 4 concurrent users, player has no issues
    edge2 server
    same as above
    So my current conclusion is that it has to be something per application since other application does not have this issues when running simultaneously? We tried changing fmscore number settings and some buffer settings but nothing helped.
    at the time when we get buffering issues this are the only problematic things that get in the log and its in edge.00.log on both EDGE servers but not at same times:
    Edge1:
    2012-04-23    12:50:21    29270    (e)2661034    Connect failed ( , 8134 ) : Connect failed: Connection refused (111)    -
    2012-04-23    12:55:30    29270    (e)2661034    Connect failed ( , 8134 ) : Connect failed: Connection refused (111)    -
    2012-04-23    12:56:42    29270    (e)2661034    Connect failed ( , 8134 ) : Connect failed: Connection refused (111)    -
    2012-04-23    12:56:42    29270    (e)2661034    Connect failed ( , 8134 ) : Connect failed: Connection refused (111)    -
    2012-04-23    13:14:40    29270    (e)2661034    Connect failed ( , 8134 ) : Connect failed: Connection refused (111)    -
    2012-04-23    13:20:30    29270    (e)2661034    Connect failed ( , 8134 ) : Connect failed: Connection refused (111)    -
    Edge2:
    2012-04-23    12:56:32    9625    (e)2661034    Connect failed ( , 8134 ) : Connect failed: Connection refused (111)    -
    2012-04-23    13:02:23    9625    (e)2661034    Connect failed ( , 8134 ) : Connect failed: Connection refused (111)    -
    2012-04-23    13:08:03    9625    (e)2661034    Connect failed ( , 8134 ) : Connect failed: Connection refused (111)    -
    there is no packet loss between edge and origin servers and latency is at 0.2ms and nothing in the logs of the origin server
    We even tried to deploy Wowza Medis Servers with edge / origin setup and were able to handle around 4000 (2000 on one and 2000 on second edge) concurrent users without any issues.
    Anyone has any ideas or at least what are our next options to do and what settings to change on the FMS? or how to debug and what to check when buffering issue appears? any more debugging we can enable on the FMSs? too se if we hit some kind of limit somewhere?
    thanks

    hey, i got the similar problem, logging like this
    2012-11-12
    18:50:12
    23434
    (e)2661034
    Connect failed ( , 5779212 ) : Connect failed: Connection refused (111)
    2012-11-12
    18:50:54
    23434
    (e)2661034
    Connect failed ( , 5779212 ) : Connect failed: Connection refused (111)
    2012-11-12
    18:51:36
    23434
    (e)2661034
    Connect failed ( , 1166880400 ) : Connect failed: Connection refused (111)
    2012-11-12
    18:54:14
    23434
    (e)2661034
    Connect failed ( , 1175301776 ) : Connect failed: Connection refused (111)
    2012-11-12
    18:54:55
    23434
    (e)2661034
    Connect failed ( , 1164775056 ) : Connect failed: Connection refused (111)
    2012-11-12
    18:55:37
    23434
    (e)2661034
    Connect failed ( , 16 ) : Connect failed: Connection refused (111)
    2012-11-12
    19:13:08
    23434
    (e)2661034
    Connect failed ( , 1158459024 ) : Connect failed: Connection refused (111)
    it seems that the port number is invalid, but we never use such ports.

  • Unable to play Level3 live stream with OSMF v1.0

    Hi,
    I'm trying to play a live stream hosted by level3. When adding the mp4: prefix to my rtmp stream url I am able to connect but get a mediaError:
    "Failed to play  (stream ID: 1)".
    parallelElement.addChild(mediaFactory.createMediaElement(new URLResource(config.rtmpUrl)));
    rtmpUrl: rtmp://link-to-level3-server.net/app/mp4:name/streamname/live
    I've tested the same stream in flowplayer and jwplayer; both work like a charm. I've noticed that Level3 is listed as a planned CDN  provider on the osmf page. Do I have to wait for the level3 plugin to be released or am I missing someting here?

    I just found this post: http://forums.adobe.com/message/2782150#2782150
    Adding a streamingURLResource like below doesn't give any mediaErrors.
    var resource:StreamingURLResource = new StreamingURLResource(config.rtmpUrl);
    resource.urlIncludesFMSApplicationInstance = true;
    parallelElement.addChild(new VideoElement(resource));
    I have to test it when I'm back at the office but it seems promising.
    Keep you posted!

  • 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.

  • Flash Player wont play a live stream (WIN or LINUX)

    hi everyone,
    i have an issue with my flash player (LATEST VERSION) on both my windown and also linux OS.  while trying to view a live stream from either twitch.tv or justin.tv, i get a cream colored background where the video should be displayed, however youtube and a few other sites work fine.  i have tried a number of things to try to resolve this issue such as re-installing, disabling all other addons, installing an older version, reseting IE and Firefox to default and nothing seems to work. i have the exact same issue on my linux also (ubuntu 12 LTS).......  
    although you may think i should just got to another streaming site that does work. twitch tv and justin tv are the only one that stream the content i am looking for. (dust 514/EVE weekly live video cast) (http://www.twitch.tv/ccp/old).
    can anyone give me any info on this matter, or how i may be able to resolve it.
    Thank you for any assistance you can provide.

    My computer info is as follows :   vista sp2, IE 9 + Firefox 19.0.2       -         2nd OS =  Ubuntu 12.04 LTS   with Firefox

  • How can I save to computer a live streaming from Ustream

    Hi
    That's the question.
    I want to save a live streaming from Ustream.
    any help?
    tnx.

    Install Livestramer (with all python dependencies)
    https://wiki.archlinux.org/index.php/Livestreamer
    livestreamer -p vlc https://www.ustream.tv/embed/9979779
    Found matching plugin ustreamtv for URL https://www.ustream.tv/embed/9979779
    Available streams: 240p, 240p_alt_akamai, 360p, 360p_alt_akamai, 480p, 480p_alt_akamai, 720p+ (best), 720p+_alt_akamai, mobile_240p (worst), mobile_360p, mobile_480p
    livestreamer -p vlc https://www.ustream.tv/embed/9979779 720p+
    same with mpv-Player

  • Music plays slowly on Apple TV with Remote or Streaming from ATV

    When using Apple's Remote application on my iPhone or when selecting streamed playlists from my Apple TV the music plays slowly. It plays with no interruptions, what I mean is that the tempo is off. I do not have this problem when selecting and streaming through AirTunes to the AppleTV from my Mac Pro.
    This started to happen with iTunes8...
    Anyone else notice this? It is truly irritating to listen to music when it just isn't up to speed.

    I appreciate that in a pc environment with a full blown operating system you shouldn't really need to restart to diagnose faults, however I believe we are all going to need to get used to restarting consumer gadgets on a regular basis. I've been in the habit of restarting my phone every day for around five or six years now and I didn't stop when I got my iphone.

Maybe you are looking for