17 Replies Latest reply: Jan 1, 2013 5:30 PM by issoorg RSS

    Recording livepkgr to MP4 file

    GTHvidsten

      I need to record what's streamed to the livepkgr application as an MP4 file (or convert it afterwards).

      As of the default settings the livepkgr applications records all incoming streams as an F4F file (using the main.asc file that came with the installation).

      I've tried streaming and recording an H.264 videostream with AAC sound (as per these instructions)

       

      If I move this recored file to another application and rename it to MP4 an external player (JWPlayer) can play the stream just fine, as can iOS devices (though with some minor issues when scrubbing).

      The renamed file won't open in Windows Media Player or Quicktime Player, though.

       

      I've tried using the f4vpp tool and processed the video into another MP4 file. This file streams just fine to the external player as well, and it resolves the scrubbing issues on iOS devices.

      The file now opens in Windows Media Player, but Quicktime Player still won't open it with the following message: "Error -2002: a bad public movie atom was found in the movie (filename.mp4)"

       

      I really need the livepkgr application to record in a format that either is by default, or can easily be converted to, a proper MP4 file that can be opened in all applications. How can I accomplish this?

        • 1. Re: Recording livepkgr to MP4 file
          Nitin Goel Adobe Employee

          After flattening, it should be a proper mp4 file. I think its a "quicktime" parsing issue. Mp4 is very generic format and quictime shouldn't assume only specific boxes in the mp4.

           

          Anyways, what you can do is modify the livepkgr application to record the input stream as mp4 also.

           

          You will require to just add

           

          var s2 = Stream.get("mp4:" + streamObj.name);

              if (s2 == undefined )

                  return;

           

          if (!s2.record(recordMode))

              {

                  s2.trace("record failed.");

              }

           

          s2.play(streamObj.name,-1,-1);

           

          also replicate the same code as we have for stream variable "s" for s2. in unpublish

          • 2. Re: Recording livepkgr to MP4 file
            Vilius Šumskas Community Member

            I'm interested in the same functionality too. I need to record a live stream to mp4 files and be able to re-stream it using vod application.

             

            1. How do I "compile" main.asc file into .far file? Or do I just place main.asc to application folder and delete main.far?

            2. Can I just simply replace "f4f:" part in current sample with "mp4:"?

            3. If I already have couple of dozen streams recorded on the server which are in f4f/f4x format, how do I convert them to mp4?

            • 3. Re: Recording livepkgr to MP4 file
              Shiraz Anwar Adobe Employee

              You need to rename the *.far file to *.zip file and then unzip it. After extracting all the files, go to main.asc and edit it, that way you will be able to use the code.

              • 4. Re: Recording livepkgr to MP4 file
                Vilius Šumskas Community Member

                Should I re-zip it and rename back to main.far after I'm done?

                • 5. Re: Recording livepkgr to MP4 file
                  Shiraz Anwar Adobe Employee

                  No, there is no need to do that.

                  • 6. Re: Recording livepkgr to MP4 file
                    Vilius Šumskas Community Member

                    OK thank you this part is clear for me now. My other two questions still stand however.

                     

                    2. Can I just simply replace "f4f:" part in current sample with "mp4:" or do I need to duplicate a stream according to Nitin Goel's message?

                    3. If I already have couple of dozen streams recorded on the server which are in f4f/f4x format, how do I convert them to mp4?

                    • 7. Re: Recording livepkgr to MP4 file
                      Shiraz Anwar Adobe Employee
                      • 8. Re: Recording livepkgr to MP4 file
                        Vilius Šumskas Community Member

                        I have unpacked main.far and can see that it uses "f4f:" instead of "mp4:". Is this right? Can I change it?

                         

                        I'm using the default FMS installation and configuration, but the data is not in one f4f file. Where can I change segmentduration to infinite? Can these segments be played out without converting them? Maybe using DVR functionality? Or do I need custom server side application for this?

                        • 9. Re: Recording livepkgr to MP4 file
                          Shiraz Anwar Adobe Employee

                          Apologies for the miscommunication.

                          Well here is your answer:

                          • Changing to mp4: shouldn't harm (earlier I meant to say, while doing Stream.get and you want to record a mp4, use mp4:)
                          • Just cross-checked, you are correct by default segmentduration in livepkgr application is set to 400 seconds thats why you are ending up collecting many f4f fragments instead of one.
                          • You need to leave <SegmentDuration></SegmentDuration> blank in event.xml file inside events folder of livepackager, or you can remove SegmentDuration altogether, then in that case it will assume infinite value by default. Actually FMS by default when segmentduration value is not set considers it infinite, but not the livepackager application, it comes with 400000 as a set value.

                           

                          Hope this will help you.

                          • 10. Re: Recording livepkgr to MP4 file
                            Vilius Šumskas Community Member

                            I have changed f4f: to mp4: and restarted livepkgr application. Now when I start streaming from FMLE in the FMS logs I get "mp4:streamname - record failed." and nothing is recorded.

                             

                            UPDATE: OK, nevermind. I had to delete /opt/adobe/fms/applications/livepkgr/streams/streamname folder from earlier recordings. Now the recording works. However it makes a fragmented MP4 files which cannot be played out without converting with Adobe F4VPP tool. Is it possible to record to standard MP4 ISO file?

                             

                            Message was edited by: Vilius Šumskas

                            • 11. Re: Recording livepkgr to MP4 file
                              Vilius Šumskas Community Member

                              We were using modified livepkgr application which records "mp4:" type streams and the <SegmentDuration> is blank. This works great for creating one file instead of dozen segments. However there are two major issues with this.

                               

                              1) Live streams played with such livepkgr application are not working on iOS devices. iPad or the iPhone shows striked-out Play button. Also the http://stream.lnk.lt/hls-live/....m3u8 link doesn't open in any browser. I get HTTP 404 error. I have confirmed that changing "mp4:" back to "f4f:" in main.asc and enabling <SegmentDuration> makes the live stream work. Is there a way to record a live stream in one mp4 file and make HLS work simultaniously?

                               

                              2) Such recorded MP4 files have trouble streaming with hls-vod application on iOS devices. Seems like audio and video is totally out of sync if the file is bigger. For smaller files it is OK. Is this a known issue?

                              • 12. Re: Recording livepkgr to MP4 file
                                Vilius Šumskas Community Member

                                Can someone take a look at this?

                                • 13. Re: Recording livepkgr to MP4 file
                                  Apurva Udaykumar Adobe Employee

                                  Hi,

                                   

                                  1) You can't play a live stream via HDS/HLS if you are recording in an mp4 container. If you need to do both I suggest you use Multi-point publish (MPP), i.e, use one application where streams are recored in default f4f format and use that for playback via HLS, then do a publish from that application to another application where you record it in mp4 format. Although this will lead to content duplication, you can manage disk space by setting your disk management appropriately.

                                  2) How big is your file?

                                   

                                  Thanks,

                                  Apurva

                                  • 14. Re: Recording livepkgr to MP4 file
                                    Vilius Šumskas Community Member

                                    Thank you for your reply.

                                     

                                    1) Can I still record to the "f4f:" container and have SegmentDuration disabled? I have tried to do so, but the recording just doesn't start. Even if I would have F4F file that's fine, but I need it in one file so later I can run it through F4VPP. Where can I find more information regarding Multi-Point publishing? Maybe with some examples?

                                     

                                    2) It's around 30 minutes.

                                    • 15. Re: Recording livepkgr to MP4 file
                                      Apurva Udaykumar Adobe Employee

                                      When you disable SegmentDuration, also disable DiskManagement and try.

                                      • 16. Re: Recording livepkgr to MP4 file
                                        Vilius Šumskas Community Member

                                        Thanks you! It works.

                                        • 17. Re: Recording livepkgr to MP4 file
                                          issoorg

                                          Hi Nitin

                                           

                                              i did the way you said and not working this is what i am getting also hls streaming stopped can you please send me main.asc or main.far configured with this futures f4f and mp4 recording

                                           

                                          below i get when  <SegmentDuration></SegmentDuration> blank in event.xml file also hls stop working

                                          onPublish : livestream

                                          mp4:livestream - record failed.

                                          Stream name is: livestream and live event is: liveevent

                                          f4f:livestream - record failed.

                                          f4f:livestream - NetStream.Data.Start

                                          f4f:livestream - NetStream.Publish.Start

                                          f4f:livestream - NetStream.Play.Reset

                                          Sending error message: Method not found (getStreamLength).

                                           

                                          below i get when   <SegmentDuration>4000000</SegmentDuration>  in event.xml file and hls works

                                          onPublish : livestream

                                          mp4:livestream - record failed.

                                          Stream name is: livestream and live event is: liveevent

                                          f4f:livestream - NetStream.Data.Start

                                          f4f:livestream - NetStream.Publish.Start

                                          f4f:livestream - NetStream.Play.Reset

                                          f4f:livestream - NetStream.Record.Start

                                          Sending error message: Method not found (getStreamLength).