Skip to main content
Participant
September 13, 2010
Question

RTMP connections stall unless network 'bypassed'

  • September 13, 2010
  • 2 replies
  • 2332 views

We have been having a strange problem with the Flash Media Server 4 (development edition) that I would be very gratefull if anyone could shed any light on.


Situation:

We set up a dev FMS so that we could test content for clients before pushing it onto a CDN and for evaluating various hardware encoders that claim to support flash..  Everything appears to be working perfectly after the install; all the samples played back perfectly over the localhost.   Furthermore I was able to add  my own items into the VoD folder and view them flawlessly, again on FMS localhost.

However when I tried to view them over the network things became more interesting. 

When viewed over the network the RTMP seems to 'stall'.  This happens after a varying amount of time from 1 second to 20 seconds into the FLV/F4V file.  HTTP transfer of VoD files seems to be much better buit still seems to 'stall' quite often.  If we bypass the network and connect a client to the Flash Media Server with a X-over cable we can stream RTMP or HTTP perfectly.

I took a look at the logfiles in %apps%Adobe/Logs/access.log and I can see the connection being opened on port 1935 as expected

->  Connect-pending    session  

->  connect    session       

->  play    stream       

The stream stalls between 2 and 50 seconds into the sample video, leaving me viewing the "buffering" bar.  There are no entries in access.log or elsewhere that give any indication anythign has gone wrong until I see messages stating:


->  client-pause    stream  
->  client-unpause    stream 
->  stop    stream

->  disconnect


HTTP streaming works a great deal better - we get around 50-70% of the data coming through before it in turn 'stalls'.  Now just when I thought things could not get any weirder... If i try the webcam-test (for the interactive tab on FMS4) then it will happily stream live RTMP seemingly forever.


Checks Made:

