Page 1 of 1

No recording?

Posted: Thu Apr 21, 2005 1:38 pm
by CraigGraham
I've got ZM 1.21 up and running and looking at a Dynamode network camera.

I've defined the monitor to pull jpeg files off the camera and set the mode to "record" with a section length of 10 seconds.

Looking at the "watch" window I can get static images, and I've turned the rate up to one per second to make it usable, but there are two problems

1) if I switch to "stream" then I get a blank screen. The status in either stream or still pictures is "Idle - 0.00 fps". The camera supports streaming from a dedicated port, but I gather the functionality isn't yet there to connect to the stream port on the camera.

2) Although the monitor's source and function fields are green, I am getting nothing recorded. As I understand it, I should be getting continuous 10 second segments and, I assume, the event counter incrementing every 10 seconds. Nothing's being written to the "images" directory (although the directory for the monitor itself has been created in there) and no events are being registered. Nothing's going into the event log that looks relevant- although I've had to turn all the buffer sizes down to 1 frame and keep getting "buffer overrun" errors. Surely it can work with 1 frame buffers?

The second thing seems like it should be a trivial setup problem- as if I have to arm something to enable recording, but I can't see anything. Can anyone help?

Posted: Thu Apr 21, 2005 9:15 pm
by zoneminder
Hi Craig,

Firstly I would suggest that setting a segment length of 10 seconds is probably not what your would want. It would result in a new event every 10 seconds so you'd get a lot of events and it would be hard to find the one you might want. The section length setting is intended to break up events that otherwise might span hours really.

You other problem is with the streaming, have your gone through the steps in the troubleshooting section of the README? If so what have you found in the logs?

Phil

Posted: Thu Apr 21, 2005 10:24 pm
by CraigGraham
zoneminder wrote:Hi Craig,

Firstly I would suggest that setting a segment length of 10 seconds is probably not what your would want. It would result in a new event every 10 seconds so you'd get a lot of events and it would be hard to find the one you might want. The section length setting is intended to break up events that otherwise might span hours really.
Yeah- I deliberately wanted loads of segments recorded one after the other so I could tell whether ir not it was working! I figured if they only showed up after completion of the segment, 10 seconds is a lot quicker than the default 5 or 10 minutes :)

In the past few hours in which I've left it on record, this is all that's shown up;

4 New Event Street Continuous 04/21 22:36:32 0.00
3 Event-3 Street Continuous 04/21 22:35:56 36.48 2
2 Event-2 Street Continuous 04/21 16:29:43 180.42 2
1 Event-1 Street Continuous 04/21 16:16:27 796.16 2

I've deleted the columns to the right of "frames" because they're all zero anyway. Note the long times and the fact only two frames are recorded. The frames really are there and can be viewed.

You other problem is with the streaming, have your gone through the steps in the troubleshooting section of the README? If so what have you found in the logs?

Phil
I'm having trouble turning logging on!

I've set and exported the two variables listed. The output from the "set" command shows;

ZM_DBG_LEVEL_zmc=-10
ZM_DBG_PRINT=1

