newbie alert!

Forum for questions and support relating to the 1.24.x releases only.
Locked
osoroco
Posts: 13
Joined: Mon Mar 07, 2011 3:49 pm

newbie alert!

Post by osoroco »

Hello all
I'm a first time user of zoneminder; I've been trying to set it up at work for security cameras. I've been getting some issues, some I've resolved, some halfway, others still boggle me.
A little background:
- I think I'm a well seasoned linux user (since late 90's or so), so don'tworry about talking geek.
- not familiar with video codecs (h264-it's mpg right? mp4? what?)
- first install attempt was on a debian-lenny, migrated to ubuntu 10.04 since it was easier to get and install the h264 codec (the vlc h264 didn't compile on debian)
- ffmpeg was compiled and installed with (I think?)appropriate libraries; configure flags where:
--prefix=/opt/ffmpeg/ --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
- the paths on the zoneminder conf point to that ffmpeg living in /opt/ffmpeg
- All of my cameras are Axis cameras, with RTSP mpeg-h264.
- zoneminder was installed off of ubuntu's package manager, version 1.24.2
- I can access all cameras through vlc (rtsp://user:pass@ip:554/axis-media/media.amp) with or without password ( I set up anonymous viewing to ease the setup )
- the machine running zoneminder can connect to the cameras (ping replies and ffmpeg captures)
Issues:
a) /var/log/syslog and /var/log/messages get huge, thousands of

Code: Select all

Mar  9 10:31:02 zoneminder zmc_m2[3695]: WAR [Discarding packet for unrecognised ssrc a037ec8]
messages on each
b) The only way I can get an image out of the cameras is setting the STREAM_METHOD to jpeg and the axis camera source url to:
  • Protocol: HTTP
    Method: Simple
    Host: user:pass@cameraip
    Port: 80
    Path: /axis-cgi/mjpg/video.cgi?resolution=800x600&compression=20
    24bit color and 800x600
c) Event capturing does work (with the above connection method and with rtp/rstp user:pass@host:554/axis-media/media.amp )
d) I can't replay the images for the events through the web (the images are recorded, I can see them on the specified folder). I checked the html and it was looking for the images in '/var/zm/events/images' (that full path on the html) instead of relaying through some script or a web-visible folder.
e) I get these errors in apache:

Code: Select all

==> error.log <Wed> \n  array (\n    'file' => '/usr/share/zoneminder/ajax/stream.php',\n    'line' => 55,\n    'function' => 'ajaxError',\n    'args' => \n    array (\n      0 => 'socket_sendto( /tmp/zms-699128s.sock ) failed: No such file or directory',\n    ),\n  ),\n  1 => \n  array (\n    'file' => '/usr/share/zoneminder/index.php',\n    'line' => 116,\n    'args' => \n    array (\n      0 => '/usr/share/zoneminder/ajax/stream.php',\n    ),\n    'function' => 'require_once',\n  ),\n), referer: http://10.1.1.12/zm/index.php?view=watch&mid=4

Any ideas? Thanks!
- osoroco
osoroco
Posts: 13
Joined: Mon Mar 07, 2011 3:49 pm

Post by osoroco »

alright a bit of progress, i revised all folder permissions (had a few wrong) and worked around point d) in my previous post by soft linking folders, I can now see the individual frames, still no playback be it live or from events with either STREAM_METHOD be it jpeg or mpeg

regarding point e), I made progress using ffmpeg as sourcetype instead of rtsp
info:
sourcetype: ffmpeg
sourtepath: rstp://ip:port/axis-media/media.amp

the /tmp/zms-####s.sock gets created but connection is refused when I try to get playback from the browser

Code: Select all

[Thu Mar 10 15:26:31 2011] [error] [client 192.168.192.2] socket_sendto( /tmp/zms-331636s.sock ) failed: Connection refused, referer: http://10.1.1.12/zm/index.php?view=watch&mid=4
[Thu Mar 10 15:26:31 2011] [error] [client 192.168.192.2] array (\n  0 => \n  array (\n    'file' => '/usr/share/zoneminder/ajax/stream.php',\n    'line' => 55,\n    'function' => 'ajaxError',\n    'args' => \n    array (\n      0 => 'socket_sendto( /tmp/zms-331636s.sock ) failed: Connection refused',\n    ),\n  ),\n  1 => \n  array (\n    'file' => '/usr/share/zoneminder/index.php',\n    'line' => 116,\n    'args' => \n    array (\n      0 => '/usr/share/zoneminder/ajax/stream.php',\n    ),\n    'function' => 'require_once',\n  ),\n), referer: http://10.1.1.12/zm/index.php?view=watch&mid=4
edit: added error log output
willismar
Posts: 5
Joined: Fri Mar 11, 2011 5:10 am

