# How to get the time info of live stream

**URL:** <https://community.wowza.com/t/how-to-get-the-time-info-of-live-stream/40629>\
**Category:** Wowza Streaming Engine\
**Created:** [August 15, 2013, 8:54am UTC](https://community.wowza.com/t/how-to-get-the-time-info-of-live-stream/40629 "2013-08-15T08:54:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![yehudi\_cheng](https://avatars.discourse-cdn.com/v4/letter/y/9dc877/32.png) [@yehudi\_cheng](https://community.wowza.com/u/yehudi_cheng)\
**Post date:** [August 15, 2013, 8:54am UTC](https://community.wowza.com/t/how-to-get-the-time-info-of-live-stream/40629/1 "2013-08-15T08:54:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tim\_Dougherty](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/tim_dougherty/32/596_2.png) [@Tim\_Dougherty](https://community.wowza.com/u/Tim_Dougherty)\
**Post date:** [August 14, 2013, 8:36pm UTC](https://community.wowza.com/t/how-to-get-the-time-info-of-live-stream/40629/2 "2013-08-14T20:36:40Z")

</div>

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](https://www.wowza.com/docs/how-to-set-up-low-latency-applications-in-wowza-streaming-engine-for-rtmp-streaming)

[How to configure Apple HTTP Live Streaming packetization (cupertinostreaming)](https://www.wowza.com/docs/how-to-configure-apple-hls-packetization-cupertinostreaming%28cupertinostreaming%29)

I think this is what you’re looking for.

-Tim

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [September 25, 2013, 10:11pm UTC](https://community.wowza.com/t/how-to-get-the-time-info-of-live-stream/40629/3 "2013-09-25T22:11:46Z")

</div>

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

```auto
client.call("clientsideCallBackFunction", null, "hello client");

```

client-side:

```auto
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

---

<div class="post-metadata">

**Author:** ![Jim\_Sustacek](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@Jim\_Sustacek](https://community.wowza.com/u/Jim_Sustacek)\
**Post date:** [August 16, 2013, 8:11am UTC](https://community.wowza.com/t/how-to-get-the-time-info-of-live-stream/40629/4 "2013-08-16T08:11:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Matthew\_Choi](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@Matthew\_Choi](https://community.wowza.com/u/Matthew_Choi)\
**Post date:** [September 25, 2013, 6:07pm UTC](https://community.wowza.com/t/how-to-get-the-time-info-of-live-stream/40629/5 "2013-09-25T18:07:35Z")

</div>

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-

---

<div class="post-metadata">

**Author:** ![Roger\_Littin1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Roger\_Littin1](https://community.wowza.com/u/Roger_Littin1)\
**Post date:** [August 19, 2013, 7:22pm UTC](https://community.wowza.com/t/how-to-get-the-time-info-of-live-stream/40629/6 "2013-08-19T19:22:31Z")

</div>

Hi,

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

[http://www.longtailvideo.com/support/forums/jw-player/servers-and-streaming/33048/retrieving-timestamp-system-date-and-time-embedded-by-fmle-in-jwplayer6-hls-stream/](http://www.longtailvideo.com/support/forums/jw-player/servers-and-streaming/33048/retrieving-timestamp-system-date-and-time-embedded-by-fmle-in-jwplayer6-hls-stream/)

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

```auto
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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![yehudi\_cheng](https://avatars.discourse-cdn.com/v4/letter/y/9dc877/32.png) [@yehudi\_cheng](https://community.wowza.com/u/yehudi_cheng)\
**Post date:** [August 15, 2013, 4:24pm UTC](https://community.wowza.com/t/how-to-get-the-time-info-of-live-stream/40629/7 "2013-08-15T16:24:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yehudi\_cheng](https://avatars.discourse-cdn.com/v4/letter/y/9dc877/32.png) [@yehudi\_cheng](https://community.wowza.com/u/yehudi_cheng)\
**Post date:** [August 19, 2013, 8:08am UTC](https://community.wowza.com/t/how-to-get-the-time-info-of-live-stream/40629/8 "2013-08-19T08:08:32Z")

</div>

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

Yehudi
