Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
revmoo
May 25, 2006

#basta
I just spent the last day trying to get Zoneminder working with this camera:

http://www.amazon.com/ELP-Megapixel-Camera-Hidden-Network/dp/B00KA4M4WS

It's an RTSP camera and streams beautifully. Zoneminder is unable to read the RTSP stream from it. The most recent version of Zoneminder has support for libvlc which effectively allows it to stream from any camera that VLC can view. I believe I have that part down. Unfortunately, there are no working Debian packages for this version of Zoneminder so I had to build from source. After building the source and chasing down undocumented dependencies all day, I'm left with one final, unfixable error:

socket_sendto( /tmp/zm/zms-710249s.sock ) failed: No such file or directory

Nobody, including the ZM developers seem to be able to resolve this problem, and this appears to be a somewhat widespread bug. So I'm left with not being able to use the only real surveillance package available on Linux. Now I'm trying to look at other options, but the best I can tell is that I'm going to need to install a Windows VM on my server and configure some friendlier Windows app to do the monitoring.

Does anybody have software recommendations? I need to run three cameras, I want motion recording, and web/smartphone monitoring. I really, REALLY don't want to have to use a proprietary application to view camera outputs so I guess if that is the only option then I'll probably scrap the project.

Adbot
ADBOT LOVES YOU

Noxious
Oct 22, 2002

Allow me to give you free stuff, or I will stalk you and poison your family.
You probably already know this. But do you have VLC working on the system? According to this, https://github.com/ZoneMinder/ZoneMinder/wiki/libvlc-source-type, if you don't have VLC working then even though you can build the library you can't actually use it.

revmoo
May 25, 2006

#basta
Yes, I'm aware of that requirement.

evol262
Nov 30, 2010
#!/usr/bin/perl
Is this error when you try to start zoneminder?

If so, please strace it. And maybe ldd the binary.

You may also have needed vlc-devel

revmoo
May 25, 2006

#basta
Already have all the vlc development libs. The error, as far as I can tell is due to the fact that some daemon is failing to run. If I do a cmake and make/make install, I get no errors and yet if I stop/start the service I get a failed PID error on shutdown which indicates to me that one of the necessary processes doesn't run/didn't get installed. The ZM logs show that it's capturing video (11fps) so I'm fairly confident the problem is related to viewing /streaming rather than video capture.

Here is a couple writeups of the bug that I'm experiencing:

https://bugs.launchpad.net/ubuntu/+source/zoneminder/+bug/1159361
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741738

Unfortunately it appears that none of the fixes described within apply to my issue, but they do adequately explain the symptoms of what I'm experiencing.

evol262
Nov 30, 2010
#!/usr/bin/perl

revmoo posted:

Already have all the vlc development libs. The error, as far as I can tell is due to the fact that some daemon is failing to run. If I do a cmake and make/make install, I get no errors and yet if I stop/start the service I get a failed PID error on shutdown which indicates to me that one of the necessary processes doesn't run/didn't get installed. The ZM logs show that it's capturing video (11fps) so I'm fairly confident the problem is related to viewing /streaming rather than video capture.

Here is a couple writeups of the bug that I'm experiencing:

https://bugs.launchpad.net/ubuntu/+source/zoneminder/+bug/1159361
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741738

Unfortunately it appears that none of the fixes described within apply to my issue, but they do adequately explain the symptoms of what I'm experiencing.

Sorry. It's Friday night and I'm phone posting. Won't get to look at those in detail until tomorrow.

CGI? Post the apache config?

Are these errors in the apache logs?

Cgi-user? Ownership on the tmp directory?

revmoo
May 25, 2006

#basta

evol262 posted:

Sorry. It's Friday night and I'm phone posting. Won't get to look at those in detail until tomorrow.

CGI? Post the apache config?

Are these errors in the apache logs?

Cgi-user? Ownership on the tmp directory?

Ownership on tmp dir is www-data, ownership on cgi-bin and wwwroot are www-data. Apache config:

code:
<VirtualHost *:80>
        ServerName <hostnameisherebutiremovedit>
        DocumentRoot /usr/local/share/zoneminder/www
        <Directory /usr/local/share/zoneminder/www>
                Options FollowSymLinks MultiViews ExecCGI
                AllowOverride All
                php_value short_open_tag 1
                Order allow,deny
                allow from all
        </Directory>
        ScriptAlias /cgi-bin /usr/local/share/zoneminder/www/cgi
        <Directory /usr/local/share/zoneminder/www/cgi>
                Options +ExecCGI +MultiViews +SymLinksIfOwnerMatch
                AllowOverride None
                php_value short_open_tag 1
                Order allow,deny
                allow from all
                Require all granted
        </Directory>
        LogLevel warn
