ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

howat
Posts: 6
Joined: Sun Jul 30, 2017 4:12 pm

ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

Postby howat » Sun Jul 30, 2017 4:57 pm

I need some help with ZoneMinder. After I installed it I went to the "gettingstarted" page of the user guide at zoneminder's own site. I set up my first monitor and clicked on it to see the feed, but the window showed just the controls with in a big white window that seemed to flicker about every few seconds.

I went to the wiki and it advised:
If you have issues getting your camera(s) to work, you might need to edit the /usr/bin/zmdc.pl file.
Try to put the following before the my @ daemons = ( line:
$ENV{LD_PRELOAD} = '/usr/lib/libv4l/v4l1compat.so';
I did that and nothing changed.

Here is what is in the log:
2017-07-31 10:43:49.904271 web_js 2118 ERR getStreamCmdResponse stream error: Socket /var/lib/zoneminder/sock/zms-178996s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. - checkStreamForErrors() ?view=watch
2017-07-31 10:43:49.871547 web_php 2118 ERR Socket /var/lib/zoneminder/sock/zms-178996s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. /usr/share/zoneminder/www/includes/functions.php 2033
2017-07-31 10:43:47.936870 zmc_m2 19225 INF Front-Door: 1000 - Capturing at 12.20 fps zm_monitor.cpp 3125
2017-07-31 10:42:25.957334 zmc_m2 19225 INF Priming capture from rtsp://user:password@192.168.1.20:554/user=admin_password=fKYa4j2R_channel=1_stream=0.sdp?real_stream zm_ffmpeg_camera.cpp 104
2017-07-31 10:42:25.955082 zmc_m2 19225 INF Starting Capture version 1.30.4 zmc.cpp 247
2017-07-31 10:42:25.823970 zmdc 19225 INF 'zmc -m 2' started at 17/07/31 10:42:25 zmdc.pl
2017-07-31 10:42:25.823970 zmdc 19015 INF 'zmc -m 2' starting at 17/07/31 10:42:25, pid = 19225 zmdc.pl
2017-07-31 10:42:25.697810 zmwatch 19080 INF Restarting capture daemon for Front-Door, shared data not valid zmwatch.pl
2017-07-31 10:42:20.063570 zmdc 19015 ERR 'zmc -m 2' exited abnormally, exit status 255 zmdc.pl
2017-07-31 10:42:20.008220 zmdc 19015 INF 'zmc -m 2' starting at 17/07/31 10:42:20, pid = 19213 zmdc.pl
2017-07-31 10:42:20.008220 zmdc 19213 INF 'zmc -m 2' started at 17/07/31 10:42:20
The errors timestamped 10:43:49 occurred when I tried to veiw the live stream from the coamera.

This is what I have in my zonminder.conf file:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(zm)(.*) https://%{SERVER_NAME}/$1$2 [R,L]

Alias /zm "/usr/share/zoneminder/www"
<Directory "/usr/share/zoneminder/www">
# explicitly set index.php as the only directoryindex
DirectoryIndex disabled
DirectoryIndex index.php
SSLRequireSSL
# Options -Indexes +MultiViews +FollowSymLinks
Options +MultiViews +FollowSymLinks
AllowOverride All
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
# Order deny,allow
# Allow from all
</IfModule>
</Directory>

ScriptAlias /cgi-bin-zm "/usr/libexec/zoneminder/cgi-bin"
<Directory "/usr/libexec/zoneminder/cgi-bin">
SSLRequireSSL
AllowOverride All
Options +ExecCGI +FollowSymLinks
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order deny,allow
Allow from all
</IfModule>
</Directory>
And this is what I have in httpd.conf:
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

</IfModule>

<Directory "/var/www/cgi-bin">
AllowOverride None
Options +ExecCGI
Require all granted
</Directory>
I've checked that /usr/share/zoneminder/www, /usr/libexec/zoneminder/cgi-bin and /var/www/cgi-bin/ all exist in the filesystem. I've checked that CGI is loaded using the "apachectl -M" command.

In ZoneMinder's options I have the paths set like this:
PATH_ZMS = /cgi-bin-zm/nph-zms
PATH_MAP = /dev/shm
PATH_SOCKS = /var/lib/zoneminder/sock
PATH_LOGS = /var/log/zoneminder
PATH_SWAP = /dev/shm

I've read everything I can find on the internet about this, I'm at my wits end. Can sombody please help?

Thanks,
Grant Howat

howat
Posts: 6
Joined: Sun Jul 30, 2017 4:12 pm

Re: ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

Postby howat » Sun Jul 30, 2017 5:30 pm

Something else I just noticed, when I go to "Servers" under "Settings" in the Amahi Dashboard, ZoneMinder Server is listed as stopped and I can seemd to get it to change using the "Start it" or "Restart" controls. But if I go into ZoneMinder itself, the logs are updating advsing that the loaded monitor is "Capturing" and I can change settings. So I'm not sure what's going on there...

User avatar
bigfoot65
Project Manager
Posts: 10636
Joined: Mon May 25, 2009 4:31 pm

Re: ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

Postby bigfoot65 » Fri Aug 04, 2017 6:41 am

Please provide the URL for:

Code: Select all

apaste --sysinfo
Also check from command line that the service is running:

Code: Select all

sudo systemctl status zoneminder
Based on the URL you provide, I can better determine direction.
ßîgƒσστ65
Applications Manager

howat
Posts: 6
Joined: Sun Jul 30, 2017 4:12 pm

Re: ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

Postby howat » Wed Aug 09, 2017 4:08 pm

Hi bigfoot65,

The URL is:
https://da.gd/jcWJD

This is what systemctl has to say about zoneminder:

â zoneminder.service - ZoneMinder CCTV recording and security system
Loaded: loaded (/usr/lib/systemd/system/zoneminder.service; enabled; vendor p
Active: active (running) since Mon 2017-07-31 12:36:49 NZST; 1 weeks 2 days a
Process: 1251 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=0/SUCCESS
Main PID: 1293 (zmdc.pl)
Tasks: 6 (limit: 4915)
CGroup: /system.slice/zoneminder.service
ââ 1293 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
ââ 1472 /usr/bin/perl -wT /usr/bin/zmfilter.pl
ââ 1493 /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
ââ 1512 /usr/bin/perl -wT /usr/bin/zmwatch.pl
ââ 1525 /usr/bin/perl -w /usr/bin/zmtelemetry.pl
ââ23306 /usr/bin/zmc -m 2

Aug 10 10:51:52 hda.amahi.net zmaudit[1493]: INF [Deleted 22 log table entries b
Aug 10 10:52:45 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1467000 - Capturin
Aug 10 10:54:06 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1468000 - Capturin
Aug 10 10:55:27 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1469000 - Capturin
Aug 10 10:56:47 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1470000 - Capturin
Aug 10 10:58:09 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1471000 - Capturin
Aug 10 10:59:30 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1472000 - Capturin
Aug 10 11:00:51 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1473000 - Capturin
Aug 10 11:02:12 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1474000 - Capturin
lines 1-23/24 95%...skipping...
â zoneminder.service - ZoneMinder CCTV recording and security system
Loaded: loaded (/usr/lib/systemd/system/zoneminder.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2017-07-31 12:36:49 NZST; 1 weeks 2 days ago
Process: 1251 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=0/SUCCESS)
Main PID: 1293 (zmdc.pl)
Tasks: 6 (limit: 4915)
CGroup: /system.slice/zoneminder.service
ââ 1293 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
ââ 1472 /usr/bin/perl -wT /usr/bin/zmfilter.pl
ââ 1493 /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
ââ 1512 /usr/bin/perl -wT /usr/bin/zmwatch.pl
ââ 1525 /usr/bin/perl -w /usr/bin/zmtelemetry.pl
ââ23306 /usr/bin/zmc -m 2

Aug 10 10:51:52 hda.amahi.net zmaudit[1493]: INF [Deleted 22 log table entries by time]
Aug 10 10:52:45 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1467000 - Capturing at 12.35 fps]
Aug 10 10:54:06 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1468000 - Capturing at 12.35 fps]
Aug 10 10:55:27 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1469000 - Capturing at 12.35 fps]
Aug 10 10:56:47 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1470000 - Capturing at 12.50 fps]
Aug 10 10:58:09 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1471000 - Capturing at 12.20 fps]
Aug 10 10:59:30 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1472000 - Capturing at 12.35 fps]
Aug 10 11:00:51 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1473000 - Capturing at 12.35 fps]
Aug 10 11:02:12 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1474000 - Capturing at 12.35 fps]
Aug 10 11:03:33 hda.amahi.net zmc_m2[23306]: INF [Front-Door: 1475000 - Capturing at 12.35 fps]
~
~
~
~
~
~
~
~
~
lines 1-24/24 (END)
Thank-you for having a look at this, I really haven't been able to work out what is wrong.

