Wowza Community

Auto switching between two stream sources

Hi!

Look at my problem:

I have one camera connected to two providers. Sometimes one of them does not work. Can Wowza switching between two stream sources automatically ?

Thanks!

There is nothing built-in like that. You could monitor a stream and switch. Wrap the streams in a Stream class stream like this:

https://www.wowza.com/docs/how-to-switch-streams-using-stream-class-streams

And monitor the source something like this:

https://www.wowza.com/docs/how-to-use-imediastreamactionnotify2-to-monitor-live-streams-modulestreamwatchdog

Then you can do switch when you detect a problem.

Richard

The way I pointed to is server-side switching (and monitoring), it does not involve any client.

Richard

That would be client-side buffering. If it is Flash RTMP client, try setting Netstream buffer to 0.

Richard

Scratch the NetStream buffer suggestion. Apply patch 12, which changes the behavior in this case (switching to a live stream): Wowza will start on the live stream’s previous key frame instead of next key frame. This adds some latency, depending on key frame frequency and when the client starts playing the stream. You can switch back to previous behavior like this:

stream.setStartLiveOnPreviousKeyFrame(false);

Richard

I’m not sure if I understand. To RTP ingress in StreamClass stream, make sure the RTP stream is started in StreamManager if is MediaCaster stream. If the source is RTP push, it is not necessary to start in StreamManager.

Richard

There is nothing built-in like that. You could monitor a stream and switch. Wrap the streams in a Stream class stream like this:

https://www.wowza.com/docs/how-to-switch-streams-using-stream-class-streams

And monitor the source something like this:

https://www.wowza.com/docs/how-to-use-imediastreamactionnotify2-to-monitor-live-streams-modulestreamwatchdog

Then you can do switch when you detect a problem.

Richard

Hi Richard,

I’ve done a setup with some of the results which your forum gaves me. I’ve posted something. Have you any idea or hint for me?:confused:

The main problem seems to be that the Wowza Application can’t connect via .stream File to another stream. But if I use the

content 1:1 from the .stream file as a streamname… it works.

From the example here : https://www.wowza.com/docs/how-to-configure-a-live-stream-repeater

–snip–

RTMP
To play the stream in Adobe Flash Player, double-click [install-dir]/examples/LiveVideoStreaming/FlashRTMPPlayer/player.html, enter the information below, and then click the Connect button.
Server: rtmp://[wowza-edge-address]:1935/liveedge
Stream: rtmp://[wowza-origin-address]:1935/liveorigin/_definst_/[stream-name]
Where [wowza-edge-address] is the IP address of an edge server running Wowza Media Server, [wowza-origin-address] is the IP address of the origin server running Wowza Media Server, and [stream-name] is the name of the live stream being sent to the origin server.
Note: You can substitute the name of a .stream file on the origin server in place of the complex URL in Stream. For more information, see Using simple stream names.

–snip–

I always get via .stream file the following : LiveMediaStreamReceiver.connect: failure

Is it possible to have the switch happen from the server-side without the client having to know which playlist item to switch to?

My bad, Richard. Just noticed that.

After implementing the stream switching, I noticed that there is a lag when switching from a VOD stream to a live stream as the live stream buffers (Live Streaming Buffering Time). Do you have any suggestions on how to start up the live stream when it is published but only switch when the live stream is properly buffered? Is there a way to tell from the stream that it is “ready to go”?

What about switching streams with RTP ingress? Using the examples you provided above with RTP, the publish event fires about every three seconds. Is there an event for when RTP gets “published” that will not treat each ingress chunk as a new publish event?

Hi,

i am using wowza streaming engine and using live repeater and taking input from Primary Origin URL and Secondary Origin URL, my question is how(where) to know the Wowza Streaming Engine taking content from Primary Origin URL (or) Secondary Origin URL.

Thanks

Sri

Hello Sri,

If you have both options in a .stream file or in your edge configuration, the only way to know would be from the changes you would see in the log entries.

Can you give me more details about your need to track this connection to your Primary or Secondary origin?

Regards,

Jason Hatchett