</VirtualHost>
I've tried a dozen different variations on this Apache config, this is just the last one I left it at. As far as I can tell visiting the nph-zms script directly works and I don't get any 403 or 500 errors.

Apache logs show this:

code:
[Fri Aug 01 22:32:32.620805 2014] [cgi:error] [pid 2507] [client 192.168.1.125:58033] AH01215: MPEG streaming is disabled., referer: [url]http://192.168.1.5/?view=watch&mid=3[/url]
[Fri Aug 01 22:32:32.620947 2014] [cgi:error] [pid 2507] [client 192.168.1.125:58033] AH01215: You should configure with the --with-ffmpeg option and rebuild to use this functionality.
Interesting, because I actually did compile with the --with-ffmpeg option (cmake --with-ffmpeg .). Also jpeg streaming doesn't work in spite of installing libjpeg turbo. I'm thinking the root of my problem may lie here.

I'll leave you with this:

code:
> zmdc.pl startup
Starting server
[/root]
> zmdc.pl shutdown
Can't find child with pid of '2413'
Server shutdown at 14/08/01 22:31:30

SUPER MEGA EDIT: I enabled greyscale so that I could test without the libjpeg turbo issues and I get video!!! So I have a solution in sight! Looks like I need to figure out why ffmpeg didn't work (I did add it with a recompile, perhaps a make install wasn't enough?), or how to properly install libjpeg turbo.

SUPER MEGA EDIT 2: I found this page that was very informative:

http://blog.yibi.org/tag/zoneminder

I think the libjpeg turbo stuff would probably have worked, but when I ran the suggested apt-get string towards the top, it broke something and now I can't build ZM anymore! I get this error:

/root/ZoneMinder-1.27.0/src/zm_mpeg.cpp:136:25: error: ‘CODEC_ID_NONE’ was not declared in this scope

It appears to be a known issue, but I have no idea how to resolve it. This is the most frustrating thing.

revmoo fucked around with this message at 05:38 on Aug 2, 2014

evol262
Nov 30, 2010
#!/usr/bin/perl

revmoo posted:

Ownership on tmp dir is www-data, ownership on cgi-bin and wwwroot are www-data. Apache config:

code:
<VirtualHost *:80>
        ServerName <hostnameisherebutiremovedit>
        DocumentRoot /usr/local/share/zoneminder/www
        <Directory /usr/local/share/zoneminder/www>
                Options FollowSymLinks MultiViews ExecCGI
                AllowOverride All
                php_value short_open_tag 1
                Order allow,deny
                allow from all
        </Directory>
        ScriptAlias /cgi-bin /usr/local/share/zoneminder/www/cgi
        <Directory /usr/local/share/zoneminder/www/cgi>
                Options +ExecCGI +MultiViews +SymLinksIfOwnerMatch
                AllowOverride None
                php_value short_open_tag 1
                Order allow,deny
                allow from all
                Require all granted
        </Directory>
        LogLevel warn
</VirtualHost>
I've tried a dozen different variations on this Apache config, this is just the last one I left it at. As far as I can tell visiting the nph-zms script directly works and I don't get any 403 or 500 errors.

Apache logs show this:

code:
[Fri Aug 01 22:32:32.620805 2014] [cgi:error] [pid 2507] [client 192.168.1.125:58033] AH01215: MPEG streaming is disabled., referer: [url]http://192.168.1.5/?view=watch&mid=3[/url]
[Fri Aug 01 22:32:32.620947 2014] [cgi:error] [pid 2507] [client 192.168.1.125:58033] AH01215: You should configure with the --with-ffmpeg option and rebuild to use this functionality.
Interesting, because I actually did compile with the --with-ffmpeg option (cmake --with-ffmpeg .). Also jpeg streaming doesn't work in spite of installing libjpeg turbo. I'm thinking the root of my problem may lie here.

I'll leave you with this:

code:
> zmdc.pl startup
Starting server
[/root]
> zmdc.pl shutdown
Can't find child with pid of '2413'
Server shutdown at 14/08/01 22:31:30

SUPER MEGA EDIT: I enabled greyscale so that I could test without the libjpeg turbo issues and I get video!!! So I have a solution in sight! Looks like I need to figure out why ffmpeg didn't work (I did add it with a recompile, perhaps a make install wasn't enough?), or how to properly install libjpeg turbo.

SUPER MEGA EDIT 2: I found this page that was very informative:

http://blog.yibi.org/tag/zoneminder

I think the libjpeg turbo stuff would probably have worked, but when I ran the suggested apt-get string towards the top, it broke something and now I can't build ZM anymore! I get this error:

/root/ZoneMinder-1.27.0/src/zm_mpeg.cpp:136:25: error: ‘CODEC_ID_NONE’ was not declared in this scope