User avatar
bigfoot65
Project Manager
Posts: 10636
Joined: Mon May 25, 2009 4:31 pm

Re: ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

Postby bigfoot65 » Wed Aug 09, 2017 4:31 pm

Are you not using the zoneminder App?

This looks like a manual install.
ßîgƒσστ65
Applications Manager

howat
Posts: 6
Joined: Sun Jul 30, 2017 4:12 pm

Re: ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

Postby howat » Wed Aug 09, 2017 6:38 pm

It's really not a manual install. I bought the app from the Applications and then installed it from the list were it was newly available. It then showed up on the Amahi Dashboard and I open it from there. Also, ZM repo was automatically installed along with ZoneMinder.

I have been trying to get it to work, so I've made a change or two. You can see those changes in the conf files' text.
Last edited by howat on Wed Aug 09, 2017 6:58 pm, edited 1 time in total.

howat
Posts: 6
Joined: Sun Jul 30, 2017 4:12 pm

Re: ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

Postby howat » Wed Aug 09, 2017 6:52 pm

Should I try uninstalling the ZoneMinder app and re-installing?

User avatar
bigfoot65
Project Manager
Posts: 10636
Joined: Mon May 25, 2009 4:31 pm

Re: ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

Postby bigfoot65 » Thu Aug 10, 2017 6:23 am

