Launch IP camera not working over RTSP

Forum for questions and support relating to the 1.24.x releases only.
Locked
doi
Posts: 6
Joined: Fri Sep 16, 2011 1:20 pm

Launch IP camera not working over RTSP

Post by doi »

Hi all,

I am using ZM 1.24.2 on a Turnkey LAMP (Ubuntu 10.04) box and trying unsuccessfully to configure it for a Launch LC-5201A3-SAR IP camera, which should stream RTSP at a resolution of 704 x 576, mjpeg or h.264 (tried both).

ZM works well otherwise with USB cameras.

i am using the following settings for the source:
Remote Protocol RTSP
Remote Method RTP/RTSP
Remote Host Name 192.168.0.19
Remote Host Port 554
Remote Host Path /0/1:1/sub
Remote Image Colours 24bit
Capture Width (pixels) 704
Capture Height (pixels) 576

which are taken from the camera's user manual that states:
The RTSP address is: rtsp:// 192.168.1.19:554/0/1:1/main, formed as below:
192.168.1.19: IP address of the IP device
554: RTSP listen port
0: Default port, cannot be changed
1:1: Common User name & password,
Please refer to:1.3.3.1.3 User Management
main: Main streaming,
In summary, the RTSP streaming is for main streaming of the
rtsp: //192.168.1.19:554/0/1:1/main. If you want to view sub streaming or third
streaming RTSP, please follow the below format to visit.
Sub streaming: rtsp: //192.168.1.19:554/0/1:1/sub
The third streaming: rtsp: //192.168.1.19:554/0/1:1/2sub
When applying all settings the link colour in the console turns green with record enabled and after a time turns red. Of course ZM does not stream or record anything.

the following can be found in zm_debug.log.*

Code: Select all

