# Re-streaming a dynamic RTSP stream based on a query string

**URL:** https://community.wowza.com/t/re-streaming-a-dynamic-rtsp-stream-based-on-a-query-string/40052
**Category:** Wowza Streaming Engine
**Created:** [February 12, 2014, 6:20pm UTC](https://community.wowza.com/t/re-streaming-a-dynamic-rtsp-stream-based-on-a-query-string/40052 "2014-02-12T18:20:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ciprian\_Stoica](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@Ciprian\_Stoica](https://community.wowza.com/u/Ciprian_Stoica)
#### Post date: [February 12, 2014, 6:20pm UTC](https://community.wowza.com/t/re-streaming-a-dynamic-rtsp-stream-based-on-a-query-string/40052/1 "2014-02-12T18:20:35Z")

</div>

Hi,

I want to re-stream a dynamic RTSP stream which I get from a third party service, based on a username, password and some other parameters.

I call VLC like this:

```auto
rtsp://wowza-ip:1935/live/[appInst]/[COLOR="#FF0000"]someUniqueStreamName.stream[/COLOR]?user=xxx&password=xxx&otherParams..

```

The file someUniqueStreamName.stream does not exist at this point.

On Wowza I defined the following Module:

```auto
public class LiveModule extends ModuleBase {
	public void onRTPSessionCreate(RTPSession rtpSession) {
		String queryString = rtpSession.getQueryStr();
		
		// call 3rd party service with the params from queryString
		
		// get a rtsp stream like this from the 3rd party service:
		// rtsp://ec2-xxxx.amazonaws.com:1935/live/xxx.stream?someParams
		
		// based on the above rtsp stream, create the [COLOR="#B22222"]someUniqueStreamName.stream[/COLOR] file on disk, containing the above rtsp stream
		
		appInstance.startMediaCasterStream([COLOR="#B22222"]someUniqueStreamName.stream[/COLOR], "rtp");
	}
}

```

In other words, I want to create the someUniqueStreamName.stream file on-the-fly, then watch its dynamically generated content in VLC. But it just doesn’t work. I get the error "Your input can’t be opened:

VLC is unable to open the MRL" in VLC. The file someUniqueStreamName.stream gets created properly with the proper rtsp url from the 3rd party.

Exactly the same on-the-fly stream file creation approach works great for HLS streaming and I can watch the stream on iOS. I have defined the following in the same module:

```auto
public class LiveModule extends ModuleBase {
	public void onHTTPSessionCreate(IHTTPStreamerSession httpSession) {
		String queryString = httpSession.getQueryStr();
		
		// same code as above
	}
}

```

I hope you get the idea of what I need to achieve. I’m not sure whether my approach is the proper one or I should change to another one.

Thank you in advance for any advice.

Ciprian

---

<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: [February 12, 2014, 10:43am UTC](https://community.wowza.com/t/re-streaming-a-dynamic-rtsp-stream-based-on-a-query-string/40052/2 "2014-02-12T10:43:38Z")

</div>

Take a look at this API for for aliasing stream names:

[How to use the IMediaStreamNameAliasProvider2 interface](https://www.wowza.com/docs/how-to-use-the-imediastreamnamealiasprovider2-interface)

Salvadore
