I successfully implemented a stream switching module using this as a baseline example: https://www.wowza.com/docs/how-to-switch-streams-using-stream-class-streams
I noticed that when switching between multiple live and od sources, RTMP(T) handles this switch well during playback. However, when viewing using HDS/HLS, the player just suddenly stops at the moment I make the server-side switch. Is this a known issue? If so, is there a resolution?
Thanks.
Hello there.
Do the various streams that are being switched between contain the same FPS and key frame frequency across the set? Also, are the frame size, video and audio codecs the same for all the streams? Are they all H.264 video and AAC or MP3 audio?
If the codecs are not the same switching will be problematic.
Another problem could be that HTTP streaming sends chunks to the client. The client needs 3 chunks cached before it starts playing.
Does the HDS/HLS stream ever start to play after the switch? If so you could try modifying the default packetization settings.
By default Wowza is set to send 3, 10 second chunks in each packet sent to the client. You can modify this behavior by editing the Application.xml file.
This guide explains how to control how the Cupertino (iOS device) segmenter segments an incoming live stream:
How to configure Apple HTTP Live Streaming packetization (cupertinostreaming)
How to configure Adobe HDS packetization (sanjosestreaming)
I hope this is helpful in troubleshooting your issue.
Kind regards,
Salvadore
The streams vary in keyframe frequency, fps, size, but they are all H264/AAC or MP3. I’ll give the packetization settings a try and get back to you with results. Thanks.
It appears the player stops after a 404 Not Found error on one of the segments during a server-side switch:
http:///media_b105217.abst/Seg1-Frag171 Failed to load resource: the server responded with a status of 404 (Not Found)
http:///playlist_b105217.abst Failed to load resource: the server responded with a status of 404 (Not Found)
The player never plays, but if I press the play button, it resumes playback. I set the chunkDurationTarget to 1s instead of 10s and that did not help. Why does the player stop when a chunk cannot be retrieved over HDS/HLS, but RTMP and RTMPT handles this just fine?
I am pretty sure this is due to different encodings per stream. Your best bet is to re-encode these streams with the same fps, GOP (key frame frequency), audio/video and frame size.
You can do this with FFmpeg:
How to encode video on demand content
Kind regards,
Salvadore