Results 1 to 9 of 9

Thread: How to get the time info of live stream

  1. #1

    Default How to get the time info of live stream

    Hi,

    We know the live stream (i.e. Application.xml /Streams /StreamType is live) would has some propagation delay when it is playbacked in client side. For example, I publish a stream, a clock sit before camera and it showed 14:00:00, the live content playbacks in player maybe at 14:00:05. How to let the player know actually it's the content of 14:00:00? (suppose we use rtmp protocol)

    Yehudi
    Last edited by spiritsoul; 08-14-2013 at 06:13 PM.

  2. #2
    Join Date
    Jul 2012
    Posts
    299

    Default

    Hi,

    It sounds like you're observing some latency from capture to playback. This time interval can vary depending on network and the streaming protocol in use. Take a look at these resources that help optimize your workflow for the lowest latency possible:

    How to achieve the lowest latency from capture to playback
    How to configure Apple HTTP Live Streaming packetization (cupertinostreaming)

    I think this is what you're looking for.

    -Tim

  3. #3

    Default

    Hi,

    Some latency from capture to playback is ok for me, but I would like to know how to get the stream content's time info. The time info can help me to show the correct time in player. Is it possible?

    Yehudi

  4. #4
    Join Date
    Jul 2009
    Posts
    135

    Default

    If your encoder is sending timecode (FMLE and Wirecast can both do this), you should be able to process it, either at the server Wowza level or client player level. Although I know I ran into some problems trying to do it with JW Player.

    I'd be interested to see what solution you come up with. It would be great for me to know the exact stream time when a user "interacts" watching a live stream.

  5. #5

    Default

    Yes, it is. In both Wowza level or client player level it's useful. But it has less information on forum.

    Yehudi
    Last edited by spiritsoul; 08-18-2013 at 05:35 PM.

  6. #6

    Default

    Hi,

    FMLE outputs a timestamp function which you should be able to get in the player.

    http://www.longtailvideo.com/support...r6-hls-stream/

    You can use a custom Wowza module to get this function (and other stream functions like onMetaData) from the encoder.

    package test;
    
    import com.wowza.wms.amf.AMFDataList;
    import com.wowza.wms.module.ModuleBase;
    import com.wowza.wms.request.RequestFunction;
    import com.wowza.wms.stream.IMediaStream;
    import com.wowza.wms.stream.IMediaStreamCallback;
    
    public class Test extends ModuleBase {
    
    	class CallbackListener implements IMediaStreamCallback
    	{
    
    		public void onCallback(IMediaStream stream, RequestFunction function, AMFDataList params) {
    			System.out.println(params.toString());
    		}
    		
    	}
    	
    	private CallbackListener callbackListener = new CallbackListener();
    	
    	public void onStreamCreate(IMediaStream stream) {
    		stream.addCalbackListener(callbackListener);
    	}
    
    	public void onStreamDestroy(IMediaStream stream) 
    	{
    		stream.removeCalbackListener(callbackListener);
    	}
    }
    onCallback will be called for each data function in the stream. You can test param[0] to see if it is onFL and then work with the sd & st values.
    You should probably test if the stream is a fmle publish stream before setting the listener.

    Output is like the following.
    INFO stream publish myStream -
    AMFDataList:
    [0] @setDataFrame
    [1] onMetaData
    [2] object
    {Obj[]: author: "", copyright: "", description: "", keywords: "", rating: "", title: "", presetname: "Custom", creationdate: "Mon Aug 19 19:01:59 2013
    ", videodevice: "FaceTime HD Camera (Built-in)", framerate: 15.0, width: 1920.0, height: 1080.0, videocodecid: "avc1", videodatarate: 800.0, avclevel: 40.0, avcprofile: 77.0, videokeyframe_frequency: 2.0, audiodevice: "Internal microphone", audiosamplerate: 48000.0, audiochannels: 2.0, audioinputvolume: 75.0, audiocodecid: "mp4a", audiodatarate: 64.0}
    
    AMFDataList:
    [0] onFI
    [1] {MixedArray: sd: "19-08-2013", st: "19:04:00.388"}
    
    AMFDataList:
    [0] onFI
    [1] {MixedArray: sd: "19-08-2013", st: "19:04:01.456"}
    
    . . .
    Roger.

  7. #7
    Join Date
    Nov 2012
    Posts
    2

    Default

    Hi.

    I tryed this then it works fine.

    And I want to send data(sd, st) to client.
    so flash player catch it everytime.

    is it possible?

    thanks

    -matthew-

  8. #8
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    You can use IClient.call(); For example:

    client.call("clientsideCallBackFunction", null, "hello client");
    client-side:
    var clientObj:Object = new Object();
    clientObj.clientsideCallBackFunction(str:String):void
    {
    trace(str);
    });
    netstream.client = clientObj;
    netstream.play("myStream");
    Take a look at the ServerSideModules example that ships with Wowza in the /examples folder for a working example.

    Richard

  9. #9
    nath2099 Guest

    Default

    class CallbackListener implements IMediaStreamCallback
    {

    public void onCallback(IMediaStream stream, RequestFunction function, AMFDataList params) {
    System.out.println(params.toString());
    }

    }
    Hi, in this code, how would one "test param[0] to see if it is onFL"?
    Thanks,
    Nathan.

Similar Threads

  1. Timestamp (or other info about time) in IP-cameras data?
    By Pyatka-ubiyca in forum General Forum
    Replies: 4
    Last Post: 01-05-2017, 01:44 AM
  2. Get live stream info
    By lgbmdev in forum General Forum
    Replies: 1
    Last Post: 11-13-2013, 07:50 AM

Posting Permissions

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