0 Replies Latest reply: Aug 20, 2014 7:31 AM by JonMoon RSS

    FMS 3.5 recording live stream cuts off after 5 minutes

    JonMoon Community Member

      I am trying to set up our Flash Media Interactive Server 3.5 to automatically record a copy of each stream that comes through it. The streams are coming through a streaming appliance (NewTek TriCaster, which uses a Flash Media Live Encoder profile), so I don't have a ton of options there for settings or doing any code. So I am left with setting this up with just server side code. I was able to get it working, but every recording cuts off after 5 minutes. I thought that perhaps it was something in the application.xml file, so I renamed it as application.xml.bak (making no xml file) and it still did it, even though all of the documentation says that it is supposed to be unlimited as the default. So then I made a blank application.xml file and entered this:


      This still did not work and still cut off after 5 minutes. Does anyone have any suggestions that I can try? I have tried streaming as both H264 and VP6, and I have tried saving as both an f4v and flv. None of those worked.



      I was able to get it to work by changing the way I was doing it. I was streaming as H.264 and trying to save the file as an f4v, which meant I needed to use action script code to create a new stream and send the incoming live stream to that one. Doing it that way cut off after 5 minutes no matter what I did. I changed it to just record the incoming stream as an flv file and doing it that way worked. Does anyone know why doing it the other way didn't work? Here is the code I was using (the commented out lines are the ones that worked):


      application.onAppStart = function()
           var dt = new Date();
           year = String(dt.getFullYear());
           month = String(dt.getMonth() + 1);
           if(month.length == 1) month = "0" + month;
           day = String(dt.getDate());
           if(day.length == 1) day = "0" + day;
           this.date_str = year + "-" + month + "-" + day;
           trace("Setting date string: " + this.date_str);
      application.onPublish = function(clientObj, streamObj)
           this.recording_name = "mp4:" + streamObj.name + " - " + this.date_str + ".f4v";
           var s = Stream.get(this.recording_name);
           s.record("record", -1, -1);
      //   streamObj.record("record", -1, -1);
           trace("Started Recording");
      application.onUnpublish = function(clientObj, streamObj)
           var s = Stream.get(this.recording_name);
      //   streamObj.record(false);
           trace("Recording finished.");