Yet when I try typing "zmc -m 2" in the same shell, it gives no output even though the program runs (doesn't return until I CTRL-C) and writes a few "ERR [Select timed out]" messages to the log. The timings of the messages vary from 2s to 15s apart so I guess these are just wireless dropouts- I do see the clock sometimes skip a second when monitoring the still images. So at this stage, I even need help to get the debug working :)

The stream thing may be related to another thread which I've not dug into yet- the log is full of "Apr 21 23:09:13 splosh zms[12332]: ERR [Unable to authenticate user]" messages. I'm using auth and I'm logging in fine. This may be what's killing streaming, but since I can see the single frame images and can't record, it may be easier to work on that first otherwise there's too many things going on at once.

Posted: Mon Apr 25, 2005 12:49 pm
by zoneminder
I'm not really sure I can work out what is going on yet, but one thing I would mention is that using negative numbers for the debug level will turn off debug. You want to set it to a higher number to getmore debug but anything important should generate an ERR anyway, either in /var/log/messages or, in some distros, a different file in /var/log.

Phil

Posted: Tue Apr 26, 2005 6:12 am
by CraigGraham
Ah, that would explain the lack of debug. I'm away for the week on a network that doesn't do SSH so I don't really want to be playing around as root for the moment on that machine, but one bit of info to add is that I've turned off authentication and the authentication errors are no longer flooding the log, so it may be unrelated to a previous problem people have had with authentication failures. The behaviour with streaming and recording hasn't changed though.

Posted: Tue May 03, 2005 6:28 pm
by CraigGraham
I'm back and have some debug stuff. This is running as described above but now specifying +10 instead of -10 as the debug level :) It looks to me like it's never getting anything back from the camera, even though I can see a pseudo-live feed it I set the monitor to "stills". The log carries on with the connected-request-timeout cycle for as long as I leave it. Any suggestions?

Edit;

More debug after seeing someone's comment about increasing the HTTP timeout (was 2.5s, now 10s- suprising 2.5s is too short!). Now I get the same failure to stream images, but the debug info is;

05/03/05 19:35:18.648829 zmc_m2[8302].INF-zm_debug.c/219 [Debug Level = 254, Debug Log = <none>]
05/03/05 19:35:18.657447 zmc_m2[8302].DB1-zm_monitor.cpp/1180 [Got 1 monitors]
05/03/05 19:35:18.664323 zmc_m2[8302].DB2-zm_remote_camera.cpp/120 [Request: GET IMAGE.JPG HTTP/1.1
User-Agent: ZoneMinder/1.21.0
Host: 10.1.1.170
Connection: Keep-Alive
Authorization: Basic (edited)==

]
05/03/05 19:35:18.664857 zmc_m2[8302].DB1-zm_monitor.cpp/233 [monitor purpose=1]
05/03/05 19:35:18.665040 zmc_m2[8302].DB1-zm_monitor.cpp/236 [shm.size=921960]
05/03/05 19:35:18.668129 zmc_m2[8302].DB1-zm_zone.cpp/56 [Initialised zone 0/All - 1 - 640x480 - 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]
05/03/05 19:35:18.668800 zmc_m2[8302].DB1-zm_monitor.cpp/299 [Monitor Street has function 4]
05/03/05 19:35:18.669077 zmc_m2[8302].DB1-zm_monitor.cpp/300 [Monitor Street LBF = '%%s - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
05/03/05 19:35:18.669228 zmc_m2[8302].DB1-zm_monitor.cpp/301 [Monitor Street IBC = 1, WUC = 5, pEC = 1, PEC = 100, EAF = 16, FRI = 1000, RBP = 10, FM = 0]
05/03/05 19:35:18.670682 zmc_m2[8302].DB1-zm_zone.cpp/520 [Got 1 zones for monitor Street]
05/03/05 19:35:18.671034 zmc_m2[8302].DB1-zm_zone.cpp/56 [Initialised zone 2/All - 1 - 640x480 - Rgb:ff0000, CM:3, MnAT:25, MxAT:0, MnAP:9216, MxAP:230400, FB:3x3, MnFP:9216, MxFP:230400, MnBS:6144, MxBS:0, MnB:1, MxB:0]
05/03/05 19:35:18.671243 zmc_m2[8302].DB1-zm_monitor.cpp/1259 [Loaded monitor 2(Street), 1 zones]
05/03/05 19:35:18.671370 zmc_m2[8302].INF-zmc.cpp/175 [Starting Capture]
05/03/05 19:35:18.676422 zmc_m2[8302].DB3-zm_remote_camera.cpp/154 [Connected to host, socket = 5]
05/03/05 19:35:18.676803 zmc_m2[8302].DB3-zm_remote_camera.cpp/174 [Request sent]
05/03/05 19:35:20.247617 zmc_m2[8302].DB3-zm_remote_camera.cpp/204 [Expecting 160 bytes]
05/03/05 19:35:20.247815 zmc_m2[8302].DB3-zm_remote_camera.cpp/230 [Read 160 bytes]
05/03/05 19:35:20.248021 zmc_m2[8302].DB4-zm_remote_camera.cpp/280 [Captured header (160 bytes):
'HTTP/1.0 200 OK

Server: Camera Web Server/1.0

Auther: Steven Wu

MIME-version: 1.0

Cache-Control: no-cache

Content-Type:image/jpeg

Content-Length:31776



']
05/03/05 19:35:20.248120 zmc_m2[8302].DB3-zm_remote_camera.cpp/298 [Got status '200' (OK), http version 1.0]
05/03/05 19:35:20.248201 zmc_m2[8302].DB3-zm_remote_camera.cpp/313 [Got content length '31776']
05/03/05 19:35:20.248313 zmc_m2[8302].DB3-zm_remote_camera.cpp/321 [Got content type 'image/jpeg'
]
05/03/05 19:35:20.259801 zmc_m2[8302].DB3-zm_remote_camera.cpp/204 [Expecting 1460 bytes]

(...lots of little bits downloaded...)

05/03/05 19:35:20.361262 zmc_m2[8302].DB3-zm_remote_camera.cpp/204 [Expecting 1118 bytes]
05/03/05 19:35:20.361329 zmc_m2[8302].DB3-zm_remote_camera.cpp/230 [Read 1118 bytes]
05/03/05 19:35:20.361381 zmc_m2[8302].DB3-zm_remote_camera.cpp/430 [Got end of image by length, content-length = 31776]
05/03/05 19:35:20.361529 zmc_m2[8302].DB3-zm_remote_camera.cpp/487 [Returning 31776 (31778) bytes of captured content]
05/03/05 19:35:20.405406 zmc_m2[8302].WAR-zm_monitor.h/263 [Buffer overrun at index 0
]
05/03/05 19:35:20.416900 zmc_m2[8302].DB3-zm_remote_camera.cpp/154 [Connected to host, socket = 5]
05/03/05 19:35:20.417327 zmc_m2[8302].DB3-zm_remote_camera.cpp/174 [Request sent]
05/03/05 19:35:23.412380 zmc_m2[8302].DB3-zm_remote_camera.cpp/204 [Expecting 160 bytes]
05/03/05 19:35:23.412543 zmc_m2[8302].DB3-zm_remote_camera.cpp/230 [Read 160 bytes]
05/03/05 19:35:23.412668 zmc_m2[8302].DB4-zm_remote_camera.cpp/280 [Captured header (160 bytes):
'HTTP/1.0 200 OK

Server: Camera Web Server/1.0

Auther: Steven Wu

MIME-version: 1.0

Cache-Control: no-cache

Content-Type:image/jpeg

Content-Length:31754


And so on

So it seems the data's coming in. Is the buffer overrun the problem?

Posted: Wed May 04, 2005 12:18 am
by zoneminder
Possibly, how big is your ring buffer? And your pre-event and warmup counts?

Phil

Posted: Wed May 04, 2005 7:04 am
by CraigGraham
zoneminder wrote:Possibly, how big is your ring buffer? And your pre-event and warmup counts?

Phil
All set to 1. Otherwise I get messages in the log about being unable to allocate shared memory, even though I've increased the values to silly levels;

[root@splosh proc]# cat /proc/sys/kernel/shmmax
468435456
[root@splosh proc]# cat /proc/sys/kernel/shmall
204857600

Posted: Wed May 04, 2005 9:25 am
by zoneminder
1 won't work, I think you'd need probably 10 as a minimum and more like 20 at least, with the pre-event one being less than the ring buffer. What shared memory errors do you see? It may be that they are permissions related rather than size related. Particularly if you have previously run as root and left segments lying around which a less priveleged user may not be able to access.

Phil

Posted: Wed May 04, 2005 10:37 am
by CraigGraham
zoneminder wrote: What shared memory errors do you see? It may be that they are permissions related rather than size related.

Phil
May 4 11:35:53 splosh zmc_m2[7377]: ERR [Select error: Interrupted system call]
May 4 11:35:53 splosh zmc_m2[25560]: INF [Debug Level = 0, Debug Log = <none>]
May 4 11:35:53 splosh zmc_m2[25560]: ERR [Can't shmget, probably not enough shared memory space free: Invalid argument]
May 4 11:35:53 splosh zmc_m2[25564]: INF [Debug Level = 0, Debug Log = <none>]
May 4 11:35:53 splosh zmc_m2[25564]: ERR [Can't shmget, probably not enough shared memory space free: Invalid argument]
May 4 11:35:53 splosh zma_m2[7386]: INF [Got signal (Terminated), exiting]
May 4 11:35:54 splosh zma_m2[25571]: INF [Debug Level = 0, Debug Log = <none>]
May 4 11:35:54 splosh zma_m2[25571]: ERR [Shared memory not initialised by capture daemon]
May 4 11:35:54 splosh zma_m2[25573]: INF [Debug Level = 0, Debug Log = <none>]
May 4 11:35:54 splosh zma_m2[25573]: ERR [Shared memory not initialised by capture daemon]


It may be that I've left things around as root- if I find out independently how to fix it I'll edit this :)


Edit; ipcs -m gives

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 32768 root 600 1056768 11 dest
0x00000000 13926401 root 600 520192 11 dest
0x00000000 98306 root 600 46084 11 dest
0x7a6d2002 13959171 apache 700 13824416 2


So yes, there's some shared owned by root, but apache has a big chunk there which I assume is ZM. Especially as it won't go away with ipcrm but disappears when ZM stops.


Oooo! It's not streaming still, but now the status of the monitor shows as recording and it was writing continuous events of around 10 frames each to the event log. Something's happening :) ipcrs shows the same output as before but maybe explicitly deleting that chunk of memory and then restarting ZM has fixed it.