Post by willismar »

Hi...

I have the same problem here. in the past tree weeks ago I have instaled ZoneMinder-1.24.2 in 3 virtual machines. Using Debian 5.08 and Debian 6.0 without any problem.

At that time I wrote a little document to hold, in case I need to pass to anybody install it here on the company I am testing this software.

Now the very funny is, after this tree weeks i tried re-create a new virtual machine using my notes and it not happen, not work at all, also any other tutorial over the web fail and don't help me to install the same ZoneMinder-1.24.2 in any Debian or Ubuntu 10.04 LTS or CentOS 5.5.

If anybody noticed any package change these days, please let me know because this is very crucial, I have tried change the folder permission and more another things but still without any results.
I also have tried another ZoneMinder versions, installing from deb or compiling but i still get the same issue.

I hope somebody can help us here....
newvisionantenna
Posts: 381
Joined: Sat Jan 17, 2009 7:49 pm
Location: Germany

Post by newvisionantenna »

I'm sure your more interested in solving the problem and getting it going on your own install, but if your interested in giving the DVD I put together a chance just look under the zoneminder distro section. We have it running on Axis cams using rtsp and streaming 30fps. I at least know if you used the same setup as us it should work just fine in theory.
willismar
Posts: 5
Joined: Fri Mar 11, 2011 5:10 am

Post by willismar »

Hi ...

I will download and install if the problem can be solved with your builded DVD

I'll let you know on that thread.

thank you
osoroco
Posts: 13
Joined: Mon Mar 07, 2011 3:49 pm

Post by osoroco »

newvisionantenna wrote:I'm sure your more interested in solving the problem and getting it going on your own install, but if your interested in giving the DVD I put together a chance just look under the zoneminder distro section. We have it running on Axis cams using rtsp and streaming 30fps. I at least know if you used the same setup as us it should work just fine in theory.
testing out your livecd? certainly! btw, blazing fast hosting.

not so much luck, tho i will give a try to the latest svn, i saw an option regarding h264 which is what i'm using.

no visual, i got the 'socket_sendot() no such file or directory' on apache error.log (i get connection refused on my install)

i tried connecting to the cameras through ffmpeg but no luck:

Code: Select all

ffmpeg -i rtps://user:pass@host:port/axis-media/media.amp -f asf -r 25 -b 15000 - 
ffmpeg: relocation error: /usr/local/lib/libavfilter.so.1: symbol sws_isSupportedInput, version LIBSWSCALE_0 not defined in file libswscale.so.0 with link time reference 
i installed h264enc and nothing

I will write down what I achieve with the svn version if anything
willismar
Posts: 5
Joined: Fri Mar 11, 2011 5:10 am

Post by willismar »

newvisionantenna wrote:I'm sure your more interested in solving the problem and getting it going on your own install, but if your interested in giving the DVD I put together a chance just look under the zoneminder distro section. We have it running on Axis cams using rtsp and streaming 30fps. I at least know if you used the same setup as us it should work just fine in theory.
Hi again...

Right now I am just running your DVD distribution and I found the same problem ...
I am running in a clean 8Gb HardDrive Virtual Machine.

The error is:
getStreamCmdResponse stream error: socket_sendto( /tmp/zms-209129s.sock ) failed: No such file or directory
willismar
Posts: 5
Joined: Fri Mar 11, 2011 5:10 am

Post by willismar »

Just more one note about this problem...

I had formated a NetBook to install this DVD on it.
After the success instalation i just made the configuration about my remote camera (JPEG format) and the same problems start popup on firebug.

I also tried to check and my camera is online and ok by its own software.
But Zoneminder still trying to create a sock file and read and the errors appear like my previous post.

Any sugestion ?
willismar
Posts: 5
Joined: Fri Mar 11, 2011 5:10 am

Post by willismar »

I discovered the problem.

