I'm having some issues getting this thing to work on an OpenSuse 11.3 laptop (kernel 2.6.34-12) , ZoneMinder 1.24.2 although I think I'm pretty close. The camera works with vnc, or livcview
zmu only works with the -V1 option (which is kind of odd because from what I was reading around this camera only works with v4l2) Not sure what this is about.
sudo zmu -d /dev/video1 -q -v -V 1
Video Device: /dev/video1
Video Capabilities
Name: UVC Camera (046d:08c2)
Type: 1
Can capture
Video Channels: 1
Audio Channels: 0
Maximum Width: 960
Maximum Height: 720
Minimum Width: 48
Minimum Height: 32
Window Attributes
X Offset: 0
Y Offset: 0
Width: 320
Height: 240
Picture Attributes
Palette: 0 - Unknown
Colour Depth: 0
Brightness: 32639
Hue: 0
Colour :8224
Contrast: 8224
Whiteness: 65535
Channel 0 Attributes
Name: Camera 1
Channel: 0
Flags: 0
Type: 2 - Camera
Format: 0 - PAL
I can set a monitor with it, and the source shows /dev/video1 (0) in orange, so as far as ZM is concerned it knows about the camera and has some level of communication with it.
In the source popup for the monitor, I set
Device Path: /dev/video1
Capture Method: Video for linux version 1
Device channel: 0
Device format: PAL
Capture Palette: YUV422P
Width and Height: 960x720
Orientation: Normal
The monitor window doesn't show anything, and my log keep showing me this message:
ul 19 21:11:02 linux-5s5j sudo: tpc : TTY=pts/8 ; PWD=/home/tpc/Downloads/ZoneMinder-1.24.2 ; USER=root ; COMMAND=/usr/local/bin/zmu -d /dev/video1 -q -v -V 1
Jul 19 21:12:13 linux-5s5j zmdc[8505]: INF [Starting pending process, zmc -d /dev/video1]
Jul 19 21:12:13 linux-5s5j zmdc[8505]: INF ['zmc -d /dev/video1' starting at 10/07/19 21:12:13, pid = 8679]
Jul 19 21:12:13 linux-5s5j zmdc[8679]: INF ['zmc -d /dev/video1' started at 10/07/19 21:12:13]
Jul 19 21:12:13 linux-5s5j zmc_dvideo1[8679]: INF [Debug Level = 0, Debug Log = <none>]
Jul 19 21:12:13 linux-5s5j zmc_dvideo1[8679]: INF [Starting Capture]
Jul 19 21:12:13 linux-5s5j zmc_dvideo1[8679]: ERR [Failed to set picture attributes: Invalid argument]
Jul 19 21:12:13 linux-5s5j kernel: [163602.705083] uvcvideo: Failed to query (1) UVC control 9 (unit 2) : -110 (exp. 2).
Jul 19 21:12:13 linux-5s5j zmdc[8505]: ERR ['zmc -d /dev/video1' exited abnormally, exit status 255]
If I change the capture method to v4l version 2, I get this in the log:
Jul 19 21:20:49 linux-5s5j zmdc[8505]: INF [Starting pending process, zmc -d /dev/video1]
Jul 19 21:20:49 linux-5s5j zmdc[8505]: INF ['zmc -d /dev/video1' starting at 10/07/19 21:20:49, pid = 8773]
Jul 19 21:20:49 linux-5s5j zmdc[8773]: INF ['zmc -d /dev/video1' started at 10/07/19 21:20:49]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: INF [Debug Level = 0, Debug Log = <none>]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: INF [Starting Capture]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: FAT [Failed to set video format: Invalid argument]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: INF [Got signal 6 (Aborted), exiting and forcing backtrace]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: ERR [Signal address is (nil), from 0xffffe424]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: ERR [Backtrace: [0xffffe424]]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: ERR [Backtrace: [0xffffe424]]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: ERR [Backtrace: /lib/libc.so.6(gsignal+0x4f) [0xb621a7ff]]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: ERR [Backtrace: /lib/libc.so.6(abort+0x180) [0xb621c140]]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: ERR [Backtrace: /usr/local/bin/zmc() [0x805750d]]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: ERR [Backtrace: /usr/local/bin/zmc() [0x8066b58]]
Jul 19 21:20:49 linux-5s5j zmc_dvideo1[8773]: ERR [Backtrace: /usr/local/bin/zmc() [0x806bb5b]]
.... more backtrace ...
I'm not sure where to go from there. I've tried to run zmc from the command line, but it does nothing (no error message, no nothing) no matter what argument I try to give it.
Thanks for any suggestion.
logitech orbit with 1.24.2?
more info
Here's something odd: The result of v4l-info shows that this is really a v4l2 device. There isn't much available with v4l version 1.
I'm starting to wonder if somehow I compiled ZoneMinder wrong since I get that signal 6 when trying to set the interface to version 2...
sudo v4l-info /dev/video1
ioctl VIDIOCGTUNER: Invalid argument
ioctl VIDIOCGAUDIO: Invalid argument
ioctl VIDIOCGFBUF: Invalid argument
### v4l2 device info [/dev/video1] ###
general info
VIDIOC_QUERYCAP
driver : "uvcvideo"
card : "UVC Camera (046d:08c2)"
bus_info : "usb-0000:00:1d.7-3"
version : 0.1.0
capabilities : 0x4000001 [VIDEO_CAPTURE,STREAMING]
standards
inputs
VIDIOC_ENUMINPUT(0)
index : 0
name : "Camera 1"
type : CAMERA
audioset : 0
tuner : 0
std : 0x0 []
status : 0x0 []
video capture
VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
index : 0
type : VIDEO_CAPTURE
flags : 1
description : "MJPEG"
pixelformat : 0x47504a4d [MJPG]
VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)
index : 1
type : VIDEO_CAPTURE
flags : 0
description : "YUV 4:2:2 (YUYV)"
pixelformat : 0x56595559 [YUYV]
VIDIOC_G_FMT(VIDEO_CAPTURE)
type : VIDEO_CAPTURE
fmt.pix.width : 320
fmt.pix.height : 240
fmt.pix.pixelformat : 0x47504a4d [MJPG]
fmt.pix.field : NONE
fmt.pix.bytesperline : 0
fmt.pix.sizeimage : 61440
fmt.pix.colorspace : SRGB
fmt.pix.priv : 0
controls
VIDIOC_QUERYCTRL(BASE+0)
id : 9963776
type : INTEGER
name : "Brightness"
minimum : 0
maximum : 255
step : 1
default_value : 127
flags : 0
VIDIOC_QUERYCTRL(BASE+1)
id : 9963777
type : INTEGER
name : "Contrast"
minimum : 0
maximum : 255
step : 1
default_value : 32
flags : 0
VIDIOC_QUERYCTRL(BASE+2)
id : 9963778
type : INTEGER
name : "Saturation"
minimum : 0
maximum : 255
step : 1
default_value : 32
flags : 0
### video4linux device info [/dev/video1] ###
general info
VIDIOCGCAP
name : "UVC Camera (046d:08c2)"
type : 0x1 [CAPTURE]
channels : 1
audios : 0
maxwidth : 960
maxheight : 720
minwidth : 48
minheight : 32
channels
VIDIOCGCHAN(0)
channel : 0
name : "Camera 1"
tuners : 0
flags : 0x0 []
type : CAMERA
norm : 0
tuner
audio
picture
VIDIOCGPICT
brightness : 32639
hue : 0
colour : 8224
contrast : 8224
whiteness : 65535
depth : 0
palette : unknown
buffer
window
VIDIOCGWIN
x : 0
y : 0
width : 320
height : 240
chromakey : 0
flags : 0
I'm starting to wonder if somehow I compiled ZoneMinder wrong since I get that signal 6 when trying to set the interface to version 2...
sudo v4l-info /dev/video1
ioctl VIDIOCGTUNER: Invalid argument
ioctl VIDIOCGAUDIO: Invalid argument
ioctl VIDIOCGFBUF: Invalid argument
### v4l2 device info [/dev/video1] ###
general info
VIDIOC_QUERYCAP
driver : "uvcvideo"
card : "UVC Camera (046d:08c2)"
bus_info : "usb-0000:00:1d.7-3"
version : 0.1.0
capabilities : 0x4000001 [VIDEO_CAPTURE,STREAMING]
standards
inputs
VIDIOC_ENUMINPUT(0)
index : 0
name : "Camera 1"
type : CAMERA
audioset : 0
tuner : 0
std : 0x0 []
status : 0x0 []
video capture
VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
index : 0
type : VIDEO_CAPTURE
flags : 1
description : "MJPEG"
pixelformat : 0x47504a4d [MJPG]
VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)
index : 1
type : VIDEO_CAPTURE
flags : 0
description : "YUV 4:2:2 (YUYV)"
pixelformat : 0x56595559 [YUYV]
VIDIOC_G_FMT(VIDEO_CAPTURE)
type : VIDEO_CAPTURE
fmt.pix.width : 320
fmt.pix.height : 240
fmt.pix.pixelformat : 0x47504a4d [MJPG]
fmt.pix.field : NONE
fmt.pix.bytesperline : 0
fmt.pix.sizeimage : 61440
fmt.pix.colorspace : SRGB
fmt.pix.priv : 0
controls
VIDIOC_QUERYCTRL(BASE+0)
id : 9963776
type : INTEGER
name : "Brightness"
minimum : 0
maximum : 255
step : 1
default_value : 127
flags : 0
VIDIOC_QUERYCTRL(BASE+1)
id : 9963777
type : INTEGER
name : "Contrast"
minimum : 0
maximum : 255
step : 1
default_value : 32
flags : 0
VIDIOC_QUERYCTRL(BASE+2)
id : 9963778
type : INTEGER
name : "Saturation"
minimum : 0
maximum : 255
step : 1
default_value : 32
flags : 0
### video4linux device info [/dev/video1] ###
general info
VIDIOCGCAP
name : "UVC Camera (046d:08c2)"
type : 0x1 [CAPTURE]
channels : 1
audios : 0
maxwidth : 960
maxheight : 720
minwidth : 48
minheight : 32
channels
VIDIOCGCHAN(0)
channel : 0
name : "Camera 1"
tuners : 0
flags : 0x0 []
type : CAMERA
norm : 0
tuner
audio
picture
VIDIOCGPICT
brightness : 32639
hue : 0
colour : 8224
contrast : 8224
whiteness : 65535
depth : 0
palette : unknown
buffer
window
VIDIOCGWIN
x : 0
y : 0
width : 320
height : 240
chromakey : 0
flags : 0
progress?
The call that was crashing zmc when using v4l2 was this in zm_local_camera.cpp:385
if ( vidioctl( vid_fd, VIDIOC_S_FMT, &v4l2_data.fmt ) < 0 )
Fatal( "Failed to set video format: %s", strerror(errno) );
I changed the Fatal to a Warning and now I can use v4l2.
I now get messages like the following in my log:
zmc_dvideo1[8195]: INF [Monitor-6: 9000 - Capturing at 14.93 fps]
zmc_dvideo1[8195]: INF [Monitor-6: 10000 - Capturing at 15.15 fps]
...
But still no image...
if ( vidioctl( vid_fd, VIDIOC_S_FMT, &v4l2_data.fmt ) < 0 )
Fatal( "Failed to set video format: %s", strerror(errno) );
I changed the Fatal to a Warning and now I can use v4l2.
I now get messages like the following in my log:
zmc_dvideo1[8195]: INF [Monitor-6: 9000 - Capturing at 14.93 fps]
zmc_dvideo1[8195]: INF [Monitor-6: 10000 - Capturing at 15.15 fps]
...
But still no image...
getting there...
I looked at the source for the page that displays the image and it shows
var streamSrc = "http://192.168.1.108/cgi-bin/nph-zms?mode=jpeg&monitor=6&scale=100&maxfps=5&buffer=1000
It should be cgi-bin/zm/nph-zms
I used --with-cgidir=/srv/www/cgi-bin/zm and that shows in zm.conf and where things got installed. So I'm not sure why the zm part disappeared...
If I point my browser to the fixed location I get an image. (iIt is garbled but that's the next step)
var streamSrc = "http://192.168.1.108/cgi-bin/nph-zms?mode=jpeg&monitor=6&scale=100&maxfps=5&buffer=1000
It should be cgi-bin/zm/nph-zms
I used --with-cgidir=/srv/www/cgi-bin/zm and that shows in zm.conf and where things got installed. So I'm not sure why the zm part disappeared...
If I point my browser to the fixed location I get an image. (iIt is garbled but that's the next step)
Well that last one is easy to fix: From the zm main web page there is an Options link that lets you specify all kind of stuff. Under the Paths tab there is a PATH_ZMS options which control the path to the zms streaming server.
I'm surprised that's not taken care of with the configure script, but there might ba a valid reason for that?
Also under the Config tab there is a STRICT_VIDEO_CONFIG. From the description, disabling that would make video config errors non-fatal (my issue 2 posts up)
I guess I should read the manual sometimes...
I'm surprised that's not taken care of with the configure script, but there might ba a valid reason for that?
Also under the Config tab there is a STRICT_VIDEO_CONFIG. From the description, disabling that would make video config errors non-fatal (my issue 2 posts up)
I guess I should read the manual sometimes...