Wowza Community

stream not exist redirect vod

Hi this is possible to replace a stream that not exist by a vod file?

Example:

i create a video player with this data: rtmp://127.0.0.1/live/NOSTREAMEXIST

And the wowza play a rtmp://127.0.0.1/vod/mp4:sample.mp4

Thanks for your help

The easiest solution to this would probably be to use this module to loop a video until a live stream is available:

How to loop a pre-roll until a live stream starts

Salvadore

The Stream class stream, which is named “Stream1” in the example setup, is a live stream that playback clients stream.

The source of a Stream class stream (“Stream1”) can be files or other live streams. The Stream class can switch from one file to another, and to a live stream and back to a file, etc. These are in turn the source of Stream1, but the player will continue to play Stream1.

Richard

Yes, that is true. If you use an RTMP live encoder to publish a live stream named “myStream” you can play that directly, of course. But it is not what you are wanting to do when you are wrapping that live stream in a Stream class stream to use the loop-before-live example. You want to play the Stream class stream that wraps the live stream.

Richard

Mary,

I considered some possible approaches to accomplishing that, but they all fall apart as I think them through.

For reference, the source for ModuleLoopUntilLive is included in the collection download, but I don’t think there is way to extend this to accomplish what you describe. You can have multiple loopUntilLiveSourceStreams as long as you have the same number of loopUntilLiveOutputStreams, and each the members of both lists have to be unique or you will probably have strange behavior, i.e. you can’t share the same loopUntilLiveOutputStreams for different loopUntilLiveSourceStreams

Richard

The easiest solution to this would probably be to use this module to loop a video until a live stream is available:

How to loop a pre-roll until a live stream starts

Salvadore

Hi i installed this module and receive this logs:

Original stream: mary

Loop stream: Stream1 (working i can play using wowza flash player) (rtmp://127.0.0.1/live/Stream1)

INFO server comment - ModuleLoopUntilLive.StreamListener.onPublish Swapping to live [mary]

INFO server comment - ModuleLoopUntilLive.StreamListener.onPublish Swapping to playlist [mary]

When i try to play mary stream appear this error in wowza player (rtmp://127.0.0.1/live/mary)

Failed to play mary; stream not found.

<Property>
  <Name>loopUntilLiveStream</Name>
  <Value>mary</Value>
</Property>
<Property>
 <Name>loopUntilLiveOutStream</Name>
  <Value>Stream1</Value>
</Property>

INFO server comment - MediaStreamMap.removeLiveStreamPacketizer[live/_definst_/diogopms]: Destroy live stream packetizer: sanjosestreamingpacketizer
INFO server comment - Item Stopped: mp4:sample.mp4on Stream: Stream1
INFO server comment - Stream.switch[live/_definst_/stream1]: index: 0 name:mp4:sample.mp4 start:0 length:60
INFO server comment - Item Started: mp4:sample.mp4on Stream: Stream1
INFO server comment - Item Stopped: mp4:sample.mp4on Stream: Stream1
INFO server comment - Stream.switch[live/_definst_/stream1]: index: 0 name:mp4:sample.mp4 start:0 length:60
INFO server comment - Item Started: mp4:sample.mp4on Stream: Stream1
INFO server comment - Item Stopped: mp4:sample.mp4on Stream: Stream1
INFO server comment - Stream.switch[live/_definst_/stream1]: index: 0 name:mp4:sample.mp4 start:0 length:60
INFO server comment - Item Started: mp4:sample.mp4on Stream: Stream1
INFO server comment - Item Stopped: mp4:sample.mp4on Stream: Stream1
INFO server comment - Stream.switch[live/_definst_/stream1]: index: 0 name:mp4:sample.mp4 start:0 length:60
INFO server comment - Item Started: mp4:sample.mp4on Stream: Stream1
INFO server comment - Item Stopped: mp4:sample.mp4on Stream: Stream1
INFO server comment - Stream.switch[live/_definst_/stream1]: index: 0 name:mp4:sample.mp4 start:0 length:60
INFO server comment - Item Started: mp4:sample.mp4on Stream: Stream1

The Stream class stream, which is named “Stream1” in the example setup, is a live stream that playback clients stream.

The source of a Stream class stream (“Stream1”) can be files or other live streams. The Stream class can switch from one file to another, and to a live stream and back to a file, etc. These are in turn the source of Stream1, but the player will continue to play Stream1.

Richard

Hi rrlanham but in this site (https://www.wowza.com/docs/how-to-loop-a-pre-roll-until-a-live-stream-starts-loopuntillive) says that i publish to myStream and if this stream (myStream) is not live play Stream1, but if the stream myStream exist so it plays the content??

Right?

Thank’s

Ok, i will try this solution, but imagine that you have more 1 milion streamnames… This is not a viable solution do write all the streamname and create a playlist with all the streams.

This is possible to do a generic solution to map all streamame that not playing play a vod.

Like this (every stream redirect to a playlist):

	public void onConnect(IClient client, RequestFunction function,
			AMFDataList params) {
		getLogger().info("onConnect: " + client.getClientId());
		swapToPlaylist("Stream1");
	}

	public void onConnectAccept(IClient client) {
		getLogger().info("onConnectAccept: " + client.getClientId());
		getLogger().info("onConnectAccept: " + client.getClientId());
		swapToPlaylist("Stream1");
		
	}

or this:

<smil>
    <head>
    </head>
    <body>
        <stream name="*All streams  who are not playing "></stream>

        <playlist name="pl1" playOnStream="Stream1" repeat="true" scheduled="2013-09-25 16:30:00">
            <video src="mp4:sample.mp4" start="0" length="-1"/>
        </playlist>

    </body>
</smil>

If you have configure the application correctly, while there is no live stream being published, “Stream1” will play sample.mp4, then when you publish a live stream, you will publish to “Stream1” and the live stream will override sample.mp4.

There is no stream named “mary”

Salvadore