Older events are missing pictures

Support and queries relating to all previous versions of ZoneMinder
Locked
nelsda
Posts: 11
Joined: Mon Feb 12, 2007 5:18 am
Location: Kelso, WA, USA

Older events are missing pictures

Post by nelsda »

I've had ZM running for the past 6 days now and I was looking through the event nagivator and noticed that for events older than 24 hours there were some broken image link icons and just image icons where the images are normally displayed. If I click to play and event with a broken image icon the event will play for a while with the icon changing between being broken and not and at some point along in the event the captured images will apear and the event finishes normally. I noticed this earlier this evening and when I looked again I found that the "boundary" between full events and those with missing images is about 24 hours because the "boundary" has moved a couple of hours. I haven't been able to find anything in the forum or Wiki about this (or maybe I don't know what to search for). Here is what shows up in /var/log/messages when I try to play such an event:

Mar 12 23:16:23 cctv zms[3933]: ERR [Can't open /var/www/html/zm/events/3/15/0991-capture.jpg: No such file or directory]
Mar 12 23:16:23 cctv zms[3933]: ERR [Can't open /var/www/html/zm/events/3/15/0992-capture.jpg: No such file or directory]
Mar 12 23:16:23 cctv zms[3933]: ERR [Can't open /var/www/html/zm/events/3/15/0993-capture.jpg: No such file or directory]
Mar 12 23:16:23 cctv zms[3933]: ERR [Can't open /var/www/html/zm/events/3/15/0994-capture.jpg: No such file or directory]
Mar 12 23:16:23 cctv zms[3933]: ERR [Can't open /var/www/html/zm/events/3/15/0995-capture.jpg: No such file or directory]
Mar 12 23:16:23 cctv zms[3933]: ERR [Can't open /var/www/html/zm/events/3/15/0996-capture.jpg: No such file or directory]
Mar 12 23:16:23 cctv zms[3933]: ERR [Can't open /var/www/html/zm/events/3/15/0997-capture.jpg: No such file or directory]
Mar 12 23:16:23 cctv zms[3933]: ERR [Can't open /var/www/html/zm/events/3/15/0998-capture.jpg: No such file or directory]
Mar 12 23:16:23 cctv zms[3933]: ERR [Can't open /var/www/html/zm/events/3/15/0999-capture.jpg: No such file or directory]

After double checking what was going on I noticed that when the frame count went past 0999 that the event began playing the pictures. Any events with fewer than 1000 pictures didn't play anything. I have verified that the pictures do in fact exist in the proper events directory. Now I'm wondering if this has anything to do with the ZM_EVENT_IMAGE_DIGITS value. I did change it to 4 but maybe ZM didn't get restarted.

Just a minute.......

OK, I think I figured it out. I'm going to post this just in case someone else needs it. The ZM_EVENT_IMAGE_DIGITS value is not that image names will be limited to that number of digits but that it will pad any number with fewer digits than the ZM_EVENT_IMAGE_DIGITS value with leading zeros. I changed the ZM_EVENT_IMAGE_DIGITS value to 4 and so ZM assumes that all events were recorded the same way even if they were not. I could see alarm events because many of them would push my image count over 999 into the 4 digit category where the file ZM was looking for was finally named corectly.

Now, how do I pad a name with a leading zero using a command line? I know how DOS does it but I don't know linux as well so don't know the wild cards. DOS used * for any number of characters and a ? for exactly one character. In DOS/Windows/OS2 I could type ren ???-capture.jpg 0???-capture.jpg to do the trick. Any one have an idea?

Thank you,

David
nelsda
Posts: 11
Joined: Mon Feb 12, 2007 5:18 am
Location: Kelso, WA, USA

Post by nelsda »

If any one finds them selves in the situation above and needs to rename a bunch of files you might find this helpful.

I'm running Fedora 6. From a command prompt I did a yum install mmv. Next, I changed to the events folder ( cd /var/www/html/zm/events) and, since I have quite a few files changed into the directory for each camera and ran the following command: mmv -rv "*/???-*.jpg" "0#2#3#4-#5.jpg" including the quotes. This went through each of the event folders and added a zero to the beginning of every file that only had three digits. Now all my past events are visible to ZM. :)

David
Locked