Live view not working

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
bgee56
Posts: 7
Joined: Thu Aug 11, 2022 12:38 pm

Live view not working

Post by bgee56 »

ZoneMinder version 1.36.33 running on Fedora 38 server.

None of the live view modes are working. All I get is a white screen with headers and footers. There is not even a frame where the video is supposed to go. This happens in all of montage, camera monitor and zone editing. One result is I cannot edit the motion detection zones. Link to screen shot below.

The system sees the cameras. It says the cameras are capturing. It detects motion, triggers an event, and the recorded event video can be viewed.

The rtsp URLs work in VLC. In VLC I get a real-time view from both cameras.

What else can I check?

Thanks - Bill Gee

https://campercaver.net/MiscFiles/Scree ... 191417.jpg
bgee56
Posts: 7
Joined: Thu Aug 11, 2022 12:38 pm

Re: Live view not working

Post by bgee56 »

Anyone? Surely someone has some ideas about why live view does not work.

I tried opening FireFox in safe mode which disables all plugins and extensions. That did not work - live view is still just a blank.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Live view not working

Post by Magic919 »

Check your logs as these things don't normally fail quietly.
-
bgee56
Posts: 7
Joined: Thu Aug 11, 2022 12:38 pm

Re: Live view not working

Post by bgee56 »

Which log should I check?

Looking over the ZoneMinder log files, I see HUGE amounts of activity in web_js.log. It has tens of thousands of lines like this:

Code: Select all

8/11/23, 7:08:27 AM CDT.275313 web_js[7961].ERR [192.168.17.84] [eval%20violated%20CSP%20script-src] at ?view=events&page=1&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Battr%5D=MonitorId&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bval%5D=1&filter%5BQuery%5D%5Bsort_asc%5D=1&filter%5BQuery%5D%5Bsort_field%5D=StartDateTime&filter%5BQuery%5D%5Blimit%5D=0 line 
and like this:

Code: Select all

8/11/23, 7:05:16 AM CDT.159271 web_js[857].ERR [192.168.17.84] [eval%20violated%20CSP%20script-src] at  line 
8/11/23, 7:05:16 AM CDT.168135 web_js[856].ERR [192.168.17.84] [eval%20violated%20CSP%20script-src] at  line 
8/11/23, 7:05:16 AM CDT.689207 web_js[7961].ERR [192.168.17.84] [eval%20violated%20CSP%20script-src] at  line 
8/11/23, 7:05:16 AM CDT.700238 web_js[855].ERR [192.168.17.84] [eval%20violated%20CSP%20script-src] at  line 
8/11/23, 7:05:17 AM CDT.216592 web_js[2045].ERR [192.168.17.84] [eval%20violated%20CSP%20script-src] at  line 
8/11/23, 7:05:17 AM CDT.232629 web_js[854].ERR [192.168.17.84] [eval%20violated%20CSP%20script-src] at  line 
8/11/23, 7:05:17 AM CDT.737405 web_js[858].ERR [192.168.17.84] [eval%20violated%20CSP%20script-src] at  line 
Using "tail -f", I see these messages appear whenever I do much of anything in the ZoneMinder console. Opening the events view of a monitor, for example, or opening a live view of a monitor.

Checking date and time stamps on the other ZoneMinder log files, I see nothing else that changed while I was viewing the console.

I found an older FAQ entry which says to check the settings of ZM_PATH_ZMS. The settings I have are

/etc/zm/conf.d/01-system-paths.conf
ZM_PATH_ZMS=/cgi-bin-zm/nph-zms

/etc/httpd/conf/httpd.conf
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

The directory /var/www/cgi-bin is empty. The binary for zms exists in /usr/libexec/zoneminder/cgi-bin/zms

All of these came from the Fedora repository package. I have not changed anything.

Bill Gee
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Live view not working

Post by iconnor »

The Fedora installation policy as well as the official debian policy would have you read all the docs and configure everything yourself, understanding all the security implications of everything.

Me, here in ubuntu land just like to make it work out of the box.

So anyways, you have found the source of your problem. The zm package puts the cgi in one place and your config says its in another. Sync them up and it should work.

As to the csp warnings, when we see that it is usually due to a browser plugin scraping data and trying to send it somewhere, which we deny. So try it without plugins and then enable each one one at a time until you figure out which one it is. If it happens without plugins, we can try to see if it is in fact a bug in our code, but this stuff is pretty mature at this point.
bgee56
Posts: 7
Joined: Thu Aug 11, 2022 12:38 pm

Re: Live view not working

Post by bgee56 »

Yeah, I am in the "Just Work" camp.

So what values should I put in those two config files? I tried a few things but nothing changed. Still no live view.

