cant get the video camera to work

Forum for questions and support relating to the 1.24.x releases only.
Locked
mrgreaper
Posts: 14
Joined: Tue Aug 19, 2008 2:08 pm

cant get the video camera to work

Post by mrgreaper »

ok first some details

zone minder 1.24.1

ubuntu 9.04 (the latest as of yesterday)

i used this guide to set it up http://www.howtoforge.com/video_surveil ... der_ubuntu

with the exception that i installed the i386.deb from ftp://www.northern-ridge.com.au/zonemin ... tu/jaunty/

now the usb web cam i am using is the ps3 eye
which i installed with this guide :http://blog.10100111001.com/2009/02/pla ... ng-on.html

i tested it with vlc as instructred and it worked beautifuly

before trying zone minder i tried a program called "motion" and that works great with the ps3 eye
judging from tis comand "$ vlc v4l2:///dev/video0" im guessing v4l2 is video for linux 2 and that id is dev/video channel 0

my monitier is set up asfollows
General tab
name: new
source type: local
function: monitier
enabled: TICK
linked monitiers: new
max fps: blank
alarm fps: blank
Reference Image Blend %ge : 7
trigers: none available

Source tab
Device Path: /dev/video (i tried adding the 0 to the end just incase i was wrong about channel id no joy)
Capture Method: video for linux 2
device channel: 0
device format : undefined (i tired pal i and pal 60)
capture pallette:undefined (i tried rgb 24)
capture width: 640 (what my camera is set to)
capture height: 480
preserve aspect ratio: UNTICKED ( tried ticked)
orientation: normal




for the programme motion to work i have the config set up as
videodevice /dev/video0
v4l2_palette 8 (thats # V4L2_PIX_FMT_YUV420 : 8 'YU12' (i did try the equivelent in zoneminder but no joy)
height and wedth 320 x 240 (the camera kinda forces this to be 640 x 480 but again i tried 320 x 240 in zone minder)


i cant think of much more info you could need to help me sort this out lol

ok so the problem:

when i click on the monitier name i get the monitier screen but there is no picture (the broken picture symbol but no picture ) on the ps3 eye theres two lights blue (meaning powered) and red(meaning active) no matter what i set zoneminder to the redlight never comes on (with "motion" and vlc it comes on)

im stuck and this post has officialy taken me more time to write then it did to get stuck lol

**************************edit****************
i noticed on another thread some one else getting no video was asked to try a command (zmu -d /dev/video0 -q) i gave it a try and it said Aborted i tried "zmu" by itself and also got "Aborted"
************************edit 2************************

i was trying chrome

just tried internet explorer and got a black square instead of the no picture symbol but still no red light on the camera so im convinced its just not connecting to it right

**********************edit 3*************************
just tried accessing it from my mobile phones browser (a lg arena) and get the same black square though i have to admit the monitier screen is set out perfect on my phones screen ! this programme is exactly what i have been looking for (well will be when i can get the camera to work lol)
*********************edit 4****************************
just spent over an hour going through different settings but still no joy, im out of options so now im just waiting for your replies :)
mrgreaper
Posts: 14
Joined: Tue Aug 19, 2008 2:08 pm

Post by mrgreaper »

Really need to get this sorted out today and im now at the end of what i can think off

i did set the motion program to make a snap shot every second and save it as one file (is that bad for the hard drive ? saving a file every second?) the files absolute path was /var/www/m/snapshot-1.jpg

i then instructed zoneminder to use file method and placed the source as /var/www/m/snapshot-1.jpg

didnt work

i then tried to set zone minder to remote and gave it the url of localhost
port 8001 (if i goto localhost:8001 i get a jpg image of the webcam from motion but only in a web browser not on my phone)
this didnt work zone minder displayed nothing! i fiddled with the settings changing localhost for my machines lan ip my internet ip and even my dynamic redirect i tried leaving host path blank as well


surely if the camera works in vlc and motion then it will work in zone minder? i can see replies to other posts from user zoneminder so i know you guys are active but i dont understand why this thread is not getting any assistence
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

try posting/looking at logs you will get more help.

Generic Help:
have you tried zmfix
have you set the shared memory

see documentation in the wiki
mrgreaper
Posts: 14
Joined: Tue Aug 19, 2008 2:08 pm

Post by mrgreaper »

from zmdc log

Code: Select all