We have (i hope) eliminated the FMS server firewall, gateway, client firewalls, checked the ports are open (1935/80/8080 etc) but still we are no closer to cracking the stalled RTMP/HTTP issue

    This topic has been closed for replies.

    2 replies

    Participating Frequently
    September 14, 2010

    The client-pause/client-unpause events indicate that the client has paused the stream.  What are the timestamps on those events?  Do they correspond to when you see the "stall"?

    And what is the timestamp on the stop event?  Does that correspond to when you disconnect the client?  Also, what is the status code for these events?

    James87Author
    Participant
    September 15, 2010

    Thank you for taking the time to look at my problem

    Q.   The client-pause/client-unpause events indicate that the client has  paused the stream.  What are the timestamps on those events?  Do they  correspond to when you see the "stall"?

    A.   They were a mistake by me when i was trying to discern what was happening by watching the logs and 'fiddling'!  Sorry if that caused undue confusion.  When the VoD stream stalls with the "buffering" notification there is no additional entry in the logs until it seems to finally disconnect the client:

    connect    session            2010-09-15    19:02:49   
    play    stream            2010-09-15    19:02:49 

           **** Stream played for 44 seconds ****


    connect-pending    session        2010-09-15    19:04:04
    connect    session            2010-09-15    19:04:04   
    disconnect    session        2010-09-15    19:04:04
    vhost-stop    vhost        2010-09-15    19:04:12
    server-stop    server        2010-09-15    19:04:13

              **** webplayer client is still shoewing the buffering symbol 5 mintues after disconnect ****


    Q. what is the status code for these events?

    A. I am not sure.   looking at the logs there is not a column header caleld "status code" or anything similiar so maybe i am looking in the wrong place.  Where would I locate the status codes for the events?  Just in case they are in the access.log I have included the full snippet for the above event sequence below.

    ****************

    connect-pending    session    2010-09-15    19:02:49    AUS Eastern Standard Time    202.***.***.***    202.***.***.***    628    0    30    _defaultRoot_    _defaultVHost_    vod    _definst_    0    100    202.***.***.***   rtmp    -    rtmp://202.***.***.***:1935/vod    rtmp://202.***.***.***:1935/vod    -    http://202.***.***.***/swfs/StrobeMediaPlayback.swf    WIN 10,1,82,76    4702111234592424303    3073    3073    normal    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    http://202.***.***.***/    -    -    -

    connect    session    2010-09-15    19:02:49    AUS Eastern Standard Time    202.***.***.***    202.52.***.***    628    0    30    _defaultRoot_    _defaultVHost_    vod    _definst_    0    200    202.***.***.***    rtmp    -    rtmp://202.***.***.***:1935/vod    rtmp://202.***.***.***:1935/vod    -    http://202.***.***.***/swfs/StrobeMediaPlayback.swf    WIN 10,1,82,76    4702111234592424303    3073    3073    normal    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    http://202.***.***.***/    -    -    -
    play    stream    2010-09-15    19:02:49    AUS Eastern Standard Time    sample2_1000kbps.f4v    202.***.***.***    628    0    30    _defaultRoot_    _defaultVHost_    vod    _definst_    0    200    202.***.***.***    rtmp    -    rtmp://202..***.***.***:1935/vod    rtmp://202.***.***.***:1935/vod    -    http://202.***.***.***/swfs/StrobeMediaPlayback.swf    WIN 10,1,82,76    4702111234592424303    3162    3450    normal    sample2_1000kbps.f4v    -    -    rtmp://202.***.***.***:1935/vod/sample2_1000kbps.f4v    rtmp:/.***.***.***:1935/vod/sample2_1000kbps.f4v    C:\Program Files\Adobe\Flash Media Server 4\webroot\vod\sample2_1000kbps.f4v    mp4    13733568    114.660000    0    -    0    0    -    -    -    -    1    -    -    -    -    -    -    -    -    http://202.***.***.***/    -1    -1.000000    -

    connect-pending    session    2010-09-15    19:04:04    AUS Eastern Standard Time    -    202.***.***.***   7156    0    30    _defaultRoot_    _defaultVHost_    -    -    0    100    -    rtmp    -    -    -    -    -    -    4702111234491761007    318743    1238263    normal    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -

    connect    session    2010-09-15    19:04:04    AUS Eastern Standard Time    -    202.***.***.***    7156    0    30    _defaultRoot_    _defaultVHost_    -    -    0    400    -    rtmp    -    -    -    -    -    -    4702111234491761007    318743    1238263    normal    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -

    disconnect    session    2010-09-15    19:04:04    AUS Eastern Standard Time    -    202.***.***.***   7156    0    30    _defaultRoot_    _defaultVHost_    -    -    3914    200    -    rtmp    -    -    -    -    -    -    4702111234491761007    318743    1238263    normal    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -

    vhost-stop    vhost    2010-09-15    19:04:12    AUS Eastern Standard Time    _defaultVHost_    202.***.***.***    7156    0    30    _defaultRoot_    _defaultVHost_    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -

    server-stop    server    2010-09-15    19:04:13    AUS Eastern Standard Time    -    202.***.***.***    7156    0    30    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -

    September 15, 2010

    The status code would be listed under the column header, x-status.

    From the access.00.log that you shared the first connect seems to be successful with status code 200. So does the play, which is why you could see the stream playing at the outset.

    However I see another connect which seems like a bad request(the status code 400 implies that) which seems to result in the client getting disconnecting and the FMS also stopping for some reason.

    For the same time stamp when the client disconnect and server stop occurs as seen in the access log could you also check the edge.00 log, core.00.log and master.00.log to see what are the details logged there. FMS getting stopped would explain why the stream is stalling.

    Regards

    Mamata

    September 13, 2010

    Hi James@GCHK

    From what you explained there doesn't seem to be any firewall issue since you were able to connect and even start the playback. If there were any issue it would have failed to connect at the outset itself.

    Also you mention that you are able to see everything working fine on your local setup. It's only when you deploy over the public internet that you began seeing the stalling while viewing the streaming content. On the internet there definitely would be added latency as compared to your LAN.

    - When you say the video stall, does it resume to play after a while when the buffering bar goes away?

    - Are you using the sample video player that comes with FMS?

    - If you are using any custom video player could you increase the netstream buffer time

    - However the client-pause and client-unpause logs are odd, wonder why you could be seeing them unless someone is pausing/unpausing the stream while playing.

    Regards

    Mamata

    James87Author
    Participant
    September 15, 2010

    Thank you for taking the time to look at my problem

    Q.   When you say the video stall, does it resume to play after a while when the buffering bar goes away?

    A.     No.  Once it has started buffering it will sit at that state seemingly forever (I have not left a browser open for hours to check though!) And

             I cannot see any data being transfered from the FMS when the player is saying "buffering"

    Q.   Are you using the sample player that comes with FMS?

    A.  Yes, as I am totally new to flash I have not yet had a chance to learn action script and make my own flash player .swf so I copied the "StrobeMediaPlayback.swf" to my webserver and used that.

    Q.   If you are using a custom player could you increase the netstream time?

    A.   I do not know how to do this yet.  i realise that there are a group of action script methods in the Netconenct (i think) class that I need to pass flashvars too to define the buffering time.  From the response of the prebuilt player in the FMS this is set near to 0!

    Q. However the client-pause and client-unpause logs are odd, wonder why you  could be seeing them unless someone is pausing/unpausing the stream  while playing

    A. The client pause/unpause look to have been me pausing the stream to try and get it started again, my bad

    UPDATED INFO:

    If i stream a live stream from the FME to the FMS then it plays back via the same sample player really well (all be it with occasional video "fast forwards" as it catches up with real time).  There are no buffering issues at all with live sources over RTMP only VOD.

    HTTP delivery also seems to work almost flawlessly, it occasionaly seems to stick on one segment but rarely.