Motion - Feature Request 2007x 11x 19x 032318

Feature Request: Choose V4L2 palette

Description

Some webcams and capture cards support many palettes to capture from, righ now motion automatically does selection. There're users that wants to use a different palette that motion selects. So adding a new parameter to motion.conf user will be able to set a preferable palette.

-- AngelCarpintero - 19 Nov 2007

Follow up

motion.conf looks like :

# v4l2_palette allow to choose preferable palette to be use by motion
# to capture from those supported by your videodevice. ( default: 8)
# i.ex if your videodevice supports V4L2_PIX_FMT_SBGGR8 and
# V4L2_PIX_FMT_MJPEG by default motion will use V4L2_PIX_FMT_MJPEG so
# set v4l2_palette 1 to force motion use V4L2_PIX_FMT_SBGGR8 instead. 
#
# Values :
#
# V4L2_PIX_FMT_SN9C10X : 0  'S910'
# V4L2_PIX_FMT_SBGGR8  : 1  'BA81'
# V4L2_PIX_FMT_MJPEG   : 2  'MJPEG'
# V4L2_PIX_FMT_JPEG    : 3  'JPEG'
# V4L2_PIX_FMT_RGB24   : 4  'RGB3'
# V4L2_PIX_FMT_UYVY    : 5  'UYVY'
# V4L2_PIX_FMT_YUYV    : 6  'YUYV'
# V4L2_PIX_FMT_YUV422P : 7  '422P'
# V4L2_PIX_FMT_YUV420  : 8  'YU12'
v4l2_palette 8

If user choose a palette that it's not supported then motion behaviour is the same as before of introduce this feature :

- tests supported palettes

- Try V4L1

Included since svn -r266

-- AngelCarpintero - 19 Nov 2007

Comments

hmm, I get the following otuput:
Nov 24 21:42:47 wormhole motion: [2] 0: GREY (8 bpp, gray)
Nov 24 21:42:47 wormhole motion: [2] 1: HI24 (8 bpp, dithered color)
Nov 24 21:42:47 wormhole motion: [2] 2: RGBO (15 bpp RGB, le)
Nov 24 21:42:47 wormhole motion: [2] 3: RGBQ (15 bpp RGB, be)
Nov 24 21:42:47 wormhole motion: [2] 4: RGBP (16 bpp RGB, le)
Nov 24 21:42:47 wormhole motion: [2] 5: RGBR (16 bpp RGB, be)
Nov 24 21:42:47 wormhole motion: [2] 6: BGR3 (24 bpp RGB, le)
Nov 24 21:42:47 wormhole motion: [2] 7: BGR4 (32 bpp RGB, le)
Nov 24 21:42:47 wormhole motion: [2] 8: RGB4 (32 bpp RGB, be)
Nov 24 21:42:47 wormhole motion: [2] 9: YUYV (4:2:2, packed, YUYV)
Nov 24 21:42:47 wormhole motion: [2] 10: YUYV (4:2:2, packed, YUYV)
Nov 24 21:42:47 wormhole motion: [2] 11: UYVY (4:2:2, packed, UYVY)
Nov 24 21:42:47 wormhole motion: [2] 12: 422P (4:2:2, planar, Y-Cb-Cr)
Nov 24 21:42:47 wormhole motion: [2] 13: YU12 (4:2:0, planar, Y-Cb-Cr)
Nov 24 21:42:47 wormhole motion: [2] 14: YV12 (4:2:0, planar, Y-Cr-Cb)
Nov 24 21:42:47 wormhole motion: [2] 15: 411P (4:1:1, planar, Y-Cb-Cr)
Nov 24 21:42:47 wormhole motion: [2] 16: YUV9 (4:1:0, planar, Y-Cb-Cr)
Nov 24 21:42:47 wormhole motion: [2] 17: YVU9 (4:1:0, planar, Y-Cr-Cb)
Nov 24 21:42:47 wormhole motion: [2] index_format 8 Test palette YU12 (704x576)
Nov 24 21:42:47 wormhole motion: [2] Using palette YU12 (704x576) bytesperlines 704 sizeimage 608256 colorspace 00000000
allthough option ist set to 4 = RGB3 accordint to the table above; In my output, there is only a "BGR3" instead of "RGB3" - does this mean something?

-- AxelAmthor - 24 Nov 2007

I'm curious about all this too, I think I'm having PCI bandwidth problems at PAL resolution, and reading the spec sheet for the chips, it says: "The SAA7130HL offers a multitude of formats to write video streams over the PCI-bus: YUV and RGB color space, 15-bit, 16-bit, 24-bit and 32-bit representation, packed and planar formats".

Looking at the output of v4l-info and http://www.fourcc.org/indexyuv.htm it's all very confusing and many things don't really match up smile

Should I bother with packed YUV formats or RGB? - What kind of effect will this have on cpu load? - I've read YV12 is preferred by mpeg encoders, is it the same as YU12? - Anything less bandwidth demanding than YU12?

-- RomanGaufman - 03 Jun 2008

Motion uses YUV420 planer (YU12) internally. If your camera driver supports this it is by far the most optimal as this means Motion does not have to spend CPU cycle on an extra conversion.

-- KennethLavrsen - 03 Jun 2008
Topic revision: r5 - 03 Jun 2008, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.