UVC Video, Get higher Resolution than 320x240 [SOLVED]

Forum for questions and support relating to the 1.24.x releases only.
Locked
spychodelics
Posts: 14
Joined: Sun Jun 28, 2009 9:01 pm

UVC Video, Get higher Resolution than 320x240 [SOLVED]

Post by spychodelics »

Hi there,

i just bought a Philips SPC 1330 NC which is fully supported
under Linux throw the UVCvideo Module. Started some tests,
its all running fine.

The Camera has a Resolution up to 1280x960 and up to 90 fps.



So i read the Wiki

Code: Select all

http://www.zoneminder.com/wiki/index.php/Uvc
And i configured as explained, and its running fine. But i was wondering,
why i couldnt change the Resolution up to 640x480. mjpg-streamer is running
fine in 320x240 and 640x480. VLC and Firefox can grab the Picture.

Why isnt Zoneminder able to work with the higher Resolution.

I also found and read this
Note: Currently the only supported resolution is: 320x240. mjpg_streamer defaults to 640x480, so make sure to declare the necessary resolution when running the program (see below.)
But i am asking my self why and searching for an solution, 320x240 might be deprecated for some newer models.


Would be happy for answers.


Btw i tryed as explained in some other linux forums,

Code: Select all

http://ubuntuforums.org/showthread.php?t=882863
Applying the changes to mjpg-streamer and zoneminder i only do get a
black picture.

Are there any recent changes that makes it easier or replace the mjpg-steamer?

Thanks a lot.
50cc
Posts: 82
Joined: Sun Mar 23, 2008 12:01 pm
Location: The Netherlands

Post by 50cc »

Should be possible, I don't have any experience with USB camera's myself though.

A problem you won't have, which I do, is interlacing. Interlacing problems occure with analog camera's. To compensate you can set your camera's to half of the full resolution.

I use PAL so I have set this to 384 x 288, it's not much but camera's can be higher than 320 x 240 (half of NTSC).

I have also had it working at full PAL, but this is not usefull because of the interlacing.

Important:
After you change resolution it's crucial that you restart ZoneMinder!
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

I'd encourage you to try setting up the camera as a regular v4l2 monitor rather than through mjpeg-steamer. I believe you are using the arch PKGBUILD zoneminder, and it is patched with libv4l support. If you can access the camera directly with zoneminder you will get far better performance, should be able to use any resolution the camera supports, and the load on your system will be far lower for equivilent resolution.

Please keep in mind the above is a semi-educated guess, as I don't have one of these cameras to test. (Equipment donations are always welcome :) )
spychodelics
Posts: 14
Joined: Sun Jun 28, 2009 9:01 pm

Post by spychodelics »

@ 50cc thx i have tried some different settings, but it would work

@rdmelin so you say it could be possible to get an uvc cam working throw v4l2, ive tried some different options but source wont turn into another color than red :-(

But i know discovered that skype isnt running neather. I will go on trying.
spychodelics
Posts: 14
Joined: Sun Jun 28, 2009 9:01 pm

Post by spychodelics »

v4l-info is giving by the way

Code: Select all

### v4l2 device info [/dev/video0] ###
general info
    VIDIOC_QUERYCAP
	driver                  : "uvcvideo"
	card                    : "Philips SPC 1330NC"
	bus_info                : "usb-0000:00:0b.0-4"
	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_G_FMT(VIDEO_CAPTURE)
	type                    : VIDEO_CAPTURE
	fmt.pix.width           : 640
	fmt.pix.height          : 480
	fmt.pix.pixelformat     : 0x47504a4d [MJPG]
	fmt.pix.field           : NONE
	fmt.pix.bytesperline    : 0
	fmt.pix.sizeimage       : 307789
	fmt.pix.colorspace      : SRGB
	fmt.pix.priv            : 0

controls
    VIDIOC_QUERYCTRL(BASE+0)
	id                      : 9963776
	type                    : INTEGER
	name                    : "Brightness"
	minimum                 : -64
	maximum                 : 64
	step                    : 1
	default_value           : 0
	flags                   : 0
    VIDIOC_QUERYCTRL(BASE+1)
	id                      : 9963777
	type                    : INTEGER
	name                    : "Contrast"
	minimum                 : 0
	maximum                 : 64
	step                    : 1
	default_value           : 32
	flags                   : 0
    VIDIOC_QUERYCTRL(BASE+2)
	id                      : 9963778
	type                    : INTEGER
	name                    : "Saturation"
	minimum                 : 0
	maximum                 : 128
	step                    : 1
	default_value           : 64
	flags                   : 0
    VIDIOC_QUERYCTRL(BASE+3)
	id                      : 9963779
	type                    : INTEGER
	name                    : "Hue"
	minimum                 : -40
	maximum                 : 40
	step                    : 1
	default_value           : 0
	flags                   : 0

### video4linux device info [/dev/video0] ###
general info
    VIDIOCGCAP
	name                    : "Philips SPC 1330NC"
	type                    : 0x1 [CAPTURE]
	channels                : 1
	audios                  : 0
	maxwidth                : 1280
	maxheight               : 960
	minwidth                : 48
	minheight               : 32

channels
ioctl VIDIOCGCHAN: Invalid argument

tuner
ioctl VIDIOCGTUNER: Invalid argument

audio
ioctl VIDIOCGAUDIO: Invalid argument

picture
    VIDIOCGPICT
	brightness              : 32768
	hue                     : 32768
	colour                  : 32768
	contrast                : 32768
	whiteness               : 4287
	depth                   : 0
	palette                 : unknown

buffer
ioctl VIDIOCGFBUF: Invalid argument

window
    VIDIOCGWIN
	x                       : 0
	y                       : 0
	width                   : 640
	height                  : 480
	chromakey               : 0
	flags                   : 0
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

@rdmelin so you say it could be possible to get an uvc cam working throw v4l2, ive tried some different options but source wont turn into another color than red
First be sure the device is not being used by another process, ie shut mjpeg-streamer down, and anything else that may be trying to access it. Since last several kernel versions v4l2 doesn't seem to support multiple access to a device. Too bad, it used to work pretty well.

With libv4l compiled in zoneminder can use formats that the device does not support natively. libv4l does format conversion on the fly. So start with something basic like BGR24 (Not RGB24. Doesn't work with v4l2) and 640x480.

Be sure and do a complete restart of zoneminder when changing monitor settings to clear out old shared mem segments. The Arch PKGBUILD uses shared memory rather than mapped (unless you edit the PKGBUILD) so you will still need to pay attention to shmall and shmmax settings for higher resolutions.
spychodelics
Posts: 14
Joined: Sun Jun 28, 2009 9:01 pm

Post by spychodelics »

Hi rdmelin,

thx, ive tried that, and its working, but i cant get a higher resolution than
352x288, so i will try to "pay attention to shmall and shmmax settings for higher resolutions." and inform you over the results later.

thanks to your help, been great support

Code: Select all

cat /proc/sys/kernel/shmall 
2097152

cat /proc/sys/kernel/shmmax
33554432
that should be enough, or do you ment something else?


//EDIT

you r right,

echo 134217728 >/proc/sys/kernel/shmall
echo 134217728 >/proc/sys/kernel/shmmax

solves my problem


and a change of /etc/sysctl.conf to

kernel.shmall = 134217728
kernel.shmmax = 134217728

will load it every bootup.


Thx a lot
Locked