Wowza Community

Determine live stream delay

Hi there guys. I’ve got a problem.

I’m really, really new to Wowza in general, which doesn’t help, but I’ve got a clear task at hand. We’re feeding a live stream and we need the web clients to determine what the time is in the video. We figure we can continuously feed a server timestamp into the feed using metadata/id3.

The webpage will use rtmp and hls as well as jw player so we’re trying to avoid using a custom flash player (so any netconnection.call()s are out the window).

But we figured “how hard can it be to make a module send out timestamps”. Turns out it’s not easy, at least not with very sparse knowledge. I’ve read the articles but unfortunately those all seem to rely on the client making netconnection-calls.

Any help on this would be greatly appreciated, thanks =)

It’s a tricky question, and something we’ve been struggling with a bit with ourselves (you can have a look a my previous forum posts for a bit of a log of the struggle). I figure I’ll post some of my notes about how we’ve approached it on the hope that others will as well.

Looking at how people usually solve this problem, there are two general approaches: Meta data within the video itself (muxed into the mp4), or meta data within the protocol transport (that is in the HLS manifest of the RTMP meta data). For the former approach, Apple demonstrated some techniques at WWDC (http://devstreaming.apple.com/videos/wwdc/2014/505xx5j7n7h3a1q/505/505_hd_harnessing_metadata_in_audiovisual_media.mov?dl=1, http://devstreaming.apple.com/videos/wwdc/2014/504xx5n1n7eie65/504/504_hd_advanced_media_for_the_web.mov?dl=1 if you’re a registered developer) that will get you no where but does illustrate the principle. Elsewhere on these forums, there’s an example of how to transport video timing meta data into the stream with Wowza: https://www.wowza.com/docs/how-to-convert-ontextdata-events-in-a-live-or-vod-stream-to-timed-events-id3-tags-in-an-apple-hls-stream.

My simple recommendation would be this: If you run the stream and control the video input yourself, you can probably mux meta data into the stream and get it out in the other side without worrying too much about Wowza modules. If not, you’ll need Wowza to do some heavy lifting.

The solution we’ve ended up relying on is HLS-only and uses a header in the spec called EXT-X-PROGRAM-DATE-TIME. Basically, this is a line in the HLS manifest that identifies the exact time the first chunk in the chunk list was created. Unfortunately, Wowza doesn’t support this feature natively (I’d love for it to do so though!?) so instead we’ve set up a module that indexes when each chunk is created (both live and dvr) – and then hook into the HTTP delivery to add the extra line to the manifest (you can see roughly how this can be achieved in a unrelated piece of code posted here https://github.com/availo/wowza-vhost-loadbalancer/blob/master/src/com/availo/wms/httpstreamer/HTTPStreamerAdapterCupertinoRedirector.java, but even this approach has a few potential quirks that we haven’t figured out yet.)

Reading out the standard HLS header though is another story on top of it, which involves custom HLS modules in Flash and an extra AJAX request in HTML5 browsers to read and parse the manifest.

So: Any hope we’ll see the program data time as a standard feature in Wowza? Any one come up with a lighter solution than the one described above?

This would be a very useful option in Wowza. Are there any updates to this thread? Is this on the roadmap?

Hi All, just checking in all the 6 years if better ways have emerged to do this? Thank you!

do you have any update?

Thanks

Checking on an update for you @Luis_Nunez

There’s still no easy way. We do have an example on our docs for adding the ProgramDateTime data to the HLS stream.

https://www.wowza.com/docs/how-to-control-display-of-program-date-and-time-headers-in-hls-chunklists-for-live-streams-ext-x-program-date-time

If you are using cmaf then the headers are automatically added.

Perhaps one of our community experts can assist you like @Karel_Boek who is an independent streaming consultant.

I’m not sure if your proposal could be applied, We are using the wowza cloud service, we don’t have our own server.

Regards

Oh ok well you posted in the forum for Streaming Engine JAVA API so that’s why there is confusion. Wowza Streaming Cloud is Wowza Video. There is no way to do that outside of Engine, so you may need to pay for some custom work to be done.

You can post in Wowza Hire a Consultant forum if you want to.