Skip to main content
Inspiring
October 16, 2006
Question

Server Working, FLVs Not

  • October 16, 2006
  • 20 replies
  • 1107 views
Have read through these forums, several different websites but I am still having trouble with this. I have FMS 2 installed with an application named public with the _definst_ folder under that. I put a test.flv file that I compiled with Sorenson Squeeze in the directory. I made a simple flash swf with the following code in the first frame:

nc = new NetConnection();
nc.connect("rtmp://xxx.xxx.xxx.xxx/public/test"); <-left out the IP address

ns = new NetStream(nc);
my_video.attachVideo(ns);
ns.setBufferTime(0);
ns.play(ns);

Now when I go to the FMS server I see the client connected at 2 as I have 2 windows open. I see the heartbeat in the bandwidth window and in the server log it says Mon 12:48:30 PM: Connect : rtmp://xxx.xxx.xxx.xxx/public/test. So it looks like, to me that the client is connecting and the video is playing according to FMS but I am getting no video.

So I am down to either something is wrong with the code or something is wrong with the flv when its compiled. I have tried Sorenson Squeeze, Flash 8's video converter and still have the same problem. I am at the end of the road in terms of what I know so I am hoping someone out there has any ideas. If you need more information I will try to provide it.

Thanks,
Troy
    This topic has been closed for replies.

    20 replies

    Inspiring
    October 16, 2006
    That was it...I looked around and never saw that it had to be that structure. Thanks for your persistance and I am glad for the most part I was on the right path just a few things off.

    Appreciate it!
    Inspiring
    October 16, 2006
    Just noticed something. _definst_ has be inside streams folder. Folder structure should look like this
    public\streams\_definst_
    Inspiring
    October 16, 2006
    Only thing I can say now check .flv file or the my_video object if its working. Because exactly same code works on my side.
    Inspiring
    October 16, 2006
    Interesting....I did that and got this:

    NetConnection.Connect.Success
    net connect:[object Object]:_root.my_video:_level0.my_video
    Connected

    And it constantly outputted like it was in a loop. Would this have to do something with it playing the first frame and looping? I saw a forum post with a guy saying that he put a stop(); statement in and he said he saw the video. I tried it and no luck but its a thought.
    Inspiring
    October 16, 2006
    Interesting....I did that and got this:

    NetConnection.Connect.Success
    net connect:[object Object]:_root.my_video:_level0.my_video
    Connected

    And it constantly outputted like it was in a loop. Would this have to do something with it playing the first frame and looping? I saw a forum post with a guy saying that he put a stop(); statement in and he said he saw the video. I tried it and no luck but its a thought.
    Inspiring
    October 16, 2006
    Try that. yes it might be the reason, put stop in end.

    Finally I had to try this code myself, and it works pretty well.
    I just replaced rtmp string and streamname in .play

    Everything points back to .flv if its valid.
    Inspiring
    October 16, 2006
    Interesting....I did that and got this:

    NetConnection.Connect.Success
    net connect:[object Object]:_root.my_video:_level0.my_video
    Connected

    And it constantly outputted like it was in a loop. Would this have to do something with it playing the first frame and looping? I saw a forum post with a guy saying that he put a stop(); statement in and he said he saw the video. I tried it and no luck but its a thought.
    Inspiring
    October 16, 2006
    try putting trace inside function PlayMyStream() as first statement
    trace("net connect:"+_root.nc+":_root.my_video:"+_root.my_video);

    This should print something on _root.nc and _root.my_video
    Inspiring
    October 16, 2006
    Getting the client connected on the server but still no video. Console also shows the debugging information as connected. This one is becoming one tough cookie.
    Inspiring
    October 16, 2006
    So your code seems to be correct for that part. Only thing I can say you to try is this:

    nc = new NetConnection();

    function PlayMyStream(){
    ns = new NetStream(_root.nc);
    _root.my_video.attachVideo(ns);
    ns.setBufferTime(0);
    ns.play("test");
    trace("Connected");
    }
    nc.onStatus = function(info)
    {
    trace(info.code);
    if(info.code=="NetConnection.Connect.Success")
    {
    _root.PlayMyStream();
    }
    else
    {
    trace("Not connected.");
    }
    }

    nc.connect("rtmp://xxx.xxx.xxx.xxx/public");


    Check the trace statement if its going inside the function.

    Try both with _root. and without _root.nc