05/14/09 23:54:44.730928 zmdc[3294].INF [Starting pending process, zmc -d /dev/video]
05/14/09 23:54:44.737005 zmdc[3294].INF ['zmc -d /dev/video' starting at 09/05/14 23:54:44, pid = 24791]
05/14/09 23:54:44.781256 zmdc[3294].ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
05/14/09 23:54:45.000272 zmdc[3294].WAR [Can't find process with command of 'zma -m 4']
05/14/09 23:54:49.067027 zmdc[3294].INF [Starting pending process, zmc -d /dev/video]
05/14/09 23:54:49.068634 zmdc[3294].INF ['zmc -d /dev/video' starting at 09/05/14 23:54:49, pid = 24803]
05/14/09 23:54:49.118186 zmdc[3294].ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
05/14/09 23:54:59.036899 zmdc[3294].INF [Starting pending process, zmc -d /dev/video]
05/14/09 23:54:59.044300 zmdc[3294].INF ['zmc -d /dev/video' starting at 09/05/14 23:54:59, pid = 24807]
05/14/09 23:54:59.088400 zmdc[3294].ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
05/14/09 23:55:19.040224 zmdc[3294].INF [Starting pending process, zmc -d /dev/video]
05/14/09 23:55:19.046297 zmdc[3294].INF ['zmc -d /dev/video' starting at 09/05/14 23:55:19, pid = 24817]
05/14/09 23:55:19.088475 zmdc[3294].ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
from zmwatch log

Code: Select all

05/14/09 23:56:41.654793 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory]
05/14/09 23:56:51.655969 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory]
05/14/09 23:57:01.657750 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory]
05/14/09 23:57:11.658936 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory]
05/14/09 23:57:21.660111 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory]
05/14/09 23:57:31.661322 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory]
05/14/09 23:57:41.662525 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory]
05/14/09 23:57:51.663731 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory]
05/14/09 23:58:01.664927 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory]
05/14/09 23:58:11.666122 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory]
from debug log

Code: Select all

05/14/09 23:59:06.051799 zmc_dvideo0[24908].INF-zm_debug.c/292 [New Debug Level = 0, New Debug Log = /tmp/zm_debug.log.24908]
05/14/09 23:59:06.052103 zmc_dvideo0[24908].ERR-zmc.cpp/182 [No monitors found]
the thing is i dont know what im looking at? zmfix according to the wiki sets up permisions for the the video devices but if they work in vlc and motion then the permisions must be right?

to someone that is not a linux user the logs were hard to find let alone understand

all i want is to know that if the burglers that have been targeting my neighbourhood recently break in i have thier faces setting in my email folder and that i can check my camera when ever i want and know im still safe. i really have tried to provide as much info as im able to give i have spent several hours on google looking for a solution, you only have to look at the times the edits where done for proof of that please i really want to get this up and running


****************************edit 1******************
im reading up on shared memory as i type (i have 3gigs of ram)
cat /proc/sys/kernel/shmall gives me 2097152

cat /proc/sys/kernel/shmmax gives me 33554432

i attempted echo 134217728 >/proc/sys/kernel/shmmax but permission was denied (even with sudo before it (which i gather is spose to overwrite all permissions))

****************edit 2****************************************
in desperation i have completly removed zoneminder 1.24.1 and am now installing 1.23.3 (from synaptic package manager)

well i have lost the option for v4l2 and get the following ;
in zmwatch.conf

Code: Select all

15/05/09 00:27:22.610050 zmwatch[26046].INF [Restarting capture daemon for New, shared memory not valid]
15/05/09 00:27:22.905788 zmwatch[26046].INF ['zmc -d /dev/video' starting at 09/05/15 00:27:22, pid = 26254]
15/05/09 00:27:32.907217 zmwatch[26046].ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]
15/05/09 00:27:32.907593 zmwatch[26046].INF [Restarting capture daemon for New, shared memory not valid]
15/05/09 00:27:33.197678 zmwatch[26046].INF ['zmc -d /dev/video' starting at 09/05/15 00:27:33, pid = 26256]
in zmdc.log

Code: Select all

15/05/09 00:29:02.002408 zmdc[26017].INF [Starting pending process, zmc -d /dev/video0]
15/05/09 00:29:02.009340 zmdc[26017].INF ['zmc -d /dev/video0' starting at 09/05/15 00:29:02, pid = 26282]
15/05/09 00:29:02.046597 zmdc[26017].ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]
15/05/09 00:29:05.837067 zmdc[26017].INF ['zmc -d /dev/video' starting at 09/05/15 00:29:05, pid = 26284]
15/05/09 00:29:05.879921 zmdc[26017].ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
15/05/09 00:29:16.127278 zmdc[26017].INF ['zmc -d /dev/video' starting at 09/05/15 00:29:16, pid = 26286]
15/05/09 00:29:16.171201 zmdc[26017].ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
15/05/09 00:29:26.429857 zmdc[26017].INF ['zmc -d /dev/video' starting at 09/05/15 00:29:26, pid = 26291]
15/05/09 00:29:26.470144 zmdc[26017].ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
ARGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

