Wowza Community

Trouble with RTSP live streaming in "proxy mode"

Hi all

I’m trying to connect a new IP camera model to wonza and re-stream the media using rtsp interleaved. Unfortunately, the rtsp camera implementation is still buggy, and crash if the CSeq header doesn’t follow the request line…

So… I coded a little java “proxy” that checks the CSeq header position and fix it if is necessary. ffplay and mplayer can now get the camera’s stream, but when I use wonza I get timeout:

2012-09-16	08:38:31	COT	comment	server	INFO	200	-	RTPMediaCaster.streamTimeout[1506367663:rtplive/_definst_:31.stream]: timeout:12000 diff:12013 reason:101	-	-	-	576.908	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-16	08:38:31	COT	comment	server	INFO	200	-	RTPMediaCaster.resetConnection[1506367663:rtplive/_definst_:31.stream]: 	-	-	-	576.909	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-16	08:38:31	COT	comment	server	INFO	200	-	RTPMediaCaster.closeRTPSession[1506367663:rtplive/_definst_:31.stream]	-	-	-	576.909	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-16	08:38:31	COT	comment	server	DEBUG	200	-	*** RTSPMessageSend ***
TEARDOWN rtsp://192.168.99.2:5554/live/av0?user=admin&passwd=admin RTSP/1.0
Session: 31692174
CSeq: 5

I can confirm that the audio and video streams are delivered inside the tcp connection from the camera trough the “proxy” to wowza. I can see this in the logs:

