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 » Tue Jun 08, 2021 5:31 pm

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: 225
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka
Contact:

Re: Cannot capture from local usb camera

Post by bkjaya1952 » Wed Jun 09, 2021 8:50 am

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 » Wed Jun 09, 2021 1:22 pm

zoneminder_error.png
Camera is capturing but not displaying anything on zoneminder
zoneminder_error.png (54.14 KiB) Viewed 895 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 » Wed Jun 09, 2021 1:31 pm

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: 1161
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA
Contact:

Re: Cannot capture from local usb camera

Post by rockedge » Wed Jun 09, 2021 7:19 pm

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 » Thu Jun 10, 2021 2:01 am

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: 225
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka
Contact:

Re: Cannot capture from local usb camera

Post by bkjaya1952 » Thu Jun 10, 2021 6:50 am

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 » Thu Jun 10, 2021 11:01 am

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
zoneminder_error2.png
captured frames
zoneminder_error2.png (51.49 KiB) Viewed 791 times

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests