Skip to main content
February 6, 2008
Question

Streaming FLV

  • February 6, 2008
  • 5 replies
  • 1965 views
I have been able to successfully create an application and stream an h264 file. The problem comes when I use exactly the same application to access an FLV. It will not play. The only differences I can see:
- the server reports the FLV as 'playing live'
- with the FLV the onMetaData handler is never called

On the same server the sample VOD application does work with both types of files.

Thoughts?
    This topic has been closed for replies.

    5 replies

    Graeme Bull
    Community Expert
    Community Expert
    February 8, 2008
    I have no idea why you would have to set the buffer to anything at all to make an FLV file play. Does that work for you? Interesting indeed.
    Graeme Bull
    Community Expert
    Community Expert
    February 7, 2008
    Participating Frequently
    February 7, 2008
    I see- so in essence the answer to the question- why will an FLV not play the same as an MP4 is: you must set the buffer time to any value above .1. This only applies to FLV as the MP4s play just fine.

    This information can only be found in the AS2 language reference which explains a lot.

    "Flash Media Server Developer Documentation

    Adobe Flash Media Server ActionScript 2.0 Language Reference / ActionScript 2.0 Language Reference / NetStream class "

    I am using AS3. And your top link -which references AS3 docs- no reference to setBufferTime in the play section nor on the page. Nor is this information in the docs that come with the FMS3 install.

    Again, hunting where you aren't supposed to be looking is irritating. Perhaps a merge is in order?

    And thanks for digging that out.



    Participating Frequently
    February 7, 2008
    From the docs:
    ns.play("bikes");

    This does not work even if the file exists. The server reports 'playing live' and no video appears. onMetaData is not called. No error is thrown.

    This is a recorded stream living in the application directory right next to an mp4 that plays fine.
    Graeme Bull
    Community Expert
    Community Expert
    February 7, 2008
    Yes, read the docs. That is exactly how it has been working for the last 5 or 6 years. Put in the proper arguments and it will throw an error of StreamNotFound.
    Participating Frequently
    February 7, 2008
    Where in the FMS 3 documentation is that? Dying to know.

    And you're telling me that if I pass bogus information to the FMS without these parameters, no error will occur? I'll tell you in this release no error is thrown. That is very bad.
    Graeme Bull
    Community Expert
    Community Expert
    February 7, 2008
    If the server is reporting as playing the FLV 'live' then it can't find the FLV file. Most likely you are using the default values when you play an FLV file with the play method, such as this:

    myNS.play("myFLVfile");

    In this case, FMS will search around for an FLV file in the streams/instanceName folder of the application. If it can't find it then it'll try to play a live stream and wait for one to be published. I would suggest making sure you have the FLV file in the right place and that the spelling is correct for the filename. Case is important on a linux server but not windows.
    Participating Frequently
    February 7, 2008
    Yeah, see the other thread. Apparently there is some parameter that you need to pass to get the file to play right. Don't look for it in the documentation.

    Thank you for trying. I will post the line a little later today when I get to work.

    But this brings up an interesting test that we tried- I threw a completely bogus string at it:

    ns.play("thisisnotaFLV");

    And the server reported back that it was trying to "playing live" that file. No client error, no server error, stream error or any other type of error. Certainly that cannot be how it is supposed to behave if it gets bogus play information?