# stream not exist redirect vod

**URL:** https://community.wowza.com/t/stream-not-exist-redirect-vod/38705
**Category:** Wowza Streaming Engine
**Created:** [January 22, 2014, 7:20am UTC](https://community.wowza.com/t/stream-not-exist-redirect-vod/38705 "2014-01-22T07:20:19Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Ze\_Alves](https://avatars.discourse-cdn.com/v4/letter/z/e36b37/32.png) [@Ze\_Alves](https://community.wowza.com/u/Ze_Alves)
#### Post date: [January 22, 2014, 7:20am UTC](https://community.wowza.com/t/stream-not-exist-redirect-vod/38705/1 "2014-01-22T07:20:19Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)
#### Post date: [January 22, 2014, 9:45am UTC](https://community.wowza.com/t/stream-not-exist-redirect-vod/38705/2 "2014-01-22T09:45:32Z")

</div>

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](https://www.wowza.com/docs/how-to-loop-a-pre-roll-until-a-live-stream-starts-loopuntillive)

Salvadore

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [January 23, 2014, 9:23pm UTC](https://community.wowza.com/t/stream-not-exist-redirect-vod/38705/3 "2014-01-23T21:23:13Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [January 28, 2014, 9:31pm UTC](https://community.wowza.com/t/stream-not-exist-redirect-vod/38705/4 "2014-01-28T21:31:01Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [April 1, 2014, 7:39pm UTC](https://community.wowza.com/t/stream-not-exist-redirect-vod/38705/5 "2014-04-01T19:39:49Z")

</div>

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](https://www.wowza.com/docs/utility-modules-for-wowza-streaming-engine-media-server-software), 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

---

<div class="post-metadata">

### Author: ![Ze\_Alves](https://avatars.discourse-cdn.com/v4/letter/z/e36b37/32.png) [@Ze\_Alves](https://community.wowza.com/u/Ze_Alves)
#### Post date: [January 23, 2014, 8:02am UTC](https://community.wowza.com/t/stream-not-exist-redirect-vod/38705/6 "2014-01-23T08:02:01Z")

</div>

> 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](https://www.wowza.com/docs/how-to-loop-a-pre-roll-until-a-live-stream-starts-loopuntillive)
> 
> 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.

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

```

```auto
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

```

---

<div class="post-metadata">

### Author: ![Ze\_Alves](https://avatars.discourse-cdn.com/v4/letter/z/e36b37/32.png) [@Ze\_Alves](https://community.wowza.com/u/Ze_Alves)
#### Post date: [January 23, 2014, 4:38pm UTC](https://community.wowza.com/t/stream-not-exist-redirect-vod/38705/7 "2014-01-23T16:38:02Z")

</div>

> 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 ([Loop a pre-roll until a live stream starts](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

---

<div class="post-metadata">

### Author: ![Ze\_Alves](https://avatars.discourse-cdn.com/v4/letter/z/e36b37/32.png) [@Ze\_Alves](https://community.wowza.com/u/Ze_Alves)
#### Post date: [March 31, 2014, 3:04am UTC](https://community.wowza.com/t/stream-not-exist-redirect-vod/38705/8 "2014-03-31T03:04:59Z")

</div>

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):

```auto
	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:

```auto
<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>

```

---

<div class="post-metadata">

### Author: ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)
#### Post date: [January 23, 2014, 12:12pm UTC](https://community.wowza.com/t/stream-not-exist-redirect-vod/38705/9 "2014-01-23T12:12:58Z")

</div>

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