09/20/11 11:44:34.308983 zmc_m6[2139].INF-zm_debug.c/292 [New Debug Level = 5, New Debug Log = /tmp/zm_debug.log.02139]
09/20/11 11:44:34.311785 zmc_m6[2139].DB1-zm_monitor.cpp/2262 [Got 1 monitors]
09/20/11 11:44:34.329139 zmc_m6[2139].DB1-zm_thread.cpp/241 [Creating thread]
09/20/11 11:44:34.329272 zmc_m6[2139].DB2-zm_rtsp.cpp/187 [RTSP Local SSRC is 317b672b]
09/20/11 11:44:34.329302 zmc_m6[2139].DB1-zm_thread.cpp/280 [Starting thread]
09/20/11 11:44:34.335443 zmc_m6[2140].DB2-zm_thread.cpp/253 [Invoking thread]
09/20/11 11:44:34.335578 zmc_m6[2139].DB1-zm_thread.cpp/301 [Started thread 2140]
09/20/11 11:44:34.344159 zmc_m6[2140].DB2-zm_rtsp.cpp/46 [Sending RTSP message: DESCRIBE rtsp://192.168.0.19:554/0/1:1/sub RTSP/1.0
User-Agent: ZoneMinder/1.24.2
CSeq: 1

]
09/20/11 11:44:34.358836 zmc_m6[2139].DB1-zm_monitor.cpp/338 [monitor purpose=1]
09/20/11 11:44:34.358928 zmc_m6[2139].DB1-zm_monitor.cpp/345 [mem.size=12166072]
09/20/11 11:44:34.465529 zmc_m6[2139].DB1-zm_zone.cpp/50 [Initialised zone 0/All - 1 - 704x576 - Rgb:ff0000, CM:3, MnAT:15, MxAT:0, MnAP:50, MxAP:75000, FB:3x3, MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0, OF: 0]
09/20/11 11:44:34.613426 zmc_m6[2139].DB1-zm_monitor.cpp/458 [Monitor cam_3_launch has function 4]
09/20/11 11:44:34.613503 zmc_m6[2139].DB1-zm_monitor.cpp/459 [Monitor cam_3_launch LBF = '%N - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
09/20/11 11:44:34.613540 zmc_m6[2139].DB1-zm_monitor.cpp/460 [Monitor cam_3_launch IBC = 10, WUC = 5, pEC = 10, PEC = 10, EAF = 1, FRI = 1000, RBP = 5, FM = 0]
09/20/11 11:44:34.615603 zmc_m6[2139].DB1-zm_zone.cpp/889 [Got 1 zones for monitor cam_3_launch]
09/20/11 11:44:34.615681 zmc_m6[2139].DB5-zm_zone.cpp/918 [Parsing polygon 0,0 703,0 703,575 0,575]
09/20/11 11:44:34.615706 zmc_m6[2139].DB3-zm_zone.cpp/758 [Parsing polygon string '0,0 703,0 703,575 0,575']
09/20/11 11:44:34.615732 zmc_m6[2139].DB3-zm_zone.cpp/796 [Got coordinate 0,0 from polygon string]
09/20/11 11:44:34.615756 zmc_m6[2139].DB3-zm_zone.cpp/796 [Got coordinate 703,0 from polygon string]
09/20/11 11:44:34.615778 zmc_m6[2139].DB3-zm_zone.cpp/796 [Got coordinate 703,575 from polygon string]
09/20/11 11:44:34.615801 zmc_m6[2139].DB3-zm_zone.cpp/796 [Got coordinate 0,575 from polygon string]
09/20/11 11:44:34.615833 zmc_m6[2139].DB3-zm_zone.cpp/816 [Successfully parsed polygon string]
09/20/11 11:44:34.615862 zmc_m6[2139].DB1-zm_zone.cpp/50 [Initialised zone 6/All - 1 - 704x576 - Rgb:ff0000, CM:3, MnAT:25, MxAT:0, MnAP:12165, MxAP:304128, FB:3x3, MnFP:12165, MxFP:304128, MnBS:8110, MxBS:0, MnB:1, MxB:0, OF: 0]
09/20/11 11:44:34.759357 zmc_m6[2139].DB1-zm_monitor.cpp/2459 [Loaded monitor 6(cam_3_launch), 1 zones]
09/20/11 11:44:34.759459 zmc_m6[2139].INF-zmc.cpp/188 [Starting Capture]
09/20/11 11:44:34.763391 zmc_m6[2139].DB2-zm_remote_camera_rtsp.cpp/112 [Waiting for sources]
09/20/11 11:44:35.344491 zmc_m6[2140].DB2-zm_rtsp.cpp/72 [Received RTSP response: RTSP/1.0 200 OK
CSeq: 1
Server: rtsp server
Content-type: application/sdp
Content-base: rtsp://192.168.0.19:554/0/1:1/sub/
Content-length: 315

v=0
o=rtsp 1254922595 2237829591 IN IP4 0.0.0.0
s=RTSP Session
i=rtsp server
c=IN IP4 192.168.0.19
t=0 0
a=control:*
m=audio 0 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=range:npt=now-
a=control:trackID=0
m=video 0 RTP/AVP 26
a=rtpmap:26 JPEG/90000
a=range:npt=now-
a=framesize:26 704-576
a=control:trackID=1
 (466 bytes)]
09/20/11 11:44:35.344752 zmc_m6[2140].DB1-zm_rtsp.cpp/304 [Processing SDP 'v=0
o=rtsp 1254922595 2237829591 IN IP4 0.0.0.0
s=RTSP Session
i=rtsp server
c=IN IP4 192.168.0.19
t=0 0
a=control:*
m=audio 0 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=range:npt=now-
a=control:trackID=0
m=video 0 RTP/AVP 26
a=rtpmap:26 JPEG/90000
a=range:npt=now-
a=framesize:26 704-576
a=control:trackID=1
']
09/20/11 11:44:35.344848 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'v=0']
09/20/11 11:44:35.344882 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'o=rtsp 1254922595 2237829591 IN IP4 0.0.0.0']
09/20/11 11:44:35.344914 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 's=RTSP Session']
09/20/11 11:44:35.345120 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'i=rtsp server']
09/20/11 11:44:35.345148 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'c=IN IP4 192.168.0.19']
09/20/11 11:44:35.345197 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 't=0 0']
09/20/11 11:44:35.345222 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=control:*']
09/20/11 11:44:35.345257 zmc_m6[2140].DB3-zm_sdp.cpp/259 [Ignoring general SDP attribute 'control:*']
09/20/11 11:44:35.345282 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'm=audio 0 RTP/AVP 0']
09/20/11 11:44:35.345323 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=rtpmap:0 PCMU/8000']
09/20/11 11:44:35.345364 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=range:npt=now-']
09/20/11 11:44:35.345395 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=control:trackID=0']
09/20/11 11:44:35.345424 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'm=video 0 RTP/AVP 26']
09/20/11 11:44:35.345461 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=rtpmap:26 JPEG/90000']
09/20/11 11:44:35.345590 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=range:npt=now-']
09/20/11 11:44:35.345620 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=framesize:26 704-576']
09/20/11 11:44:35.345657 zmc_m6[2140].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=control:trackID=1']
09/20/11 11:44:35.346360 zmc_m6[2140].DB1-zm_sdp.cpp/305 [Looking for codec for audio payload type 0 / PCMU]
09/20/11 11:44:35.346582 zmc_m6[2140].DB1-zm_sdp.cpp/318 [Got static payload type 0, PCMU]
09/20/11 11:44:35.347195 zmc_m6[2140].DB1-zm_sdp.cpp/305 [Looking for codec for video payload type 26 / JPEG]
09/20/11 11:44:35.347220 zmc_m6[2140].DB1-zm_sdp.cpp/318 [Got static payload type 26, JPEG]
09/20/11 11:44:35.347263 zmc_m6[2140].DB2-zm_rtsp.cpp/46 [Sending RTSP message: SETUP rtsp://192.168.0.19:554/0/1:1/sub/trackID=1 RTSP/1.0
Transport: RTP/AVP/TCP;unicast
User-Agent: ZoneMinder/1.24.2
CSeq: 2

]
09/20/11 11:44:44.773667 zmc_m6[2139].FAT-zm_remote_camera_rtsp.cpp/118 [No RTSP sources]
09/20/11 11:44:44.774005 zmc_m6[2139].INF-zm_signal.cpp/64 [Got signal 6 (Aborted), exiting and forcing backtrace]
as far as I can see ZM starts talking to the camera and then something goes terribly wrong and it all stops. can anyone enlighten me on what the problem may be? any ideas?