Should I try uninstalling the ZoneMinder app and re-installing?
You could try, but recommend you reboot before reinstalling.

I am not seeing any issues in the data you have provided thus far.

Could it be there's a compatibility issue with your camera?

Did this work before? If so, what has changed?
ßîgƒσστ65
Applications Manager

dylanduffy
Posts: 3
Joined: Mon Aug 14, 2017 6:23 pm

Re: ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

Postby dylanduffy » Mon Aug 14, 2017 6:27 pm

Hi,

I am also having this issue, I have some some digging as as far as I can see it's an issue with the CGI Bin location in Zoneminder - It needs a ZMS Path.

The correct error message is
This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit.
Zoneminder has a page on this which says the following
The other common cause for being unable to view streams is that you have installed the ZoneMinder cgi binaries (zms and nph-zms) in a different directory than your web server is expecting. Make sure that the –with-cgidir option you use to the ZoneMinder configure script is the same as the CGI directory configure for your web server. If you are using Apache, which is the most common one, then in your httpd.conf file there should be a line like ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" where the last directory in the quotes is the one you have specified. If not then change one or the other to match. Be warned that configuring apache can be complex so changing the one passed to the ZoneMinder configure (and then rebuilding and reinstalling) is recommended in the first instance. If you change the apache config you will need to restart apache for the changes to take effect. If you still cannot see stream reliably then try changing Options->Paths->ZM_PATH_ZMS to just use zms if nph-zms is specified, or vice versa. Also check in your apache error logs.
Also, please check the value of the ZM_PATH_ZMS setting under the Paths Options tab. It is where you configure the URL to the zms or nph-zms CGI executable. Under most Debian-based distros this value should be /zm/cgi-bin/nph-zms but in the past may have been /cgi-bin/nph-zms or you may have configured it to be something else.

Lastly, please look for errors created by the zmc processes. If zmc isn’t running, then zms will not be able to get an image from it and will exit.
I also have the red icon in the service screen.

I hope someone can sort this out.

Thanks
Dylan

dylanduffy
Posts: 3
Joined: Mon Aug 14, 2017 6:23 pm

Re: ZoneMinder will not stream IP camera (Ffmpeg rtsp source)

Postby dylanduffy » Mon Aug 14, 2017 6:45 pm

Just to confirm I just tested this in a Non-Amahi Linux VM and it works fine.

Who is online

Users browsing this forum: No registered users and 1 guest