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
    If I get my terminology mixed up let me know. In the view applications window I have just one instance created:

    public
    _definst_

    And the folder is D:\Flash Archives\Public and the name of the flv is test.flv.
    Inspiring
    October 16, 2006
    Can you tell me the application name on server side(folder name) and name of .flv??
    Inspiring
    October 16, 2006
    Ok I altered your code a bit with some traces and did this:

    nc = new NetConnection();
    nc.onStatus = function(info)
    {
    trace(info.code);
    if(info.code=="NetConnection.Connect.Success")
    { //put this portion in function instead of here and call function
    ns = new NetStream(nc);
    my_video.attachVideo(ns);
    ns.setBufferTime(0);
    ns.play("test");
    trace("Connected");
    //function end
    }
    else
    {
    trace("Not connected.");
    }
    }

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

    With those traces I get in the output window:

    NetConnection.Connect.Success
    Connected

    So its connected, like I thought cause of the stats, so am I now left to either the compiling of the video or there is something in the server thats messed?
    Inspiring
    October 16, 2006
    ok well your code has minor problem. You have to connect netstream through nc only after you are successfully connnected to FMS.

    Try this:
    nc = new NetConnection();
    nc.onStatus = function(info)
    {
    if(info.code=="NetConnection.Connect.Success"){ //put this portion in function instead of here and call function
    ns = new NetStream(nc);
    my_video.attachVideo(ns);
    ns.setBufferTime(0);
    ns.play("streamname");
    //function end
    }
    }

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

    Its just my view of looking at the problem. Not saying that might be the only reason.
    Inspiring
    October 16, 2006
    No video or audio, and the application name is public. Basically on another hard drive I made the folder D:\Flash Archives\public\_definst_ and I edited the xml file tag that dealt with the AppsDir.
    Inspiring
    October 16, 2006
    Ok in my actionscript I did a trace but I am not sure if it will work how I want it to. I found bytesTotal for the netstream object so am I correct in assuming that if it found the video I want I should be able to do trace(ns.bytesTotal); and find out the size of the video?

    If thats correct then its returning 0.
    Inspiring
    October 16, 2006
    Also what is your application name on FMS(folder name)?
    Inspiring
    October 16, 2006
    Can you hear audio? or flv you are trying to play is Video only?
    Inspiring
    October 16, 2006
    Actually after i posted this I noticed that and changed it with a filename in the ns.play. My mistake that I didnt catch that but still no luck. Not seeing any video still.
    Inspiring
    October 16, 2006
    Can you confirm it's not
    ns.play(ns);

    Suppose to be like this:
    ns.play("streamname");
    where streamname is name of flv without .flv

    Good Luck