I’am facing an issue with HLS streaming when using 2 encoders for redundancy.
The 2 encoders push a stream in RTMP to Wowza Streaming Engine and then the streams are republished via a Stream Target to Akamai (HLS push).
The 2 resulting HLS playlist are merged in one redundant playlist. The video player (hlsjs) is supposed to switch stream if the first stream becomes anavailable.
But it does not work because the timestamps (PTS / DTS) are not in sync in the 2 streams.
My question is: is there a property in Wowza so that the timestamps in HLS streams are in absolute time ? Currently they always start from 0 when the encoder starts streaming.
Or is there a way to edit these timestamps using the Java API ?
If you have sync’d time codes between encoders and can send that to WSE, then you should be able to enable the property “ cupertinoCalculateChunkIDBasedOnTimecode
If that doesn’t work, can you please send a support ticket and we can run some tests for you. Thanks.
RTMP will always start at 0, unlikely that can be changed. What you really need to do is sync those encoders.
I found a trick to synchronize the timestamps between the 2 streams with the Java API. I use the interface IMediaStreamLivePacketNotify and its method onLivePacket to update the timecodes of the packets :
public void onLivePacket(IMediaStream stream, AMFPacket packet)
{
packet.setAbsTimecode(packet.getAbsTimecode()+stream.getElapsedTime().getDate().getTime());
}
And with the property cupertinoCalculateChunkIDBasedOnTimecode enabled as you mentionned, the switch seems to work on the player…
I use 2 OBS studio as encoders. Do you know how to sync these encoders ?