Page 1 of 1
Cannot capture from local usb camera
Posted: Tue Jun 08, 2021 5:31 pm
by florinc
I installed ZoneMinder with Apache on Raspberry Pi4 and I configured a local usb camera (/dev/video0) but is not capturing from it. Seems that the problem is related with cgi configuration.
Zoneminder error log:
"Socket /var/run/zm/zms-297092s.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."
In Apache error log:
[Tue Jun 08 18:52:14.079099 2021] [cgi:error] [pid 30597] [client _______: Unable to connect to zmc process. Please ensure that it is running.: /usr/lib/zoneminder/cgi-bin/nph-zms, referer: http://____/zm/index.php?view=watch&mid=1
Re: Cannot capture from local usb camera
Posted: Wed Jun 09, 2021 8:50 am
by bkjaya1952
Please see the connected USB cameras using the solution given in this link.
https://askubuntu.com/questions/348838/ ... mmand-line
Connected usb camara may not be
/dev/video0
Re: Cannot capture from local usb camera
Posted: Wed Jun 09, 2021 1:22 pm
by florinc

- Camera is capturing but not displaying anything on zoneminder
- zoneminder_error.png (54.14 KiB) Viewed 5013 times
Actually, the USB camera is capturing but nothing is displayed on Zoneminder. Please view the screen capture.
Re: Cannot capture from local usb camera
Posted: Wed Jun 09, 2021 1:31 pm
by florinc
After I changed to video2, the console shows that it has captured at 33fps few thousands images, but still doesn't display anything
Here is the log:
2021-06-09 16:28:50 zmc_dvideo2 3696 INF Camera-1: images:5200 - Capturing at 25.00 fps, capturing bandwidth 46080000bytes/sec zm_monitor.cpp 2477
2021-06-09 16:28:46 zmc_dvideo2 3696 INF Camera-1: images:5100 - Capturing at 33.33 fps, capturing bandwidth 61440000bytes/sec zm_monitor.cpp 2477
2021-06-09 16:28:43 zmc_dvideo2 3696 INF Camera-1: images:5000 - Capturing at 25.00 fps, capturing bandwidth 46080000bytes/sec zm_monitor.cpp 2477
Re: Cannot capture from local usb camera
Posted: Wed Jun 09, 2021 7:19 pm
by rockedge
I've run into this before, is there more to the errors in the logs? Check local camera permissions that the web server / ZM user has access to /dev/video*
Other thing I remember from some instances that my OS did not have the dependencies to stream the local usb cams.
Re: Cannot capture from local usb camera
Posted: Thu Jun 10, 2021 2:01 am
by florinc
Yes there are some other errors I encountered. I tried to follow the instructions found so far but it could be good if there is any document for troubleshooting CGI with Apache + Zoneminder.
The other errors:
Socket /var/run/zm/zms-491186s.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 2051
========
web_js 886 ERR TypeError: streamStatus is undefined http://______/zm/cache/skins_classic_views_js_watch-classic-1544278956.js
Re: Cannot capture from local usb camera
Posted: Thu Jun 10, 2021 6:50 am
by bkjaya1952
Please try for different Capture Resolutions
Reduce the Capture Resolution (pixels) to 320x240 and see whether the monitor can be view
Re: Cannot capture from local usb camera
Posted: Thu Jun 10, 2021 11:01 am
by florinc
Hi!
I tried with 320x240 and 160x120 capturing resolutions. The problem remains.
Error log:
2021-06-10 web_js 899 WAR Adjusting to minimum width when getting popup size for tag 'watch' - getPopupSize() ?view=montagereview
2021-06-10 web_php 867 ERR Socket /var/run/zm/zms-349502s.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
I also checked the /var/run/zm/ directory and it creates a .sock file and the it shows like it capturing frames.