0

I have an *.flv file on a FMS. When I play it on the client side the video plays just fine, but when I call Stream.play(filename, 0, -1, false) on the server side the video turns out really choppy.

I both cases I use NetConnection to connect to an rtmp and NetStream to play the stream, but in one case I connect to a stream and request the server to play my file on that stream. Apparently that doesn't work with files? It works just fine for live streams.

I really don't get why this should differ at all. Any suggestions?


Just to clarify. This is what I wanna do, and what I'm currently doing. Example from fms api.


The following example shows how to use Stream.play() as a hub to switch between live streams and recorded streams:

// Set up the server stream.

application.myStream = Stream.get("foo"); 

    if (application.myStream){ 
        // This server stream plays "Live1",  
        // "Record1", and "Live2" for 5 seconds each. 
        application.myStream.play("Live1", -1, 5); 
        application.myStream.play("Record1", 0, 5, false); 
        application.myStream.play("Live2", -1, 5, false);  
    } 

1 Answer 1

0

Making a lot of assumptions (that your player is well built, your interwebz connection fast enough, the .flv is well-formatted for streaming) the problem might be your bufferTime().

Remember that FMS burst-fills the buffer. So there is probably just some lag between bursts and take a look @ your NetStream.setBufferTime(). Maybe try pushing something higher (like 12?)

3
  • Hmm.. That kinda did the trick somehow. It doesn't work when I first stream the video, but it works when I refresh my player for some wierd reason. Anyway.. The bufferTime doesn't really go well with my live streams ;)
    – Tinelise
    Commented May 3, 2010 at 6:36
  • Looks like the bufferTime is the best solution =) Thanks!
    – Tinelise
    Commented May 3, 2010 at 13:50
  • You can buffer your live streams too; we set ours for 6 seconds. (the trick with live streams is that you need to pass ABSOLUTELY nothing for a start time in the constructor; ie, passing 0 or null will freak it out and break it)
    – Jason
    Commented May 4, 2010 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.