if permsions are the prob (it looks like it to me)

Explaining permissions:
Ok in linux there are way to many users to count each with there own jobs.
so you might have the user "video" which controls all video devices
and then the user "bob" might be added to the video group. Which in turn gives him the rights to access the video feed. How ever another user "Kim" still has no acces to the video device because she is not in that "video" group.

things like apache has its own user also most of the time it is httpd, or apache

to figure out how yours is setup
sudo cat /etc/group

also adding | grep video at the end of the comand will help you search video is the word you searching for

Ex:
sudo cat /etc/group | grep video


so try zmfix from the comand line and/or
useradd -G video httpd
or
useradd -G video apache

if you need clarification just ask
Last edited by kingofkya on Fri May 15, 2009 12:45 am, edited 1 time in total.
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

also for shared memory try

sudo nano /etc/sysctl.conf
then reboot

also don't worry about understanding the logs you will get it it took me about a 1 year
mrgreaper
Posts: 14
Joined: Tue Aug 19, 2008 2:08 pm

Post by mrgreaper »

i went back to the 1.24.1 release (so i could use v4l2 again)

in the zoneminder conf file www-data is the user
sudo cat /etc/group | grep video generated this resault;

video:x:44:motion,www-data,httpd,apache

sudo nano /etc/sysctl.conf

just loaded up the file into like a editor

so i adjusted it to sudo gedit /etc/sysctl.conf

as im more familier with that application and had a look at the file, everything in it is commented out and i cant see memory mentioned(but its 3am and i am sleepy lol)

so far still a no go :( is it possible the camera simply wont work with zoneminder (cant see that myself as its ok in motion and vlc) and zoneminder 1.24.1 has v4l2

i also ran sudo zmfix (i tried zmfix by itself but it replied aborted)

your help is VERY appreciated by the way
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

ok just put in
in sysctr.conf

kernel.shmall = 268424446
kernel.shmmax = 268424446

it will override the default settings in ubuntu.

then reboot and run

ipcs -l

To check your shared memory settings were set:

also i just notice on the logs you posted the is most likely that you don't have enough shared memory allocated

Code: Select all

05/14/09 23:57:11.658936 zmwatch[3324].ERR [Can't get shared memory id '7a6d0004', 4: No such file or directory] 

also if you need it http://www.zoneminder.com/wiki/index.ph ... esolutions.
[/code]

Edit: also to use xmfix you must be root so try it with sudo in front
mrgreaper
Posts: 14
Joined: Tue Aug 19, 2008 2:08 pm

Post by mrgreaper »

ips -l =

Code: Select all

----- Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 262133
max total shared memory (kbytes) = 1073697784
min seg size (bytes) = 1

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

------ Messages: Limits --------
max queues system wide = 1672
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384

after i edited the file

i now have a sort off success theres video but its corrupt (hard to describe kinda blocky and all askew im now about to try every combination off pallatte settings etc and will edit this with the end resault :) (thank you so much i can finaly see a possible good outcome!)

****************edit 1********************
Right success !
i set the Capture Palette to yuyv and i got a clear picture the brightness is a bit off but hey its working (the live feed monitier showed 30.8fps though it seems to only update it once every 10 seconds going by the time stamps im guessing this is normal)
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

at the top set it to high speed rather than low and it will go faster


good to here its working for you
davidea
Posts: 4
Joined: Fri May 15, 2009 9:21 pm
Location: italy

Post by davidea »

mrgreaper wrote:from zmdc log

Code: Select all

05/14/09 23:54:44.730928 zmdc[3294].INF [Starting pending process, zmc -d /dev/video]
05/14/09 23:54:44.737005 zmdc[3294].INF ['zmc -d /dev/video' starting at 09/05/14 23:54:44, pid = 24791]
05/14/09 23:54:44.781256 zmdc[3294].ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
05/14/09 23:54:45.000272 zmdc[3294].WAR [Can't find process with command of 'zma -m 4']

[/quote]

you are trying  to use de /dev/video but your camera is /dev/video0 , you have missed a number in the setup!
put the number and repost the same log!
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

read then reply davidea
Locked