It appears to be a known issue, but I have no idea how to resolve it. This is the most frustrating thing.

I'll look tomorrow, but my guess is that 1.27 won't work -- master from github probably has changed source.

revmoo
May 25, 2006

#basta
Good point. I cloned the Github repo and I am able to compile again! However following that blog I posted previously I'm still unable to get ZM to recognize libjpeg-turbo. I think this is the last remaining hurdle. I added the lines to debian/rules and rebuilt but it appears I'm missing a step still.

EDIT: Following that blog a little closer I realized I needed to build with dpkg-buildpackage in order to get it to recognize debian/rules. I spent a little longer fixing syntax errors and undocumented dependancies both in the blog post and within zoneminder's source and was able to successfully build a .deb. However, I'm still seeing the exact same problems as before; greyscale works, but color does not.

I guess if that's that, I can live with greyscale for monitoring and then just use VLC streaming for monitoring instead of ZM. I really wish Zoneminder wasn't such a buggy POS.

revmoo fucked around with this message at 14:14 on Aug 2, 2014

evol262
Nov 30, 2010
#!/usr/bin/perl

revmoo posted:

Good point. I cloned the Github repo and I am able to compile again! However following that blog I posted previously I'm still unable to get ZM to recognize libjpeg-turbo. I think this is the last remaining hurdle. I added the lines to debian/rules and rebuilt but it appears I'm missing a step still.

EDIT: Following that blog a little closer I realized I needed to build with dpkg-buildpackage in order to get it to recognize debian/rules. I spent a little longer fixing syntax errors and undocumented dependancies both in the blog post and within zoneminder's source and was able to successfully build a .deb. However, I'm still seeing the exact same problems as before; greyscale works, but color does not.

I guess if that's that, I can live with greyscale for monitoring and then just use VLC streaming for monitoring instead of ZM. I really wish Zoneminder wasn't such a buggy POS.

Is this actually using cmake? If so, it looks like exporting CMAKE_PREFIX_PATH=/opt/libjpeg-turbo... may be needed

ldd-ing the binary will tell you if it's actually linked against it, though.

Also, it appears to have a Dockerfile. You may want to try using that, since the devs have probably hammered out all these problems. cd /path/to/git/repo && docker -t zoneminder build && docker run zoneminder (after you fix the laughably insecure root:root auth, hopefully)

revmoo
May 25, 2006

#basta
I've tried using both cmake and dpkg-buildpackage. Both seem to work about the same.

I'll try messing with it again later. Just got the first camera installed though:



Not bad for a 30 dollar camera. Though I will say they are straight up lying about PoE support. I got frustrated trying to get these PoE injectors working so I grabbed my DMM and pinned-out the camera. There are actually enough wires inside the cable to support PoE but they're not connected to anything at all. I ended up adding PoE 'manually' by piping the AC adapter into some unused pins and then separating them out at my switch.

devmd01
Mar 7, 2006

Elektronik
Supersonik
Milestone provides a free 4-camera, 1 week retention license for anybody, and they support pretty much drat near every IP camera in existence. Why put yourself through this trouble?

E: The GUI is miles ahead of anything open source can hope to put out.

devmd01 fucked around with this message at 20:08 on Aug 2, 2014

revmoo
May 25, 2006

#basta

devmd01 posted:

Why put yourself through this trouble?

Good question. I really don't like maintaining or dealing with Windows software basically. One nice thing about Zoneminder is (once it's working) I can dip into the source code and make all the changes I want. Also it appears that this Milestone product requires Windows Server? I don't have one of those lying around so it would have to be a VM on my linux server, which is kinda redundant in my opinion, not to mention it could have performance issues. These three cameras will be pushing about 24mbit of video 24/7 and I could see a Windows VM roasting my server's CPU.

If it wasn't for the Windows server thing I'd probably give it a shot though.

revmoo
May 25, 2006

#basta

evol262 posted:

Also, it appears to have a Dockerfile. You may want to try using that, since the devs have probably hammered out all these problems. cd /path/to/git/repo && docker -t zoneminder build && docker run zoneminder (after you fix the laughably insecure root:root auth, hopefully)

:ughh: Their docker configuration is totally broken as well


EDIT: BTW I tried an app called 'Xeoma' and installed the linux server and OSX client and within a minute and a half the system had detected my camera automatically somehow, guessed the password, and streamed the video to my Mac. I'll have to play with it a bit further but it makes ZM look like utter garbage.

revmoo fucked around with this message at 19:32 on Aug 4, 2014

Adbot
ADBOT LOVES YOU

eukara
Aug 5, 2014

Do you believe in life after bomb?
Hah, this might actually be fun to turn into a WindowMaker dockapp.

  • Locked thread