13 Replies Latest reply: Mar 6, 2015 3:21 PM by AdobeApache RSS

    Serverside stream recording suddenly stops

    ImAStreamer Community Member

      I'm running FMS 4.0.2.  I have a server side script that will record a stream that is playing on a remote server.  This script was running fine on FCS 1.5. When running on FMS 4.0.2 the stream starts recording fine, but after a few minutes it stops on its own with no event notifications on the stream.  No NetConnection or NetStream events are registered.

       

      I thought it might have been been an issue staying connected to the remote server, but then I wrote something to publish a stream directly to this server, and have a simple server side script record the stream on the same server, but the same thing happens - it stops after a few minutes with no notifications.

       

      Again the code works fine in older versions of FMS/FCS.

       

      This has obviously proven problematic that I cannot record a stream longer than a few minutes.

       

      The problem occurs both on streams published via the Flash Player (Sorenson Spark) and the FMLE (H.264).

       

      Any help would be greatly appreciated.

        • 1. Re: Serverside stream recording suddenly stops
          Nikhil Pavan Kalyan Community Member

          Hi,

           

          Thanks for moving to FMS 4.

           

          There shouldn't be any problem /restriction recording on the server with 4.0.

          1. Did you check the logs on FMS to see if there anything mentioned ? (core logs mainly).

          2. How long is this few minutes ? Everytime the recording stops at the same time ? Did the FMLE recieved any notification or did it continue publishing ?


          Also quickly share the server side script you wrote for record, so that it will be available for reference.


          Thanks for your co-operation.

          • 2. Re: Serverside stream recording suddenly stops
            rexdtripod Community Member

            Hello,

             

            Has anyone looked into this?  I have the same problem with both FMS 4 and 4.5.  Just a silent failure.  No activity logged on it anywhere.  Recording begins.  A file begins to build.  It then just stops building.  No break in connection.  If I try to play back the portion recorded, the data is a little messed up.  Sometimes no audio.  Sometimes will just stop streaming.  Sometimes won't play at all.

             

            Here is my FMS recording code:

             

             

            Client.prototype.startRecord = function(){

            trace("startRecord");

             

            broadcastStream = Stream.get("live");

                    recordedStream = Stream.get("mp4:testRecording.mp4");

             

            if(recordedStream){

              recordedStream.record();

                broadcastStream.play(broadcastStream.name);

            }

            }

             

            Changing the file extension to "f4v" or "flv" makes no differnence. 

             

            Pretty important issue.  Any help would be appreciated.

             

            Thanks

            • 3. Re: Serverside stream recording suddenly stops
              rexdtripod Community Member

              Anyone?  Hello, is this thing on?

               

              Pretty bad issue here.  I sort of need the stream recording functionality in FMS to work.  As of this writing I just cannot make FMS "reliably" record live streams to files on the server.  It seems others have reported this same silent failure situation as well.  Is there anyone at Adobe who knows for sure if I'm doing something wrong in the code above or if there is a bug here?

               

              Thanks in advance.

              • 4. Re: Serverside stream recording suddenly stops
                Nitin Goel Adobe Employee

                There is problem with the code.. it needs to be

                 

                Client.prototype.startRecord = function(){

                trace("startRecord");

                 

                broadcastStream = Stream.get("live");

                        recordedStream = Stream.get("mp4:testRecording.mp4");

                 

                if(recordedStream){

                  recordedStream.record();

                    recordedStream.play(broadcastStream.name);

                }

                }

                 

                or you can simplify further

                 

                Client.prototype.startRecord = function(){

                trace("startRecord");

                recordedStream = Stream.get("mp4:testRecording.mp4");

                 

                if(recordedStream){

                  recordedStream.record();

                    recordedStream.play("live");

                }

                }

                • 5. Re: Serverside stream recording suddenly stops
                  rexdtripod Community Member

                  Thanks for the response.

                   

                  No dice.  Made the change as prescribed above and get the same result. 

                   

                  The two things that make this difficult are the silent nature of the failure (nothing in console or logs, and no NetStatus activity) and the lack of consistency in the end result - fails a lot, but succeeds once in awhile with no code changes.  Would expect either a total failure if the code is wrong or total success if it's right.  I may be doing something wrong, but these conditions make it difficult to troubleshoot.

                   

                  ImAStreamer above gets the same result as me so we're either both doing the same thing wrong or FMS 4 and above broke recording somehow.  Where do I go from here?  Need somehow to get this working.

                   

                  Thanks

                  • 6. Re: Serverside stream recording suddenly stops
                    Nitin Goel Adobe Employee

                    Can you check that livepkgr application is working fine and recording well. Code in livepkgr application is almost on the same basis and this run successfully for the f4f recording. If this doesn't too doesn't result in recording at streams/_definst_/streamName folder than there is some issue in your set-up.

                     

                    If this run well, then I would suspect that there is some problem in the code above.

                    • 7. Re: Serverside stream recording suddenly stops
                      rexdtripod Community Member

                      I guess I could try that, but I'm not sure I see the point.  What type of issue with set up?  Did you have something in mind?  If there was one, then ImAStreamer above and others have the same issue.  Has anyone ever noted what such an issue might be?

                       

                      Again, it's not a total failure.  It succeeds aboout 20-30% of the time.  A file is recorded successfully.  If there were a problem with the set up, I would suspect it wouldn't succeed at all.

                       

                      If there were some problem in the code above, again, it wouldn't succeed at all.  What types of set up problems or code problems would lend to partial successes?

                       

                      In order to test the livepkgr app I'll have to read about it and figure out how it works and such.  I can do that, but I was looking to get this working a little sooner than that.  ImAStreamer reported his problem June 11th, 2011.  Makes me think a solution might not happen in a timely manner.

                       

                      I'll take a look at livepkgr here.

                      • 8. Re: Serverside stream recording suddenly stops
                        ImAStreamer Community Member

                        I'm still seeing this failure. Sometimes it works, sometimes it doesn't. Seemingly no pattern to it and again with the lack of events in the onStatus function, there is nothing to act upon.

                         

                        I did watch the livepkgr app and I noticed something happened in the directory when my recording stopped.  There was momentarily an extra file in that folder. It looked like when it was recreating/updating the .bootstrap file. It happened about 10 minutes into the recording of a supposed hour long recording. For just a second or two it looked like there may have been two bootstrap files and then one disappeared and my recording stopped.

                        • 9. Re: Serverside stream recording suddenly stops
                          Christofer L Community Member

                          We were experiencing similar problems with the recording just stopping without any error or other information. While trying to find the error we started listening on the onStatus event on NetConnection which made the problem completely disappear. If we remove the event lister the problem comes back, every time.

                           

                          netConnection.onStatus = function(info) {

                                                 trace('Connection Status: ' + info.code);

                          }

                          • 10. Re: Serverside stream recording suddenly stops
                            ImAStreamer Community Member

                            Well unfortunately, my code has has the onStatus event listener for the NetConnection and that's when the problem occurs.  I'm recording from one server to another so I need the NetConnection handler. I also tried moving the recording application to the same server as the live stream, but still need the NetConnection because I'm trying to record the stream from a different application.

                             

                            I'm still waiting for someone from Adobe to comment on my post above. It appears there is something going on internally with the server.

                            • 11. Re: Serverside stream recording suddenly stops
                              ctdavids

                              I won't claim any great experience with this development environment, so take this for what it's worth and I hope it helps.

                               

                              We was experiencing this same issue and I noticed that we weren't keeping a persistent reference (read: global variable) to the streams doing the recording.  I started thinking what if the recording streams are being garbage collected (or something similar).  It seemed odd that this would be the case, given that streams often require explicit closing and the existence of Stream.Get/Stream.Destroy, but I figured why not give it a shot.  So I implemented a global map that housed the recording streams and the problem completely disappeared.

                               

                              Anyway, as I said, I can't claim expertise, but maybe this will help you.

                              • 12. Re: Serverside stream recording suddenly stops
                                mpartridge22 Community Member

                                The solution described by ctdavids worked for me as well. We're running FMS 4.5 with custom clients.

                                • 13. Re: Serverside stream recording suddenly stops
                                  AdobeApache

                                  ctdavids, you the man!!


                                  I never would have thought the stream was getting garbage collected! Damn, I spent so many hours (actually days) on this issue. Was getting crazy seeing the recording file start nicely, and then stop increasing in size after a couple of minutes, with absolutely no log or status update anywhere. Tried to update the buffer congurations, file locations, etc., etc., etc., None of them worked!


                                  Assigning the recording stream to a private variable inside of my startRecord() function, and putting this private variable inside a global variable (object map), fixed it. Thank you ctdavids for the solution. And, thank you ImAStreamer for making the same mistake that I did in putting the stream in a private variable. Without that, we wouldn't have this thread and I would still be stuck with the problem .