I have two IP Cameras one over the WEb and another in a private Lan.
The biggest problem was the onlne Camera.

After I use your distribution and just connect my local camera IP it worked like a charm but acessing the over the web it still show the problem above.

So I decided to make a new test. See the camera online and watch it for a while and its freezing sometimes the frames not load completely and probably this was making the ZoneMinder lose the sync and not show nothing.

So if anybody has anotehr source camera try it before.... the ZoneMinder to me is working great and I conclude my Online Camera has problems or its connection is failling.

Thank for all.
newvisionantenna
Posts: 381
Joined: Sat Jan 17, 2009 7:49 pm
Location: Germany

Post by newvisionantenna »

Glad you got it part way working, for us it works great with four Axis cams all running rtsp from remote sites to the server, so not within the lan.
osoroco
Posts: 13
Joined: Mon Mar 07, 2011 3:49 pm

Re: newbie alert!

Post by osoroco »

success!
I'll try to post everything I did to get it running. Small recap of my setup/conf:
OS - ubuntu 10.04 64bit
hardware - vmware virtual machine (everything remote, this VM has no gui desktop)
zoneminder - 1.24.2 (ubuntu pkg)
AXIS Cameras, no rtsp (yet) - configured as:
General Tab - source type - remote
Source Tab - protocol = http
method = simple
host name = user:pass@host_ip_address
port = 80
path = /axis-cgi/mjpeg/video.cgi?resolution=800x600&compression=20
bit/width/height = 24bit @ 800x600

DIR_EVENTS - /var/www/zone_events/events
DIR_IMAGES - /var/www/zone_events/images
DIR_SOUNDS - /var/www/zone_events/sounds
PATH_SOCKS;LOGS;SWAP - /tmp

ubuntu installs the zoneminder web files at /usr/share/zoneminder/
and the cgi at /usr/lib/cgi-bin/

Some logs have been erased since so I can't paste exactly what they said but what i remember they said

IMPORTANT! Do all your testing with firefox, do not use google chrome or some things won't work and you'll break your head wondering why. I've read ie8 also works. It's weird, I know.

I've noticed some weird things going on with the paths in zoneminder, either they're mixed up or I am. But I know for a fact that this one is:
Sympton: Images are being captured and stored but can't view them (individual frames) via web interface. Upon inspection the html is referring to images located at '/var/www/zone_events/' a local path instead of a web path.
Solution: (more like a workaround) soft link /var/www/var/www/zone_events to /var/ww/zone_events (underlined text is the link, rest are real folders)

Symptom/log output: no playback of captured event frames; logs said it could not write ffmpeg.log.
It was trying to write files at '/usr/share/zoneminder/var/www/zone_events'
Solution: (also a workaround) soft link of '/var/' at '/usr/share/zoneminder'

Symptom/log output:Apache log spits out:

Code: Select all

[Thu Mar 10 15:26:31 2011] [error] [client 192.168.192.2] socket_sendto( /tmp/zms-331636s.sock ) failed: Connection refused, referer: http://10.1.1.12/zm/index.php?view=watch&mid=4
[Thu Mar 10 15:26:31 2011] [error] [client 192.168.192.2] array (\n  0 => \n  array (\n    'file' => '/usr/share/zoneminder/ajax/stream.php',\n    'line' => 55,\n    'function' => 'ajaxError',\n    'args' => \n    array (\n      0 => 'socket_sendto( /tmp/zms-331636s.sock ) failed: Connection refused',\n    ),\n  ),\n  1 => \n  array (\n    'file' => '/usr/share/zoneminder/index.php',\n    'line' => 116,\n    'args' => \n    array (\n      0 => '/usr/share/zoneminder/ajax/stream.php',\n    ),\n    'function' => 'require_once',\n  ),\n), referer: http://10.1.1.12/zm/index.php?view=watch&mid=4
And:

Code: Select all