2012-09-16	08:38:21	COT	comment	server	DEBUG	200	-	rtp[rtsp://192.168.99.138:554/audio0:652] {80 88 33 ba 74 e0 0c 8d 50 63 23 22 d6 d6 d1 d0 }	-	-	-	567.633	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-16	08:38:21	COT	comment	server	DEBUG	200	-	rtp[rtsp://192.168.99.138:554/video0:173] {80 e0 ec 34 16 ae b8 59 50 63 23 22 41 9a ee 0a }	-	-	-	567.633	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-16	08:38:21	COT	comment	server	DEBUG	200	-	  SINGLE: end:true tc:380549209 sz:161	-	-	-	567.634	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-16	08:38:21	COT	comment	server	DEBUG	200	-	rtp[rtsp://192.168.99.138:554/audio0:652] {80 88 33 bb 74 e0 0f 0d 50 63 23 22 51 d5 d0 dc }	-	-	-	567.715	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-16	08:38:21	COT	comment	server	DEBUG	200	-	send[1844165295]: size:0:0 filter:7 time:251 tOffset:0 rwrt:true	-	-	-	567.718	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-

Those look like packets right ? So, I’m a little loss here. I know that is not a wowza problem, but maybe you can give any clue about what to do. Do you think I have to “fix” the IP address inside all the messages coming from the camera ? (ffplay and mplayer doesn’t seem to care about it) 192.168.99.2 is the “proxy”, and 192.168.99.138 is the camera:

2012-09-16	08:38:19	COT	comment	server	INFO	200	-	RTPSessionDescriptionDataProviderBasicRTSPWorker.sessionStart: PLAY: rtsp://192.168.99.2:5554/live/av0?user=admin&passwd=admin	-	-	-	564.809	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-16	08:38:19	COT	comment	server	DEBUG	200	-	*** RTSPMessageSend ***
PLAY rtsp://192.168.99.2:5554/live/av0?user=admin&passwd=admin RTSP/1.0
Session: 31692174
CSeq: 4
Range: npt=0.000-
	-	-	-	564.812	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-16	08:38:19	COT	comment	server	DEBUG	200	-	RTPSessionDescriptionDataProviderBasicRTSPWorker.send: command:PLAY
PLAY rtsp://192.168.99.2:5554/live/av0?user=admin&passwd=admin RTSP/1.0
Session: 31692174
CSeq: 4
Range: npt=0.000-
	-	-	-	564.812	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-16	08:38:19	COT	comment	server	DEBUG	200	-	*** RTSPMessageReceive ***
RTSP/1.0 200 OK
response: OK
protocol: RTSP/1.0
range:  npt=0.000-
session: 31692174
cseq: 4
status: 200
date: Sat, 15 Sep 2012 15:32:58 GMT
uri: RTSP/1.0 200 OK
rtp-info: url=rtsp://192.168.99.138:554/audio0;seq=13210;rtptime=1960819853,url=rtsp://192.168.99.138:554/video0;seq=60462;rtptime=380338249

Have you tried adding the MediaCaster Property “rtspFilterUnknownTracks” from the trouble-shooting section of the IP camera tutorial?

Richard

Thank you for your response. I wasn’t aware of that option. Did try but got same result. So, I decided to replace the camera’s IP address for the proxy address in all messages… still nothing. Now the logs show something like this:

2012-09-17	23:10:09	COT	comment	server	DEBUG	200	-	*** RTSPMessageSend ***
DESCRIBE rtsp://192.168.99.2:5554/live/av0?user=admin&passwd=admin RTSP/1.0
CSeq: 1
Accept: application/sdp
	-	-	-	545.446	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:10	COT	comment	server	DEBUG	200	-	*** RTSPMessageReceive ***
RTSP/1.0 200 OK
content-type: application/sdp
response: OK
protocol: RTSP/1.0
cseq: 1
status: 200
content-length: 411
x-accept-dynamic-rate: 1
content-language: en
date: Mon, 17 Sep 2012 04:19:30 GMT
uri: RTSP/1.0 200 OK
	-	-	-	546.08	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:10	COT	comment	server	DEBUG	200	-	RTPSessionDescriptionDataProviderBasicRTSPWorker.processResponse: command:DESCRIBE response:RTSP/1.0 200 OK status:200 handled:false	-	-	-	546.081	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:10	COT	comment	server	DEBUG	200	-	v=0
o=- 41592198 782967157  IN IP4 192.168.99.138
s=live
c=IN IP4 0.0.0.0
t=0 0
a=control:*
m=audio 0 RTP/AVP 8
a=control:rtsp://192.168.99.2:5554/audio0
m=video 0 RTP/AVP 96
b=AS:2058
a=rtpmap:96 H264/90000
a=range:npt=0-
a=fmtp:96 profile-level-id=42001e;packetization-mode=1;sprop-parameter-sets=Z0IAHukBQHt/4AAAAwAcSABt3QAM3+YA2IEJQA==,aM4xUg==
a=control:rtsp://192.168.99.2:5554/video0
2012-09-17	23:10:10	COT	comment	server	DEBUG	200	-	*** RTSPMessageSend ***
SETUP rtsp://192.168.99.2:5554/audio0 RTSP/1.0
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
CSeq: 2
	-	-	-	546.083	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:10	COT	comment	server	DEBUG	200	-	*** RTSPMessageReceive ***
RTSP/1.0 200 OK
cache-control: no-cache
response: OK
protocol: RTSP/1.0
session: 41592198
transport: RTP/AVP/TCP;interleaved=0-1;ssrc=1348806730
cseq: 2
status: 200
date: Mon, 17 Sep 2012 04:19:30 GMT
uri: RTSP/1.0 200 OK
	-	-	-	546.1	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:10	COT	comment	server	DEBUG	200	-	*** RTSPMessageSend ***
SETUP rtsp://192.168.99.2:5554/video0 RTSP/1.0
Session: 41592198
Transport: RTP/AVP/TCP;unicast;interleaved=2-3
CSeq: 3
User-Agent: Wowza Media Server Pro (Wowza Media Server 2 Perpetual 2.2.4 build27452)
	-	-	-	546.102	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:10	COT	comment	server	DEBUG	200	-	*** RTSPMessageReceive ***
RTSP/1.0 200 OK
cache-control: no-cache
response: OK
protocol: RTSP/1.0
session: 41592198
transport: RTP/AVP/TCP;interleaved=2-3;ssrc=1348806730
cseq: 3
status: 200
date: Mon, 17 Sep 2012 04:19:30 GMT
uri: RTSP/1.0 200 OK
	-	-	-	546.128	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:10	COT	comment	server	DEBUG	200	-	RTPSessionDescriptionDataProviderBasicRTSPWorker.processResponse: command:SETUP response:RTSP/1.0 200 OK status:200 handled:false	-	-	-	546.128	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:10	COT	comment	server	DEBUG	200	-	v=0
o=- 41592198 782967157  IN IP4 192.168.99.138
s=live
t=0 0
a=control:*
m=audio 0 RTP/AVP 8
a=ssrc:82820753200 stream
a=proto:RTP/AVP/TCP;interleaved=0-1
a=control:rtsp://192.168.99.2:5554/audio0
m=video 0 RTP/AVP 96
a=ssrc:82820753200 stream
a=proto:RTP/AVP/TCP;interleaved=2-3
b=AS:2058
a=rtpmap:96 H264/90000
a=range:npt=0-
a=fmtp:96 profile-level-id=42001e;packetization-mode=1;sprop-parameter-sets=Z0IAHukBQHt/4AAAAwAcSABt3QAM3+YA2IEJQA==,aM4xUg==
a=control:rtsp://192.168.99.2:5554/video0
	-	-	-	546.129	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:10	COT	comment	server	DEBUG	200	-	*** RTSPMessageSend ***
PLAY rtsp://192.168.99.2:5554/live/av0?user=admin&passwd=admin RTSP/1.0
Session: 41592198
CSeq: 4
Range: npt=0.000-
	-	-	-	546.216	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:11	COT	comment	server	DEBUG	200	-	*** RTSPMessageReceive ***
RTSP/1.0 200 OK
response: OK
protocol: RTSP/1.0
range:  npt=0.000-
session: 41592198
cseq: 4
status: 200
date: Mon, 17 Sep 2012 04:19:30 GMT
uri: RTSP/1.0 200 OK
rtp-info: url=rtsp://192.168.99.2:5554/audio0;seq=7435;rtptime=1693459270,url=rtsp://192.168.99.2:5554/video0;seq=1564;rtptime=77013016
	-	-	-	546.781	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:11	COT	comment	server	DEBUG	200	-	RTPSessionDescriptionDataProviderBasicRTSPWorker.processResponse: command:PLAY response:RTSP/1.0 200 OK status:200 handled:false	-	-	-	546.782	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:11	COT	comment	server	DEBUG	200	-	send[688589598]: size:0:0 filter:7 time:251 tOffset:0 rwrt:true	-	-	-	546.831	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:11	COT	comment	server	DEBUG	200	-	send[688589598]: size:0:0 filter:7 time:252 tOffset:0 rwrt:true	-	-	-	547.083	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:11	COT	comment	server	DEBUG	200	-	send[688589598]: size:0:0 filter:7 time:251 tOffset:0 rwrt:true	-	-	-	547.334	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
A lot more of the same...!
2012-09-17	23:10:22	COT	comment	server	DEBUG	200	-	send[688589598]: size:0:0 filter:7 time:252 tOffset:0 rwrt:true	-	-	-	557.763	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:22	COT	comment	server	DEBUG	200	-	send[688589598]: size:0:0 filter:7 time:273 tOffset:0 rwrt:true	-	-	-	558.036	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:22	COT	comment	server	DEBUG	200	-	send[688589598]: size:0:0 filter:7 time:251 tOffset:0 rwrt:true	-	-	-	558.287	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:22	COT	comment	server	INFO	200	-	RTPMediaCaster.streamTimeout[1124034138:rtplive/_definst_:31.stream]: timeout:12000 diff:12037 reason:101	-	-	-	558.363	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:22	COT	comment	server	INFO	200	-	RTPMediaCaster.resetConnection[1124034138:rtplive/_definst_:31.stream]: 	-	-	-	558.363	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:22	COT	comment	server	INFO	200	-	RTPMediaCaster.closeRTPSession[1124034138:rtplive/_definst_:31.stream]	-	-	-	558.363	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-09-17	23:10:22	COT	comment	server	DEBUG	200	-	*** RTSPMessageSend ***
TEARDOWN rtsp://192.168.99.2:5554/live/av0?user=admin&passwd=admin RTSP/1.0
Session: 41592198
CSeq: 5
	-	-	-	558.363	-	-	

And tries to play again, and again. This is the media caster config:

		<MediaCaster>
			<RTP>
				<RTSP>
					<!-- udp, interleave -->
					<RTPTransportMode>interleave</RTPTransportMode>
				</RTSP>
			</RTP>
			<!-- Properties defined here will override any properties defined in conf/MediaCasters.xml for any MediaCasters loaded by this applications -->
			<Properties>
			  <Property>
				    <Name>forceInterleaved</Name>
				    <Value>true</Value>
				    <Type>Boolean</Type>
				</Property>
			</Properties>
		</MediaCaster>

The “proxy” works fine using udp or tcp transport with ffplay, mplayer or vlc… I don’t understand why doesn’t works with wowza… I’m missing something here ?