# RTSP protocol options

**URL:** <https://community.wowza.com/t/rtsp-protocol-options/39850>\
**Category:** Wowza Streaming Engine\
**Created:** [February 12, 2013, 6:25pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850 "2013-02-12T18:25:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_Bolino](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@Jim\_Bolino](https://community.wowza.com/u/Jim_Bolino)\
**Post date:** [February 12, 2013, 6:25pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/1 "2013-02-12T18:25:29Z")

</div>

Hi,

I’m developing an ip camera application.

All rtsp streams are started and stopped with the mediacaster.startStream and mediacaster.stopStream functions.

Files are being saved on disk with the startRecordingSegmentBySchedule example i’ve found in the tutorial.

However im stuck with 3 questions:

1. Is it possible to stop and start the audio and/or video of the incoming rtsp stream (to save bandwith when they are not needed)

I’ve tried with stream.setReceiveAudio(false) and stream.setReceiveVideo(false) but nothing happens.

1. Is it possible to send an audio stream back over the same rtsp stream.

I know most ip cameras support some type of audio return channel, however I’m not sure if this is part of the rtsp standard.

1. Is there an easy way (or example/tutorial) of joining all the split files, that have been created by the startRecordingSegmentBySchedule function?

Or do i manually have to create a playlist of some sort?

My goal is to make a seekable stream, that will be served to a flash client, based on all the individual files on the server.

Any help with these questions will be highly appreciated.

Kind regards,

Jim

---

<div class="post-metadata">

**Author:** ![Jim\_Bolino](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@Jim\_Bolino](https://community.wowza.com/u/Jim_Bolino)\
**Post date:** [February 18, 2013, 10:40am UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/2 "2013-02-18T10:40:10Z")

</div>

I’ve looked at the specification document of our cameras:

[http://www.onvif.org/specs/stream/ONVIF-Streaming-Spec-v221.pdf](http://www.onvif.org/specs/stream/ONVIF-Streaming-Spec-v221.pdf)

section: 5.3 Back Channel Connection

Is it possible i can use wowza with this rtsp extension?

---

<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:** [February 19, 2013, 3:23pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/3 "2013-02-19T15:23:32Z")

</div>

You should be able to re-stream the RTSP output. Take a look at this guide:

[https://www.wowza.com/docs/how-to-re-stream-video-from-an-ip-camera-rtsp-rtp-re-streaming](https://www.wowza.com/docs/how-to-re-stream-video-from-an-ip-camera-rtsp-rtp-re-streaming)

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:** [February 20, 2013, 10:39pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/4 "2013-02-20T22:39:54Z")

</div>

Jim,

1. For vod playback you can join using this method, but it only works for Flash RTMP clients:

[https://www.wowza.com/docs/how-to-insert-a-pre-roll-or-mid-roll-for-video-on-demand-playback-in-flash-rtmp-client](https://www.wowza.com/docs/how-to-insert-a-pre-roll-or-mid-roll-for-video-on-demand-playback-in-flash-rtmp-client)

For live, you can join with Stream class streams, and this works across client types, and as input to the Wowza Transcoder and PushPublish. The scheduler is one example:

[https://www.wowza.com/docs/how-to-schedule-streaming-with-wowza-streaming-engine-streampublisher](https://www.wowza.com/docs/how-to-schedule-streaming-with-wowza-streaming-engine-streampublisher)

1. This is not supported using Wowza as far as I know.

2. I have used IMediaStream.setReceiveVideo(false) in IMediaStreamActionNotify3.onPlay() to control this in rtsp playback in VLC. I did not test on any mobile clients:

```auto
package test;
import com.wowza.util.IOPerformanceCounter;
import com.wowza.wms.amf.*;
import com.wowza.wms.application.*;
import com.wowza.wms.client.IClient;
import com.wowza.wms.module.*;
import com.wowza.wms.request.RequestFunction;
import com.wowza.wms.stream.*;
import com.wowza.wms.media.model.*;
public class ModuleSoundOnly extends ModuleBase
{
	class StreamListener implements IMediaStreamActionNotify3
	{
		public void onMetaData(IMediaStream stream, AMFPacket metaDataPacket)
		{
			System.out.println("onMetaData[" + stream.getContextStr() + "]: " + metaDataPacket.toString());
		}
		public void onPauseRaw(IMediaStream stream, boolean isPause, double location)
		{
			System.out.println("onPauseRaw[" + stream.getContextStr() + "]: isPause:" + isPause + " location:" + location);
		}
		public void onPause(IMediaStream stream, boolean isPause, double location)
		{
			System.out.println("onPause[" + stream.getContextStr() + "]: isPause:" + isPause + " location:" + location);
		}
public void onPlay(IMediaStream stream, String streamName, double playStart, double playLen, int playReset)
{
	stream.setReceiveVideo(false);
}
		public void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
		{
			System.out.println("onPublish[" + stream.getContextStr() + "]: isRecord:" + isRecord + " isAppend:" + isAppend);
		}
		public void onSeek(IMediaStream stream, double location)
		{
			System.out.println("onSeek[" + stream.getContextStr() + "]: location:" + location);
		}
		public void onStop(IMediaStream stream)
		{			
			IOPerformanceCounter perf = stream.getMediaIOPerformance();
			getLogger().info("OutBytesRate for " + stream.getName() + ": " + perf.getMessagesOutBytes());
		}
		public void onUnPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
		{
			System.out.println("onUnPublish[" + stream.getContextStr() + "]: streamName:" + streamName + " isRecord:" + isRecord + " isAppend:" + isAppend);
		}
		public void onCodecInfoAudio(IMediaStream stream,
				MediaCodecInfoAudio codecInfoAudio) {
			System.out.println("onCodecInfoAudio[" + stream.getContextStr() + " Audio Codec" + codecInfoAudio.toCodecsStr() + "]: ");
		}
		public void onCodecInfoVideo(IMediaStream stream,
				MediaCodecInfoVideo codecInfoVideo) {
			System.out.println("onCodecInfoVideo[" + stream.getContextStr() + " Video Codec" + codecInfoVideo.toCodecsStr() + "]: ");
		}
	}
	public void play(IClient client, RequestFunction function,
	        AMFDataList params) {
		IMediaStream stream = getStream(client, function);
		
		String[] querystring = stream.getQueryStr().split("&");
		String qs1 = querystring[0];
				
		//stream.setReceiveVideo(false);
		
	}
	public void onStreamCreate(IMediaStream stream)
	{
		getLogger().info("onStreamCreate["+stream+"]: clientId:" + stream.getClientId());
		IMediaStreamActionNotify2 actionNotify = new StreamListener();
		WMSProperties props = stream.getProperties();
		synchronized (props)
		{
			props.put("streamActionNotifier", actionNotify);
		}
		stream.addClientListener(actionNotify);
	}
	public void onStreamDestroy(IMediaStream stream)
	{
		getLogger().info("onStreamDestroy["+stream+"]: clientId:" + stream.getClientId());
		IMediaStreamActionNotify2 actionNotify = null;
		WMSProperties props = stream.getProperties();
		synchronized (props)
		{
			actionNotify = (IMediaStreamActionNotify2) stream.getProperties().get("streamActionNotifier");
		}
		if (actionNotify != null)
		{
			stream.removeClientListener(actionNotify);
			getLogger().info("removeClientListener: " + stream.getSrc());
		}
	}
}

```

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:** [February 26, 2013, 7:05pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/5 "2013-02-26T19:05:58Z")

</div>

No, I don’t think that can work. Only on the play streams

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:** [March 4, 2013, 7:35pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/6 "2013-03-04T19:35:39Z")

</div>

Sounds like you recorded a .flv file but are playing it back with mp4: prefix. If so, remove the mp4: prefix from the stream name.

Otherwise, the recording may be corrupt. If there is .tmp file next to it with the same name, that indicates the recording did complete successfully. There is nothing you can do with such a file.

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:** [March 5, 2013, 11:34am UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/7 "2013-03-05T11:34:09Z")

</div>

.flv files are not supported for rtsp clients, they will only work in Flash rtmp clients. You have to record to .mp4 container to playback over rtsp.

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:** [March 6, 2013, 5:54pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/8 "2013-03-06T17:54:20Z")

</div>

I think you can put g711 in a quicktime container, according to: [http://wiki.multimedia.cx/index.php?title=QuickTime\_container](http://wiki.multimedia.cx/index.php?title=QuickTime_container)

But I am not sure if Wowza will do it. You can test and see what you get, and I will see what I can find out. I don’t have a camera with g711 to test myself.

If Wowza does record the g711 it should playback in VLC and Flash but not sure about other clients.

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:** [March 7, 2013, 9:19pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/9 "2013-03-07T21:19:18Z")

</div>

Jim,

In our test it didn’t work. You could use the Wowza Transcoder, which supports G.711 (µ-law and A-law) for decode.

[https://www.wowza.com/docs/how-to-set-up-and-run-wowza-transcoder-for-live-streaming](https://www.wowza.com/docs/how-to-set-up-and-run-wowza-transcoder-for-live-streaming)

Richard

---

<div class="post-metadata">

**Author:** ![Jim\_Bolino](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@Jim\_Bolino](https://community.wowza.com/u/Jim_Bolino)\
**Post date:** [February 19, 2013, 5:07pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/10 "2013-02-19T17:07:51Z")

</div>

I’ve read that thread extensively, but it doesn’t answer my questions:

1. can i selectively disable the audio or video track? (the rtspStreamAudioTrack and rtspStreamVideoTrack Booleans, in the application.xml disable it for all streams.

2. does wowza support bi-directional audio, over one rtsp connection?

3. see first post.

---

<div class="post-metadata">

**Author:** ![Jim\_Bolino](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@Jim\_Bolino](https://community.wowza.com/u/Jim_Bolino)\
**Post date:** [February 26, 2013, 5:47pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/11 "2013-02-26T17:47:52Z")

</div>

I’m trying to do the same on the published stream, so in the onPublish() method. But this doesn’t seem to have any effect.

It would be great if i could selectively stop the audio from the incoming stream to save bandwidth between “broadcaster” and server.

Kind regards, Jim

---

<div class="post-metadata">

**Author:** ![Jim\_Bolino](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@Jim\_Bolino](https://community.wowza.com/u/Jim_Bolino)\
**Post date:** [March 4, 2013, 6:08pm UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/12 "2013-03-04T18:08:04Z")

</div>

> 1. For vod playback you can join using this method, but it only works for Flash RTMP clients:
> 
> [Wowza Streaming Engine Java API documentation](https://www.wowza.com/docs/how-to-insert-a-pre-roll-or-mid-roll-for-video-on-demand-playback-in-flash-rtmp-client)
> 
> For live, you can join with Stream class streams, and this works across client types, and as input to the Wowza Transcoder and PushPublish. The scheduler is one example:
> 
> [Schedule streaming](https://www.wowza.com/docs/how-to-schedule-streaming-with-wowza-streaming-engine-streampublisher)
> 
> Can you help me a bit more with this?
> 
> I’ve tried playing the recorded .flv files that were created with the LiveStreamRecorderFLV class. (just by putting them in /content folder, and calling the /vod url)
> 
> However i get the famous “File is missing ‘moov’ atom” error. (i am not trying to play a file that is not closed properly)
> 
> Kind regards, Jim

---

<div class="post-metadata">

**Author:** ![Jim\_Bolino](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@Jim\_Bolino](https://community.wowza.com/u/Jim_Bolino)\
**Post date:** [March 5, 2013, 10:27am UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/13 "2013-03-05T10:27:25Z")

</div>

> Sounds like you recorded a .flv file but are playing it back with mp4: prefix. If so, remove the mp4: prefix from the stream name.
> 
> Otherwise, the recording may be corrupt. If there is .tmp file next to it with the same name, that indicates the recording did complete successfully. There is nothing you can do with such a file.
> 
> Richard

Yes im recording .flv, but im playing it back with the folowing url: rtsp://192.168.1.153:1935/vod/1.flv

The files are split every x minutes (startRecordingSegmentBySchedule), so the moment a new file is created, i should be able to use the old one right?

---

<div class="post-metadata">

**Author:** ![Jim\_Bolino](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@Jim\_Bolino](https://community.wowza.com/u/Jim_Bolino)\
**Post date:** [March 6, 2013, 11:29am UTC](https://community.wowza.com/t/rtsp-protocol-options/39850/14 "2013-03-06T11:29:21Z")

</div>

ok, but the flv container is the only one that can hold my G711 audio codec.

The only workaround would be transcoding audio to aac or mp3, and saving in mp4 container?
