Привет!
Столкнулся с проблемой. Есть у меня одна хорошая IP-cam для наблюдения(AXIS). Пытаюсь прикрутить ее к Zoneminder-у. Хочу, чтобы все работало по RTSP, ну а на праке конечно не работает =))
Из Debug лога Zoneminder-a видно:
ZM послылает DISCRIBE запрос (Интерисуется возможностями самой камеры):
[Sending RTSP message: DESCRIBE rtsp://19.111.121.81:554/axis-media/media.amp RTSP/1.0
Authorization: Basic cm9vdDoxMjM0NTZ0VA==
User-Agent: ZoneMinder/1.24.3
CSeq: 1
Получает ответ от камеры
[Received RTSP response: RTSP/1.0 200 OK
CSeq: 1
Content-Type: application/sdp
Content-Base: rtsp://19.111.121.81:554/axis-media/media.amp/
Date: Tue, 24 Jan 2012 16:36:02 GMT
Content-Length: 378
v=0
o=- 1327422962029028 1327422962029028 IN IP4 19.111.121.81
s=Media Presentation
e=NONE
c=IN IP4 0.0.0.0
b=AS:50000
t=0 0
a=control:*
a=range:npt=0.000000-
m=video 0 RTP/AVP 96
b=AS:50000
a=framerate:24.0
a=control:trackID=1
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; profile-level-id=420029; sprop-parameter-sets=Z0IAKeKQFAe2AtwEBAaQeJEV,aM48gA==
(557 bytes)]
01/24/12 04:30:55.811740 zmc_m2[3304].DB1-zm_rtsp.cpp/304 [Processing SDP 'v=0
o=- 1327422962029028 1327422962029028 IN IP4 19.111.121.81
s=Media Presentation
e=NONE
c=IN IP4 0.0.0.0
b=AS:50000
t=0 0
a=control:*
a=range:npt=0.000000-
m=video 0 RTP/AVP 96
b=AS:50000
a=framerate:24.0
a=control:trackID=1
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; profile-level-id=420029; sprop-parameter-sets=Z0IAKeKQFAe2AtwEBAaQeJEV,aM48gA==
']
Формируем SDP:
01/24/12 04:30:55.811795 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'v=0']
01/24/12 04:30:55.811820 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'o=- 1327422962029028 1327422962029028 IN IP4 19.111.121.81']
01/24/12 04:30:55.811844 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 's=Media Presentation']
01/24/12 04:30:55.811864 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'e=NONE']
01/24/12 04:30:55.811883 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'c=IN IP4 0.0.0.0']
01/24/12 04:30:55.811912 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'b=AS:50000']
01/24/12 04:30:55.811936 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 't=0 0']
01/24/12 04:30:55.811955 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=control:*']
01/24/12 04:30:55.811977 zmc_m2[3304].DB3-zm_sdp.cpp/259 [Ignoring general SDP attribute 'control:*']
01/24/12 04:30:55.811996 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=range:npt=0.000000-']
01/24/12 04:30:55.812018 zmc_m2[3304].DB3-zm_sdp.cpp/259 [Ignoring general SDP attribute 'range:npt=0.000000-']
01/24/12 04:30:55.812037 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'm=video 0 RTP/AVP 96']
01/24/12 04:30:55.812063 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'b=AS:50000']
01/24/12 04:30:55.812085 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=framerate:24.0']
01/24/12 04:30:55.812109 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=control:trackID=1']
01/24/12 04:30:55.812131 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=rtpmap:96 H264/90000']
01/24/12 04:30:55.812158 zmc_m2[3304].DB3-zm_sdp.cpp/126 [Processing SDP line 'a=fmtp:96 packetization-mode=1; profile-level-id=420029; sprop-parameter-sets=Z0IAKeKQFAe2AtwEBAaQeJEV,aM48gA==']
01/24/12 04:30:55.812189 zmc_m2[3304].DB3-zm_sdp.cpp/239 [Ignoring SDP fmtp attribute 'packetization-mode' for media 'video']
01/24/12 04:30:55.812213 zmc_m2[3304].DB3-zm_sdp.cpp/239 [Ignoring SDP fmtp attribute 'sprop-parameter-sets' for media 'video']
01/24/12 04:30:55.812947 zmc_m2[3304].DB1-zm_sdp.cpp/300 [Looking for codec for video payload type 96 / H264]
01/24/12 04:30:55.812975 zmc_m2[3304].DB1-zm_sdp.cpp/329 [Got dynamic payload type 96, H264]
Высылаем SETUP запрос:
01/24/12 04:30:55.813008 zmc_m2[3304].DB2-zm_rtsp.cpp/46 [Sending RTSP message: SETUP rtsp://89.111.181.82:554/axis-media/media.amp/trackID=1 RTSP/1.0
Transport: RTP/AVP/TCP;unicast
Authorization: Basic cm9vdDoxMjM0NTZ0VA==
User-Agent: ZoneMinder/1.24.3
CSeq: 2
Получаем ответ от камеры о готовности PLAY
01/24/12 04:30:56.031414 zmc_m2[3304].DB2-zm_rtsp.cpp/72 [Received RTSP response: RTSP/1.0 200 OK
CSeq: 2
Session: A5B8E3A3; timeout=60
Transport: RTP/AVP/TCP;unicast;interleaved=0-1;ssrc=D22602E4;mode="PLAY"
Date: Tue, 24 Jan 2012 16:36:03 GMT
Формируем запрос с камере:
01/24/12 04:30:56.031537 zmc_m2[3304].DB2-zm_rtsp.cpp/396 [Got RTSP session A5B8E3A3, timeout 60 secs]
01/24/12 04:30:56.031555 zmc_m2[3304].DB2-zm_rtsp.cpp/401 [Got RTSP transport RTP/AVP/TCP;unicast;interleaved=0-1;ssrc=D22602E4;mode="PLAY"]
01/24/12 04:30:56.031602 zmc_m2[3304].DB2-zm_rtsp.cpp/449 [RTSP Method is RTP/RTSP]
01/24/12 04:30:56.031616 zmc_m2[3304].DB2-zm_rtsp.cpp/450 [RTSP Distribution is unicast]
01/24/12 04:30:56.031629 zmc_m2[3304].DB2-zm_rtsp.cpp/451 [RTSP SSRC is d22602e4]
01/24/12 04:30:56.031641 zmc_m2[3304].DB2-zm_rtsp.cpp/452 [RTSP Local Host is ]
01/24/12 04:30:56.031653 zmc_m2[3304].DB2-zm_rtsp.cpp/453 [RTSP Local Ports are 0/0]
01/24/12 04:30:56.031666 zmc_m2[3304].DB2-zm_rtsp.cpp/454 [RTSP Remote Ports are 0/0]
01/24/12 04:30:56.031678 zmc_m2[3304].DB2-zm_rtsp.cpp/455 [RTSP Remote Channels are 0/1]
01/24/12 04:30:56.031697 zmc_m2[3304].DB2-zm_rtsp.cpp/46 [Sending RTSP message: PLAY rtsp://8.8.18.82:554/axis-media/media.amp RTSP/1.0
Session: A5B8E3A3
Range: npt=0.000-
Authorization: Basic cm9vdDoxMjM0NTZ0VA==
User-Agent: ZoneMinder/1.24.3
CSeq: 3
Далее стедует вот такой кусок лога, много одинаковых строк с закономерной посделовательностью. Если я не ошибюсь, тут идет процесс буферизации и накопления кадров.
01/24/12 04:30:56.231082 zmc_m2[3304].DB2-zm_rtsp.cpp/473 [Got RTP Info url=rtsp://8.111.1.82:554/axis-media/media.amp/trackID=1;seq=29504;rtptime=366806580]
01/24/12 04:30:56.231125 zmc_m2[3304].DB2-zm_rtsp.cpp/492 [RTSP Seq is 29504]
01/24/12 04:30:56.231145 zmc_m2[3304].DB2-zm_rtsp.cpp/493 [RTSP Rtptime is 366806580]
01/24/12 04:30:56.231199 zmc_m2[3304].DB3-zm_rtp_source.cpp/43 [RTP CName = zm-2@webmaster-desktop]
01/24/12 04:30:56.231222 zmc_m2[3304].DB3-zm_rtp_source.cpp/68 [Initialising sequence]
01/24/12 04:30:56.231249 zmc_m2[3304].DB1-zm_thread.cpp/241 [Creating thread]
01/24/12 04:30:56.231269 zmc_m2[3304].DB1-zm_thread.cpp/241 [Creating thread]
01/24/12 04:30:56.276550 zmc_m2[3301].DB2-zm_remote_camera_rtsp.cpp/120 [Got sources]
01/24/12 04:30:56.276744 zmc_m2[3301].DB3-zm_rtp_source.cpp/312 [Getting frame]
01/24/12 04:30:56.276756 zmc_m2[3301].DB8-zm_thread.cpp/201 [Waiting for value update, 1 secs, 0xe1438ac]
01/24/12 04:30:56.276765 zmc_m2[3301].DB8-zm_thread.cpp/127 [Waiting for 1 seconds]
01/24/12 04:30:56.321600 zmc_m2[3304].DB4-zm_rtsp.cpp/569 [Read 1404 bytes on sd 4, 1404 total]
01/24/12 04:30:56.321630 zmc_m2[3304].DB4-zm_rtsp.cpp/578 [Got 1404 bytes left, expecting 1400 byte packet on channel 0]
01/24/12 04:30:56.321640 zmc_m2[3304].DB4-zm_rtsp.cpp/586 [Got 1404 bytes on data channel 0, packet length is 1400]
01/24/12 04:30:56.321648 zmc_m2[3304].DB4-zm_rtsp.cpp/587 [16: 24 00 05 78 80 60 73 40 15 dd 06 34 d2 26 02 e4]
01/24/12 04:30:56.321659 zmc_m2[3304].DB5-zm_rtp_data.cpp/44 [Ver: 2]
01/24/12 04:30:56.321667 zmc_m2[3304].DB5-zm_rtp_data.cpp/45 [P: 0]
01/24/12 04:30:56.321676 zmc_m2[3304].DB5-zm_rtp_data.cpp/46 [Pt: 96]
01/24/12 04:30:56.321684 zmc_m2[3304].DB5-zm_rtp_data.cpp/47 [Mk: 0]
01/24/12 04:30:56.321692 zmc_m2[3304].DB5-zm_rtp_data.cpp/48 [Seq: 29504]
01/24/12 04:30:56.321700 zmc_m2[3304].DB5-zm_rtp_data.cpp/49 [T/S: 15dd0634]
01/24/12 04:30:56.321709 zmc_m2[3304].DB5-zm_rtp_data.cpp/50 [SSRC: d22602e4]
01/24/12 04:30:56.321717 zmc_m2[3304].DB5-zm_rtp_source.cpp/87 [Seq: 29504]
01/24/12 04:30:56.321725 zmc_m2[3304].DB3-zm_rtp_source.cpp/94 [Sequence in probation 2, in sequence]
01/24/12 04:30:56.321734 zmc_m2[3304].DB4-zm_rtp_source.cpp/259 [16: 7c 85 88 84 00 01 3f 0e a2 ce 01 69 70 c0 00 13]
01/24/12 04:30:56.321744 zmc_m2[3304].DB4-zm_rtp_source.cpp/262 [16: 7c 85 88 84 00 01 3f 0e a2 ce 01 69 70 c0 00 13]
01/24/12 04:30:56.321755 zmc_m2[3304].DB5-zm_rtp_source.cpp/164 [Delta rtp = 0.090513]
01/24/12 04:30:56.321767 zmc_m2[3304].DB5-zm_rtp_source.cpp/166 [Local RTP time = 15dd2607]
01/24/12 04:30:56.321775 zmc_m2[3304].DB5-zm_rtp_source.cpp/167 [Packet RTP time = 15dd0634]
01/24/12 04:30:56.321783 zmc_m2[3304].DB5-zm_rtp_source.cpp/169 [Packet transit RTP time = 1fd3]
01/24/12 04:30:56.321819 zmc_m2[3304].DB5-zm_rtp_source.cpp/187 [RTP Jitter: 0]
01/24/12 04:30:56.321828 zmc_m2[3304].DB4-zm_rtsp.cpp/589 [Received]
После чего, начинают проскаивать такие сообщения, похоже на то, что, буферизированные кадры передаются обработчику для формирования картинки.
[Got 1827 bytes left, expecting 924 byte packet on channel 0]
01/24/12 04:31:08.281831 zmc_m2[3304].DB4-zm_rtsp.cpp/586 [Got 1827 bytes on data channel 0, packet length is 924]
01/24/12 04:31:08.281850 zmc_m2[3304].DB4-zm_rtsp.cpp/587 [16: 24 00 03 9c 80 e0 75 14 15 ec 11 bd d2 26 02 e4]
01/24/12 04:31:08.281872 zmc_m2[3304].DB5-zm_rtp_data.cpp/44 [Ver: 2]
01/24/12 04:31:08.281890 zmc_m2[3304].DB5-zm_rtp_data.cpp/45 [P: 0]
01/24/12 04:31:08.281927 zmc_m2[3304].DB5-zm_rtp_data.cpp/46 [Pt: 96]
01/24/12 04:31:08.281948 zmc_m2[3304].DB5-zm_rtp_data.cpp/47 [Mk: 1]
01/24/12 04:31:08.281966 zmc_m2[3304].DB5-zm_rtp_data.cpp/48 [Seq: 29972]
01/24/12 04:31:08.281984 zmc_m2[3304].DB5-zm_rtp_data.cpp/49 [T/S: 15ec11bd]
01/24/12 04:31:08.282002 zmc_m2[3304].DB5-zm_rtp_data.cpp/50 [SSRC: d22602e4]
01/24/12 04:31:08.282020 zmc_m2[3304].DB5-zm_rtp_source.cpp/87 [Seq: 29972]
01/24/12 04:31:08.282038 zmc_m2[3304].DB3-zm_rtp_source.cpp/117 [Packet in sequence, gap 1]
01/24/12 04:31:08.282055 zmc_m2[3304].DB4-zm_rtp_source.cpp/259 [16: 41 9a 20 02 02 39 31 5e 27 a4 6f 77 dd 7e ca 08]
01/24/12 04:31:08.282078 zmc_m2[3304].DB4-zm_rtp_source.cpp/262 [16: 41 9a 20 02 02 39 31 5e 27 a4 6f 77 dd 7e ca 08]
01/24/12 04:31:08.282100 zmc_m2[3304].DB2-zm_rtp_source.cpp/268 [Got new frame 1, 912 bytes]
01/24/12 04:31:08.282118 zmc_m2[3304].DB8-zm_thread.cpp/215 [Updating value with signal, 0xe1438ac]
01/24/12 04:31:08.282152 zmc_m2[3301].DB9-zm_thread.cpp/209 [Got value update, 0xe1438ac]
01/24/12 04:31:08.282172 zmc_m2[3301].DB8-zm_thread.cpp/215 [Updating value with [h264 @ 0xe143380] no frame!
signal, 0xe1438fc]
01/24/12 04:31:08.282209 zmc_m2[3301].DB9-zm_thread.cpp/221 [Updated value, 0xe1438fc]
01/24/12 04:31:08.282229 zmc_m2[3301].DB3-zm_rtp_source.cpp/323 [Copied 912 bytes]
01/24/12 04:31:08.282248 zmc_m2[3301].DB3-zm_remote_camera_rtsp.cpp/175 [Read frame 912 bytes]
01/24/12 04:31:08.282266 zmc_m2[3301].DB4-zm_remote_camera_rtsp.cpp/176 [Address 0xb77f2008]
01/24/12 04:31:08.282284 zmc_m2[3301].DB4-zm_remote_camera_rtsp.cpp/177 [16: 41 9a 20 02 02 39 31 5e 27 a4 6f 77 dd 7e ca 08]
01/24/12 04:31:08.282320 zmc_m2[3301].ERR-zm_remote_camera_rtsp.cpp/220 [Error while decoding frame 0]
01/24/12 04:31:08.282423 zmc_m2[3301].ERR-zm_remote_camera_rtsp.cpp/221 [256: 41 9a 20 02 02 39 31 5e 27 a4 6f 77 dd 7e ca 08 75 dd 71 1e 26 4b f2 f2 68 7e 31 c4 44 6e 45 ca a2 7b ef 56 33 9c 7f b5 ee 73 f6 c9 df e4 f7 e2 3b 10 6e f5 20 be 20 6a f5 72 5f f9 7d 35 cf 5e df f9 af c5 46 62 39 bd cf 60 92 4e ef ba b2 1b 9f dc df 82 6f 7d d8 db e7 ad 17 e3 79 eb db f7 d7 28 9e 6f 7f 11 d3 a0 7d d8 cf 1d 15 df 79 38 af 4a 54 51 b3 88 de 5f 71 96 27 cb 1d c3 50 11 a4 c8 e9 63 75 9b ed fa ce 35 f8 8e ac 8a e7 af db df 27 b0 b4 4f 84 bd 75 f2 79 4b 5f b2 76 43 57 be 5a f5 c9 d3 67 e0 87 ae be af
Все, далее как только очередная порция забуфиризируется, ошибка повторяется.
А теперь вопрос, каким образом можно исправить сутуацию. Как отловить, что именно не дает нормально декодировать собранные фрагмены. Почему собранные пакеты не получается обработать.
Буду благодарен за любые советы по этому направлению...