Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: live-record meta data access

  1. #1

    Default live-record meta data access

    My application sends a lot of meta data to the net stream to do things like show an image. If a subscriber comes in after publishing starts, is there programmatic way to access the meta data so the window is sync with the publisher.
    Thanks,
    Douglas

  2. #2
    Join Date
    Dec 2007
    Posts
    25,641

    Default

    There is a way to get all data at one time from a recorded stream, that I've read about on livedocs but never implemented -- should work with Wowza, but it doesn't mention live streams.

    http://livedocs.adobe.com/fms/2/docs...=00000588.html
    In the following example, data messages in the recorded stream file log.flv are returned all at once, rather than at the intervals at which they were originally recorded.
    var my_ns:NetStream = new NetStream(my_nc);
    my_ns.play("log", 0, -1, 2);
    It might be up to you to maintain state somehow. You could log actions into an object on the publish side (assuming you are using a Flash app), and send everything to new clients when they arrive.

    Richard
    Last edited by rrlanham; 06-27-2009 at 01:50 PM.

  3. #3

    Default

    Thanks. I'll have a look at that.

    What I'm doing now is sending an object with the state to wowza from the publisher and when subscriber connects, I send that object to them. What I don't like about that is that I have to do a nc.call for every nc.send but maybe there's no other way.

    Regards,
    Douglas

    BTW - you guys are fantastic support

  4. #4
    Join Date
    Dec 2007
    Posts
    25,641

    Default

    Thanks!

    I think this could be done server-side using onMetaData method of IMediaStreamActionNotify2 to populate an AMFDataObj to send to new clients onConnect.

    Richard

  5. #5

    Default IMediaStreamActionNotify2

    I can't get onMetaData to trigger, here's the relevant code which I took from another post :


    public void onStreamCreate(IMediaStream stream) {
    IMediaStreamActionNotify actionNotify = new myListener();

    WMSProperties props = stream.getProperties();
    synchronized(props)
    {
    props.put("streamActionNotifier", actionNotify);
    }
    stream.addClientListener(actionNotify);

    getLogger().info("Added client listener");
    }
    getLogger().info("onStreamCreate: " + stream.getSrc());
    }

    public void onStreamDestroy(IMediaStream stream) {
    getLogger().info("onStreamDestroy: " + stream.getSrc());
    }

    public void onCall(String handlerName, IClient client,
    RequestFunction function, AMFDataList params) {
    getLogger().info("onCall: " + handlerName);
    }

    class myListener implements IMediaStreamActionNotify2 {
    @Override
    public void onPauseRaw(IMediaStream stream, boolean isPause, double location) {
    // TODO Auto-generated method stub

    }

    @Override
    public void onPause(IMediaStream stream, boolean isPause, double location) {
    // TODO Auto-generated method stub

    }
    public void onMetaData(IMediaStream stream,AMFPacket packet){
    System.out.println("onMetaData ***************************");
    }

    @Override
    public void onPlay(IMediaStream stream, String streamName,
    double playStart, double playLen, int playReset) {
    // TODO Auto-generated method stub

    }

    @Override
    public void onPublish(IMediaStream stream, String streamName,
    boolean isRecord, boolean isAppend) {
    System.out.println("onMetaData ***************************");
    // TODO Auto-generated method stub

    }

    @Override
    public void onSeek(IMediaStream stream, double location) {
    // TODO Auto-generated method stub

    }

    @Override
    public void onStop(IMediaStream stream) {
    // TODO Auto-generated method stub

    }

    @Override
    public void onUnPublish(IMediaStream stream, String streamName,
    boolean isRecord, boolean isAppend) {
    // TODO Auto-generated method stub

    }
    }
    }

    Thanks

  6. #6

    Default

    This onMetadata handler only works for live streams. There is a way to do this with vod stream but you need to create your own MediaReader and override the getMetedata method. I am not in front of a computer but will try to document when I get a chance.

    C

  7. #7

    Default

    This is close to what you need. It shows you how to get the metadata everytime a .flv file is accessed. See if this helps.

    Charlie

  8. #8

    Default

    I'm using a live-record stream. I'm not sure what you meant by "close to what you need".
    This,unfortunately, did not work.
    var my_ns:NetStream = new NetStream(my_nc);
    my_ns.play("log", 0, -1, 2);


    Thanks,
    Douglas

  9. #9

    Default IMediaStreamActionNotify2 onMetaData

    Hi,

    I added a IMediaStreamActionNotify2 listener to my code. The onPlay and onPublish get called but the onMetaData never does. I thought that would be triggered by executing a NetStream.send from the client. Am I missing something?

    Thanks,
    Douglas

  10. #10

    Default

    It will get called if you are setting the onMetadata data. See this page that describes setting the metadata using @setDataFrame:

    http://www.adobe.com/livedocs/flashm...=00000190.html

    Charlie

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •