Skip to main content
Participant
Apr 4, 2011 3:35 PM UTC
Answered

Append stream object to existing file

Hello, I'm trying to append a live stream to an existing file, but I cant figure out how to open the existing file and then append the live stream. This is server side as well.

I know I need to open the existing file using stream = stream.get("file"). but I don't understand how to associate stream with the live stream coming in.

PLEASE HELP~!!!

    This topic is closed to new replies. Start a new post to keep the conversation going.
    SE_0208Correct answer
    Participating Frequently
    Apr 5, 2011 2:46 PM UTC

    Sorry, I'm a noob. I'm tyring to locate applications.xml, but I have limited access to this server. Where would it reside and is this something a host would allow you access to?


    Open notepad and put below text and save it as Application.xml.
    <Application>
    <StreamManager>
    <Live>
    <EraseOnPublish>false</EraseOnPublish>
    </Live>
    </StreamManager>
    </Application>
    Then copy it to your applications folder where your main.asc (i.e. server-side code) is present.

    8 replies

    Participating Frequently
    Apr 5, 2011 7:15 AM UTC

    Try out below code: (assuming you have mystream.flv already on disk)

    mynewstream = Stream.get(mystream);

    mynewstream.onStatus = function(info){

         trace(info.code);

    }

    mynewstream.record("append");

    mynewstream.play("livestream",-1,-1,true);   //where livestream in name of stream getting published.

    Put above code in any server-side method and make call to it or you can put the code in say application.onPublish handler

    Translate
    vstrazzAuthor
    Participant
    Apr 5, 2011 2:32 PM UTC

    What if mystream is the name of the livestream? I think this is what is causing my new error which doesn't allow me to broadcast at all.

    Translate
    Participating Frequently
    Apr 5, 2011 2:37 PM UTC

    I would suggest you to do following way in that case, instead of using previous way of code, you can do

    application.onPublish = function(c,s){

         s.record("append");

    }

    and have Application.xml in you applications folder, with <EraseOnPublish> set to false.

    (http://help.adobe.com/en_US/flashmediaserver/configadmin/WS5b3ccc516d4fbf351e63e3d119f2926bcf-7ff0.html#WSA9790036-5127-4e96-8290-A66871529A13)

    Translate