[Mon Mar 07 15:21:44 2011] [error] [client 192.168.192.3] PHP Deprecated:  Function ereg() is deprecated in /usr/share/zoneminder/includes/functions.php on line 808, referer: http://10.1.1.12/zm/index.php
[Mon Mar 07 15:21:44 2011] [error] [client 192.168.192.3] PHP Deprecated:  Function ereg() is deprecated in /usr/share/zoneminder/includes/functions.php on line 813, referer: http://10.1.1.12/zm/index.php
[Mon Mar 07 15:21:44 2011] [error] [client 192.168.192.3] PHP Deprecated:  Function ereg() is deprecated in /usr/share/zoneminder/includes/functions.php on line 808, referer: http://10.1.1.12/zm/index.php
[Mon Mar 07 15:21:44 2011] [error] [client 192.168.192.3] PHP Deprecated:  Function ereg() is deprecated in /usr/share/zoneminder/includes/functions.php on line 813, referer: http://10.1.1.12/zm/index.php
[Mon Mar 07 15:21:44 2011] [error] [client 192.168.192.3] PHP Deprecated:  Function ereg() is deprecated in /usr/share/zoneminder/includes/functions.php on line 808, referer: http://10.1.1.12/zm/index.php
[Mon Mar 07 15:21:44 2011] [error] [client 192.168.192.3] PHP Deprecated:  Function ereg() is deprecated in /usr/share/zoneminder/includes/functions.php on line 813, referer: http://10.1.1.12/zm/index.php
[Mon Mar 07 15:21:44 2011] [error] [client 192.168.192.3] PHP Deprecated:  Function ereg() is deprecated in /usr/share/zoneminder/includes/functions.php on line 808, referer: http://10.1.1.12/zm/index.php
[Mon Mar 07 15:21:44 2011] [error] [client 192.168.192.3] PHP Deprecated:  Function ereg() is deprecated in /usr/share/zoneminder/includes/functions.php on line 813, referer: http://10.1.1.12/zm/index.php
Solution: change all those to pret_match and fix the regular expressions in 'includes/functions.php' as shown below:
FROM:

Code: Select all

   if (ereg( 'MSIE ([0-9].[0-9]{1,2})',$_SERVER['HTTP_USER_AGENT'],$logVersion))
    elseif (ereg( 'Safari/([0-9.]+)',$_SERVER['HTTP_USER_AGENT'],$logVersion))
        elseif (ereg( 'Konqueror/([0-9.]+)',$_SERVER['HTTP_USER_AGENT'],$logVersion))
    elseif (ereg( 'Opera ([0-9].[0-9]{1,2})',$_SERVER['HTTP_USER_AGENT'],$logVersion))
    elseif (ereg( 'Mozilla/([0-9].[0-9]{1,2})',$_SERVER['HTTP_USER_AGENT'],$logVersion))
TO:

Code: Select all

if (preg_match( '/^MSIE ([0-9].[0-9]{1,2})/',$_SERVER['HTTP_USER_AGENT'],$logVersion))
    elseif (preg_match( '/^Safari\/([0-9.]+)/',$_SERVER['HTTP_USER_AGENT'],$logVersion))
        elseif (preg_match( '/^Konqueror\/([0-9.]+)/',$_SERVER['HTTP_USER_AGENT'],$logVersion))
    elseif (preg_match( '/^Opera ([0-9].[0-9]{1,2})/',$_SERVER['HTTP_USER_AGENT'],$logVersion))
    elseif (preg_match( '/^Mozilla\/([0-9].[0-9]{1,2})/',$_SERVER['HTTP_USER_AGENT'],$logVersion))
There's also lonewolf's fix for the race condition which is documented here
Regarding the massive logs being generated (/var/log/messages and syslog), it seems to have gotten fixed along with something else, I no longer have log-pollution.

My only beef right now is that zmaudit.pl doesn't do any cleaning up (I've tried with OPT_FAST_DELETE both on and off and no event files get deleted). The events do disappear from zoneminder and the database, but the captured files are still there. If I don't get any solutions here I may open up a thread regarding this to see if it catches more attention.

I -think- that's all I've done to get it going, I'll be sure to write down anything else that I remember or manage to fix.

-osoroco
osoroco
Posts: 13
Joined: Mon Mar 07, 2011 3:49 pm

Re: newbie alert!

Post by osoroco »

PHP Deprecated: Function split() is deprecated in /usr/share/zoneminder/skins/classic/views/console.php on line 79

change that line from:

Code: Select all

    $groupIds = array_flip(split( ',', $group['MonitorIds'] ));

to:

Code: Select all

    $groupIds = array_flip(preg_split( '/,/', $group['MonitorIds'] ));

Locked