Problem connecting cameras even basic usb webcam

Previous development branch now released as 1.36
Trevor-WA
Posts: 17
Joined: Tue Jan 12, 2021 6:12 am

Problem connecting cameras even basic usb webcam

Post by Trevor-WA »

hello there,
I am new to these forums so forgive me if I am posting to the wrong place/forum.
I have set up zm several times and I end up with the same or similar problems- cant connect to any camera even a basic usb webcam attached to the computer that linux is on. I have latest linux-mint.

I am new to linux and zoneminder (which is probably where the problem is) so I cant (dont know how)to do any terminal probing to diagnose the problem.

Any help would be great.

trev
Trevor-WA
Posts: 17
Joined: Tue Jan 12, 2021 6:12 am

Re: Problem connecting cameras even basic usb webcam

Post by Trevor-WA »

Doing a bit of exploring and I get below-??
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| zm |
+--------------------+
5 rows in set (0.01 sec)

mysql> mysql> CREATE DATABASE IF NOT EXISTS test1; ----My Entry----
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> CREATE DATABASE IF NOT EXISTS test1' at line 1
mysql>
Trevor-WA
Posts: 17
Joined: Tue Jan 12, 2021 6:12 am

Re: Problem connecting cameras even basic usb webcam

Post by Trevor-WA »

A view of log entries


Date/Time
Component Server PID Level Message File Line
2021-01-12 19:09:51 zmwatch 1332 WAR Restarting capture daemon for cam56, no image since startup. Startup time was 1610449731 - now 1610449791 > 45 zmwatch.pl
2021-01-12 19:09:51 zmdc 956 INF 'zmc -m 2' sending stop to pid 7155 at 21/01/12 19:09:51 zmdc.pl
2021-01-12 19:09:41 zmdc 956 INF 'zmc -m 2' sending stop to pid 7155 at 21/01/12 19:09:41 zmdc.pl
2021-01-12 19:09:41 zmwatch 1332 WAR Restarting capture daemon for cam56, no image since startup. Startup time was 1610449731 - now 1610449781 > 45 zmwatch.pl
2021-01-12 19:09:26 zmdc 956 INF Starting pending process, zmc -d /dev/video2 zmdc.pl
2021-01-12 19:09:26 zmdc 956 INF 'zmc -d /dev/video2' starting at 21/01/12 19:09:26, pid = 7270 zmdc.pl
2021-01-12 19:09:26 zmdc 7270 INF 'zmc -d /dev/video2' started at 21/01/12 19:09:26 zmdc.pl
2021-01-12 19:09:26 zmc_dvideo2 7270 ERR Automatic format selection failed to open video device /dev/video2: Permission denied zm_local_camera.cpp 1194
2021-01-12 19:09:26 zmc_dvideo2 7270 ERR Automatic format selection failed. Falling back to YUYV zm_local_camera.cpp 380
2021-01-12 19:09:26 zmc_dvideo2 7270 INF No direct match for the selected palette (0x00000001) and target colorspace (04). Format conversion is required, performance penalty expected zm_local_camera.cpp 446
2021-01-12 19:09:26 zmc_dvideo2 7270 INF Starting Capture version 1.34.22 zmc.cpp
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Problem connecting cameras even basic usb webcam

Post by Magic919 »

Google this bit

Code: Select all

 failed to open video device /dev/: Permission denied 
-
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Problem connecting cameras even basic usb webcam

Post by iconnor »

/dev/video devices are generally owned by the video group. You need to add www-data to the video group.

sudo usermod -a -G video www-data
Trevor-WA
Posts: 17
Joined: Tue Jan 12, 2021 6:12 am

Re: Problem connecting cameras even basic usb webcam

Post by Trevor-WA »

Thanks for help. No luck so far so ill keep trying. Any useful links would be appreciated.
Cheers Trev
Trevor-WA
Posts: 17
Joined: Tue Jan 12, 2021 6:12 am

Re: Problem connecting cameras even basic usb webcam

Post by Trevor-WA »

Thanks once again. I am trying your suggestion. I have just upgraded Ubuntu. Started with Mint then Ubuntu 18-- and now Ubuntu 20--. So ill see how I go. Just one thing I am on a dual boot system on this computer I can use Ispy on windows and it does not have a problem finding my Cameras on the same local network. The cameras are plugged in to a switch, it doesnt matter if I have the NVR plugged in or not.

However, I dont want to use Windows- I have an old computer 32bit that I want to set up purely for my security cams. Therefore, when I get Zoneminder working (and it will -:) on this computer 64bit HP laptop then I can move on.

Thanks for the help-and I do follow and try what you say. So Ubuntu just finished installing and ill try again.
Trevor-WA
Posts: 17
Joined: Tue Jan 12, 2021 6:12 am

Re: Problem connecting cameras even basic usb webcam

Post by Trevor-WA »

Trying various things--- the link to https://wiki.zoneminder.com/How_to_Inst ... l_Fossa%29

Seemed like good way to go. I installed LAMP beforehand and I thought I was very careful with everything. My thoughts were that it was not a ZM problem but I had not installed stuff beforehand correctly- Unfortunately when I tried localhost/zm I got
<?php
//
// ZoneMinder main web interface file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
etc--------------
Ive usually managed to get zm up and running so while this seems like a backward step does it provide any clues?
Im going to try another zm install and see how I go???
User avatar
bkjaya1952
Posts: 282
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka

Re: Problem connecting cameras even basic usb webcam

Post by bkjaya1952 »

Still Zoneminder groove is not ready due to dependency issue for Ubuntu 20.10. Therefore try Zoneminder docker on Ubuntu 20.10. Please try following Zoneminder docker .