First - I set ZM_PATH_ZMS=/usr/libexec/zoneminder/cgi-bin/nph-zms. Restarted zoneminder service.

Second - I created a new directory /var/www/cgi-bin-zm. The directory is root:root and 0755 permissions, which matches cgi-bin.

In that directory I created two soft links that point to the true locations of nph-zms and zms. I also changed ZM_PATH_ZMS = /cgi-bin/zm/nph-zms which is the original value. The links are root:root and 777 permissions. I restarted both zoneminder and httpd services.

Third - I created the same two soft links in /var/www/cgi-bin. Same owner and permissions. Restarted both zoneminder and httpd.

Still no luck. If I change to either /var/www/cgi-bin or /var/www/cgi-bin-zm and run "zms --version", it reports the current time and [no query string]. This is good - it means zms runs.

If the system cannot find nph-zms, where would it log that error? I looked through all of the ZoneMinder and Apache logs, and found zero references to either zms or nph-zms. Looking in the main system log /var/log/messages, I find lines like this:

Code: Select all

Aug 10 16:10:40 zoneminder2 web_php[854]: 8/10/23, 4:10:40 PM CDT.650663 web_php[854].ERR [fdc4:aeae:eaea:cf00::20] [Socket /var/lib/zoneminder/sock/zms-264981s.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/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information.] at /usr/share/zoneminder/www/includes/functions.php line 1882
Note the time stamp on this - Yesterday. There are no such messages from today. The message above is the most recent such message in the messages file. The messages file does contain thousands of lines like this:

Code: Select all

Aug 11 09:22:39 zoneminder2 web_php[7961]: 8/11/23, 9:22:39 AM CDT.838009 web_js[7961].ERR [fdc4:aeae:eaea:cf00::20] [eval%20violated%20CSP%20script-src] at ?view=watch&mid=2 line
I looked at the URL from that long message. It has nothing new, and in particular does not say exactly how to determine what the correct values are for ScriptAlias and ZM_PATH_ZMS. It only says they have to match. But dammit, they cannot match! ZM_PATH_ZMS contains the name of the executable and ScriptAlias does not.

Maybe the CSP errors need a new topic? I tried running Firefox in safe mode, which disables all plugins, and they still show up in buckets. I thought for a short time it might be due to using IPv6, but changing to IPv4 did not do anything to the messages.

Bill Gee
bgee56
Posts: 7
Joined: Thu Aug 11, 2022 12:38 pm

Re: Live view not working

Post by bgee56 »

More information - I dug around in the Apache configuration files and found something interesting. This is a snippet from /etc/httpd/conf.d/zoneminder.httpd.conf which is actually a soft link to /etc/zm/www/zoneminder.httpd.conf.

Code: Select all

ScriptAlias /cgi-bin-zm "/usr/libexec/zoneminder/cgi-bin"
<Directory "/usr/libexec/zoneminder/cgi-bin">
    # SSLRequireSSL
    AllowOverride None
    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>
I assume Apache can have multiple ScriptAlias settings. Right? If so, then this should make it all work.

Am I missing something bloody obvious??
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Live view not working

Post by iconnor »

It can have multiple ScriptAlias but it depends on context which one takes precedence. Using virtualhosts simplifies things a bit. I know in ubuntu land I frequently have to remove the default config to get zms to work.

Any errors should be logged by apache. In this case likely 404's for not finding the zms executable.
RogerP
Posts: 2
Joined: Tue Aug 01, 2023 6:26 pm

Re: Live view not working

Post by RogerP »

@bgee56 In the console, under "Events" do you see a number? If you click on the number, if it's blue, it should take you to a list of events with snap shots. If you can see this I guess it's capturing the camera images OK and storing them in your database. This is the case for me.

But you can't see an image thumbnail in the console or, if you select Montage, you only see the headers (as you said originally). This is the case for me.

Sorry to be of absolutely no help whatsoever, but if your issue is the same as mine then if I fix mine I'll update this post. :)

My Logs show no errors. Although a typical message is
Annke 3: 45300 - Capturing at 12.48 fps, capturing bandwidth 274800bytes/sec Analysing at 0.00 fps
. The Capturing is at a sensible rate but the Analyzing rate seems a tad slow at 0.0fps :shock:

BTW I use Arch Linux (Endeavouros), I have Apache installed and MariaDB.

Roger
bgee56
Posts: 7
Joined: Thu Aug 11, 2022 12:38 pm

Re: Live view not working

Post by bgee56 »

iconnor - I searched the Apache logs for "zms" and found nothing. There are quite a few hits on 404, but the message does not mention zms or any other URI that I can see.

Code: Select all

[root@zoneminder2 httpd]# ll
total 12464
-rw-r--r-- 1 root root  252946 Aug 13 10:31 access_log
-rw-r--r-- 1 root root   58855 Jul 25 09:53 access_log-20230726
-rw-r--r-- 1 root root  735743 Jul 29 14:34 access_log-20230730
-rw-r--r-- 1 root root 3581168 Aug  5 19:41 access_log-20230806
-rw-r--r-- 1 root root 8078759 Aug 12 06:27 access_log-20230813
-rw-r--r-- 1 root root     557 Aug 13 00:00 error_log
-rw-r--r-- 1 root root    2705 Jul 23 00:00 error_log-20230723
-rw-r--r-- 1 root root    1726 Jul 30 00:00 error_log-20230730
-rw-r--r-- 1 root root    1882 Aug  6 00:00 error_log-20230806
-rw-r--r-- 1 root root    3876 Aug 13 00:00 error_log-20230813
-rw-r--r-- 1 root root       0 Mar 24 05:57 ssl_access_log
-rw-r--r-- 1 root root       0 Mar 26 00:00 ssl_error_log
-rw-r--r-- 1 root root     304 Mar 24 05:57 ssl_error_log-20230326
-rw-r--r-- 1 root root       0 Mar 24 05:57 ssl_request_log
[root@zoneminder2 httpd]# grep zms *_log
[root@zoneminder2 httpd]# grep 404 *_log | tail --lines=1
access_log:fdc4:aeae:eaea:cf00::20 - - [13/Aug/2023:10:28:20 -0500] "GET /zm/index.php?request=events&task=delete&eids%5B%5D=4035&eids%5B%5D=4041 HTTP/1.1" 200 15 "http://zoneminder2.billgee.local/zm/index.php?view=events&page=1&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Battr%5D=MonitorId&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bval%5D=2&filter%5BQuery%5D%5Bsort_asc%5D=1&filter%5BQuery%5D%5Bsort_field%5D=StartDateTime&filter%5BQuery%5D%5Blimit%5D=0" "Mozilla/5.0 (Windows NT 10.0; rv:109.0) Gecko/20100101 Firefox/116.0"
Looking at this closer, it is not a 404 error. It is a perfectly normal request from a browser . The parameter eids is set to 4041 which is why it matches my grep pattern.

RogerP - Yes, I see a number in the events column. I can click on that number and get a list of recorded events. Clicking on the event name will playback the recording. This part works with no problems. There is no snapshot, but I think that is because I did not turn on snapshots. On both of my monitors, the setting for "Save JPEGs" is set to Disabled.

When I select any of a monitor, the montage view or editing the zones for a monitor, I do not see a live view. In the zone editor there is a red rectangle which marks the zone border, but no image is inside the border. I have - for now - only one zone on each camera. This thread was triggered when I went to edit the zones and could not see anything to help me set the zone borders.

Grep-ing the ZoneMinder log files, I see nothing that has either "Capturing at" or "capturing bandwidth" in it. I may have turned off this message in the ZoneMinder log file settings. Log_Level_Syslog and Log_Level_File are both set to "Warning".
bgee56
Posts: 7
Joined: Thu Aug 11, 2022 12:38 pm

Re: Live view not working

Post by bgee56 »

Just a quick update - This issue is not resolved.
User avatar
AllenTuttle
Posts: 29
Joined: Tue Sep 25, 2007 4:56 pm
Location: Sequim WA.

Re: Live view not working

Post by AllenTuttle »

BGee56 did you ever find a resolution?
I have exactly the same issues on a Ubuntu 22.04.3 LTS system.

Zoneminder worked for a couple years and I kept everything updated.
Unfortunately an update four months ago broke Zoneminder resulting in no 'live view' and no image in 'Zone Edit' which also breaks the ability to edit the zones.

I've compared all the Abache and ZM config files to those on a working Ubuntu 22.04.3 LTS system and everything is the same.
Oddly some of the screens render a little differently.

The broken ZM gets the "This plugin is not supported" trying to view using 'embed':
<embed type="video/mpeg" src="/zm/cgi-bin/nph-zms?mode=mpeg&amp;scale=100&amp;bitrate=150000&amp;maxfps=30&amp;format=mpg&amp;monitor=1&amp;rand=1705199932" name="R2c" width="" height="" autostart="1" autoplay="1" showcontrols="0" controller="0">

The working ZM makes a very different call to the same camera:
<img id="liveStream1" src="http://homeserver/zm/cgi-bin/nph-zms?mo ... key=388202" alt="R2c" style="height: 165px;">
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Live view not working

Post by iconnor »

You have Options -> High BW -> WEB_H_STREAM_METHOD set to mpeg instead of jpeg. This is old stuff from like ie6 days and it gets removed from modern browsers.
Post Reply