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

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

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

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.

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-

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/

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.

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

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

Yehudi