https://hub.docker.com/r/bkjaya1952/doc ... 7.4-mysql8
Trevor-WA
Posts: 17
Joined: Tue Jan 12, 2021 6:12 am

Re: Problem connecting cameras even basic usb webcam

Post by Trevor-WA »

Thanks im trying it i think ive got Docker downloaded --now where to load zm??
Trevor-WA
Posts: 17
Joined: Tue Jan 12, 2021 6:12 am

Re: Problem connecting cameras even basic usb webcam

Post by Trevor-WA »

Ive got Docker going on localhost:8080 and get following even after changing the date in options/ system

ERR ZoneMinder is not configured properly: php's date.timezone +0800 does not match the system timezone +0000! Please check Options->System->Timezone. /usr/share/zoneminder/www/includes/functions.php

but I still cant connect to usb cam or cameras??

i also have localhost:80 working and this is log message



Date/Time
Component Server PID Level Message File Line
2021-01-15 00:37:26 zmdc 1280 INF 'zmc -m 1' sending stop to pid 27959 at 21/01/15 00:37:26 zmdc.pl
2021-01-15 00:37:15 zmdc 1280 INF 'zmc -m 1' sending stop to pid 27959 at 21/01/15 00:37:15 zmdc.pl
2021-01-15 00:37:05 zmdc 1280 INF 'zmc -m 1' sending stop to pid 27959 at 21/01/15 00:37:05 zmdc.pl
2021-01-15 00:36:55 zmdc 1280 INF 'zmc -m 1' sending stop to pid 27959 at 21/01/15 00:36:55 zmdc.pl
2021-01-15 00:36:45 zmdc 1280 INF 'zmc -m 1' sending stop to pid 27959 at 21/01/15 00:36:45 zmdc.pl
2021-01-15 00:35:55 zmc_m1 27959 INF Starting Capture version 1.34.22 zmc.cpp 223
2021-01-15 00:35:55 zmc_m1 27959 INF Priming capture from /dev/video0 zm_libvlc_camera.cpp 160
2021-01-15 00:35:55 zmc_m1 27959 WAR PulseAudio server connection failure: Connection refused

thanks again
Trevor-WA
Posts: 17
Joined: Tue Jan 12, 2021 6:12 am

Re: Problem connecting cameras even basic usb webcam

Post by Trevor-WA »

P.S.
I dont care what linux I use or which Zonemnder--- I am certainly getting practise with loading up each- I just want something that works. So if thats the way to go let me know--
thanks
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Problem connecting cameras even basic usb webcam

Post by burger »

Trevor-WA wrote: Thu Jan 14, 2021 5:01 pm P.S.
I dont care what linux I use or which Zonemnder--- I am certainly getting practise with loading up each- I just want something that works. So if thats the way to go let me know--
thanks
Guides to follow are here: https://wiki.zoneminder.com/Ubuntu and specifically https://wiki.zoneminder.com/Ubuntu_Serv ... der_1.34.x as already mentioned.

I wouldn't advise Docker for people "new to linux".
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
User avatar
bkjaya1952
Posts: 282
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka

Re: Problem connecting cameras even basic usb webcam

Post by bkjaya1952 »

Trevor-WA wrote: Thu Jan 14, 2021 4:38 pm Ive got Docker going on localhost:8080 and get following even after changing the date in options/ system

ERR ZoneMinder is not configured properly: php's date.timezone +0800 does not match the system timezone +0000! Please check Options->System->Timezone. /usr/share/zoneminder/www/includes/functions.php

but I still cant connect to usb cam or cameras??

i also have localhost:80 working and this is log message



Date/Time
Component Server PID Level Message File Line
2021-01-15 00:37:26 zmdc 1280 INF 'zmc -m 1' sending stop to pid 27959 at 21/01/15 00:37:26 zmdc.pl
2021-01-15 00:37:15 zmdc 1280 INF 'zmc -m 1' sending stop to pid 27959 at 21/01/15 00:37:15 zmdc.pl
2021-01-15 00:37:05 zmdc 1280 INF 'zmc -m 1' sending stop to pid 27959 at 21/01/15 00:37:05 zmdc.pl
2021-01-15 00:36:55 zmdc 1280 INF 'zmc -m 1' sending stop to pid 27959 at 21/01/15 00:36:55 zmdc.pl
2021-01-15 00:36:45 zmdc 1280 INF 'zmc -m 1' sending stop to pid 27959 at 21/01/15 00:36:45 zmdc.pl
2021-01-15 00:35:55 zmc_m1 27959 INF Starting Capture version 1.34.22 zmc.cpp 223
2021-01-15 00:35:55 zmc_m1 27959 INF Priming capture from /dev/video0 zm_libvlc_camera.cpp 160
2021-01-15 00:35:55 zmc_m1 27959 WAR PulseAudio server connection failure: Connection refused

thanks again

Using the guvcview or cheese software check whether the device path of usb camera is /dev/video0

Please check the usb monitor settings with the following pictures .
Screenshot from 2021-01-15 11-51-31.png
Screenshot from 2021-01-15 11-51-31.png (104.13 KiB) Viewed 24617 times
Screenshot from 2021-01-15 11-51-45.png
Screenshot from 2021-01-15 11-51-45.png (117.07 KiB) Viewed 24617 times
Screenshot from 2021-01-15 11-51-55.png
Screenshot from 2021-01-15 11-51-55.png (114.86 KiB) Viewed 24617 times





In the zoneminder panel goto Options>TIMEZONE and select your timezone and save
Restart zm

sudo docker restart zm

sudo docker exec -t -i zm /bin/bash

dpkg-reconfigure tzdata

Then select your timezone

exist

sudo docker restart zm
Last edited by bkjaya1952 on Fri Jan 15, 2021 8:22 am, edited 1 time in total.
Locked