of course, camera streams great to VLC or Totem.

happy to help with more info.

thanks,

Dan
Flasheart
Posts: 342
Joined: Thu Jul 06, 2006 2:27 pm

Re: Launch IP camera not working over RTSP

Post by Flasheart »

You don't mention that you've amended the shared memory as per the faq on the wiki.

That will need to be done before any pics > 320x240 will work.
doi
Posts: 6
Joined: Fri Sep 16, 2011 1:20 pm

Re: Launch IP camera not working over RTSP

Post by doi »

no worries, I have two other cameras working perfectly at 640x480 resolution.

I have the feeling that it's something about the streaming protocol.
Flasheart
Posts: 342
Joined: Thu Jul 06, 2006 2:27 pm

Re: Launch IP camera not working over RTSP

Post by Flasheart »

Ok - and I might be hanging onto this point a little too hard - but the shared mem settings you've done, and those in the wiki for 64x480 may not be sufficient for a megapixel cam

These are what I use and these do work for an Axis 1280x1024

kernel.shmall = 234217728
kernel.shmmax = 234217728
doi
Posts: 6
Joined: Fri Sep 16, 2011 1:20 pm

Re: Launch IP camera not working over RTSP

Post by doi »

I just modified sysctl.conf to your values and I get the same error.
Flasheart
Posts: 342
Joined: Thu Jul 06, 2006 2:27 pm

Re: Launch IP camera not working over RTSP

Post by Flasheart »

Ok. If you restarted after changing sysctl to those then it's not that.

Hopefully someone else will have another idea that's more productive.
doi
Posts: 6
Joined: Fri Sep 16, 2011 1:20 pm

Re: Launch IP camera not working over RTSP

Post by doi »

Yep, rebooted and still the same...
doi
Posts: 6
Joined: Fri Sep 16, 2011 1:20 pm

Re: Launch IP camera not working over RTSP

Post by doi »

anyone... anything....

*bump*
dondaniki
Posts: 1
Joined: Wed Nov 23, 2011 11:12 am

Re: Launch IP camera not working over RTSP

Post by dondaniki »

Hi all.

I have the same problem with the rtsp protocol. In my case I've founded a kind of bug or malfunction in the secuence of rtsp messages.

In my case this is the failure:

[Sending RTSP message: SETUP rtsp://192.168.101.141:554/live/rtsp://192.168.101.141/live:video:2 RTSP/1.0
Transport: RTP/AVP/TCP;unicast
User-Agent: ZoneMinder/1.24.2
CSeq: 2

]
Where the rtsp query has a malformed URL "rtsp://192.168.101.141:554/live/rtsp://192.168.101.141/live:video:2".

I Guess the bug, in version 1.24.2 is located in the file zm_rtsp.cpp, at line 340, where the "trackUrl" is concatenated twice.

Here is de code from zm_rtsp.cpp (1.24.2)

333 if ( mFormatContext->nb_streams >= 1 )
334 {
335 for ( int i = 0; i < mFormatContext->nb_streams; i++ )
336 {
337 SessionDescriptor::MediaDescriptor *mediaDesc = sessDesc->getStream( i );
338 if ( mFormatContext->streams->codec->codec_type == CODEC_TYPE_VIDEO )
339 {
340 trackUrl += "/"+mediaDesc->getControlUrl();
341 Debug( 1, "trackUrl '%s'", trackUrl.c_str() );
342 rtpClock = mediaDesc->getClock();
343 // Hackery pokery
344 //rtpClock = mFormatContext->streams->codec->sample_rate;
345 break;
346 }
347 }
348 }

After this code, the zoneminder send a rtsp-message "play" attaching a malformed URL, so nobody attends this request and after a while the cam rtsp server delivers to zoneminder a timeout message, closing the connection.


I've tried to recompile the project with some modifications, but the zoneminder doesn't work if I just replace old binaries by new ones.

I'm using ubuntu 10.04LTS and the zoneminder provided (1.24.2-2build3) but I'm trying to rebuild the sources (1.24.2) from zoneminder website and just replace the binaries. I'm pretty sure here is the main problem between versions.

I'll appreciate your help.

regards!!
Locked