Live Streaming, FMS and Absolute Stream Time

Think of a live stream is being published to FMS and all subscribers are watching that live stream. Now one of the subscriber is late in joining this live stream but still he does that successfully and watches the live stream from the point when he joined it. Everything looks perfect!

But wait, one thing is not perfect definitely – the time of the stream been published. Yes, the subscribers does not see the absolute stream time from start of its publish. So what does that mean? They are not in sync of each other. Let’s say I want to notify all subscribers at certain point of time in video. Now I would be watching something at time t and I will send message to all subscribers. What I want is : all subscribers should see this message at exact point of time when they see what I am watching in video. But as there is no time sync, subscribers won’t know that at what point of time the message should be displayed.

As work around, what I did is I passed timecode from FMLE. That means that at each frame of video, FMLE would encode system time in the frame. All subscribers would get onFI() event with that time code at each second (given that the timecode rate and frame rate of video is same at FMLE). A subscriber would have to save the first timecode as the start point of time. On next onFI() event they can just subtract the start timecode from the current timecode and that would give it a absolute time of stream!!

Once absolute time of stream is found, you can synchronize the message around 🙂 I did not written down any code here but if any one wants the code, let me know – I can provide it.

Thanks,
Naresh

Leave a Reply

Your email address will not be published. Required fields are marked *