Cannot capture from local usb camera

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
florinc
Posts: 5
Joined: Tue Jun 08, 2021 5:19 pm

Cannot capture from local usb camera

Post 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
User avatar
bkjaya1952
Posts: 282
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka

Re: Cannot capture from local usb camera

Post 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
florinc
Posts: 5
Joined: Tue Jun 08, 2021 5:19 pm

Re: Cannot capture from local usb camera

Post by florinc »

Camera is capturing but not displaying anything on zoneminder
Camera is capturing but not displaying anything on zoneminder
zoneminder_error.png (54.14 KiB) Viewed 3288 times
Actually, the USB camera is capturing but nothing is displayed on Zoneminder. Please view the screen capture.
florinc
Posts: 5
Joined: Tue Jun 08, 2021 5:19 pm

Re: Cannot capture from local usb camera

Post 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
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Cannot capture from local usb camera

Post 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.
florinc
Posts: 5
Joined: Tue Jun 08, 2021 5:19 pm

Re: Cannot capture from local usb camera

Post 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
User avatar
bkjaya1952
Posts: 282
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka

Re: Cannot capture from local usb camera

Post by bkjaya1952 »

Please try for different Capture Resolutions

Reduce the Capture Resolution (pixels) to 320x240 and see whether the monitor can be view
florinc
Posts: 5
Joined: Tue Jun 08, 2021 5:19 pm

Re: Cannot capture from local usb camera

Post 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.
Attachments
captured frames
captured frames
zoneminder_error2.png (51.49 KiB) Viewed 3184 times
Post Reply