Motion - Support Question 2013x 07x 12x 082230

Autobrightness does not work on two USB cameras

Question

In my Kmotion server I have 2 USB camera's. On startup I can see some color-setting changing but the brighness is not adjusted. In /etc/motion/motion.conf the setting "auto_brightness on" and i tried several values for "brightness". Both camera's seem to stay in fixed sensitivity. In the logfile /home/robbert./kmotion/www/motion_out the parameter ("Brightness", default 72, current 72) does not react on any brightness parameter in de motion.conf file nor if I physically cover this camera from light.

The quickcam pro is that sensible it only shows a white screen in daylight;-(

I cannot find errors in /var/log/dmesg with the cameras.

file: /etc/motion/motion.conf
<VERBATIM>
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion 3.2.12


############################################################
# Daemon
############################################################

# Start in daemon (background) mode and release terminal (default: off)
# File to store the process ID, also called pid file. (default: not defined)
process_id_file /var/run/motion/motion.pid

# Start in Setup-Mode, daemon disabled. (default: off)
###########################################################
# Capture device options
############################################################
# to capture from those supported by your videodevice. (default: 8)
# E.g. if your videodevice supports both V4L2_PIX_FMT_SBGGR8 and
# V4L2_PIX_FMT_MJPEG then motion will by default use V4L2_PIX_FMT_MJPEG.
# Setting v4l2_palette to 1 forces motion to 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'

# This is ONLY used for FreeBSD. Leave it commented out for Linux
; tunerdevice /dev/tuner0

# The video input to be used (default: 8)
# Should normally be set to 0 or 1 for video/TV cards, and 8 for USB cameras
input 8

# The video norm to use (only for video capture and TV tuner cards)
# Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
norm 0

# The frequency to set the tuner to (kHz) (only for TV tuner cards) (default: 0)
frequency 0

# Rotate image this number of degrees. The rotation affects all saved images as
# well as mpeg movies. Valid values: 0 (default = no rotation), 90, 180 and 270.
rotate 0

# Image width (pixels). Valid range: Camera dependent, default: 352
width 640

# Image height (pixels). Valid range: Camera dependent, default: 288
height 480

# Maximum number of frames to be captured per second.
# Valid range: 2-100. Default: 100 (almost no limit).
framerate 10

# Minimum time in seconds between capturing picture frames from the camera.
# Default: 0 = disabled - the capture rate is given by the camera framerate.
# This option is used when you want to capture images at a rate lower than 2 per
 second.
minimum_frame_time 0

# URL to use if you are using a network camera, size will be autodetected (incl
http:// ftp:// or file:///)
# Must be a URL that returns single jpeg pictures or a raw mjpeg stream. Default
: Not defined
; netcam_url value

# Username and password for network camera (only if required). Default: not defi
ned
# Syntax is user:password
; netcam_userpass value

# The setting for keep-alive of network socket, should improve performance on co
mpatible net cameras.
# 1.0:         The historical implementation using HTTP/1.0, closing the socket
after each http request.
# keep_alive:  Use HTTP/1.0 requests with keep alive header to reuse the same co
nnection.
# 1.1:         Use HTTP/1.1 requests that support keep alive as default.
# Default: 1.0
; netcam_http 1.0

# URL to use for a netcam proxy server, if required, e.g. "http://myproxy".
# If a port number other than 80 is needed, use "http://myproxy:1234".
# Default: not defined
; netcam_proxy value

# Set less strict jpeg checks for network cameras with a poor/buggy firmware.
# Default: off
netcam_tolerant_check off

# Let motion regulate the brightness of a video device (default: off).
# The auto_brightness feature uses the brightness option as its target value.
# If brightness is zero auto_brightness will adjust to average brightness value
128.
# Only recommended for cameras without auto brightness
auto_brightness on

# Set the initial brightness of a video device.
# If auto_brightness is enabled, this value defines the average brightness level
# which Motion will try and adjust to.
# Valid range 0-255, default 0 = disabled
brightness 5

# Set the contrast of a video device.
# Valid range 0-255, default 0 = disabled
contrast  0

# Set the saturation of a video device.
# Valid range 0-255, default 0 = disabled
saturation 0

# Set the hue of a video device (NTSC feature).
# V1lid range 0-255, default 0 = disabled
hue 0


############################################################
# Round Robin (multiple inputs on same video device name)
############################################################

# Number of frames to capture in each roundrobin step (default: 2)

</VERBATIM>

file: /home/robbert./kmotion/core/motion_conf
<VERBATIM>

# ------------------------------------------------------------------------------
# This config file has been automatically generated by kmotion
# Do __NOT__ modify it in any way.
# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# 'default' section
# ------------------------------------------------------------------------------

quiet on

# ------------------------------------------------------------------------------
# 'user' section from 'virtual_motion_conf/motion.conf'
# ------------------------------------------------------------------------------

# Virtual motion configuration for advanced users. The content of this file
# is inserted into the 'real' motion configuration file by kmotion before
# the motion demon is started.

# The 'real' motion configuration can be viewed at '../core/motion_conf' after
# a 'kmotion restart'.


# ------------------------------------------------------------------------------
# 'override' section
# ------------------------------------------------------------------------------

daemon off
control_port 8080
control_localhost on

thread /home/robbert/kmotion/core/motion_conf/thread01.conf

thread /home/robbert/kmotion/core/motion_conf/thread02.conf

</VERBATIM>

file: /home/robbert./kmotion/core/thread01_conf
<VERBATIM>
# ------------------------------------------------------------------------------
# This config file has been automatically generated by kmotion
# Do __NOT__ modify it in any way.
# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# 'default' section
# ------------------------------------------------------------------------------

gap 2
pre_capture 1
post_capture 16

# ------------------------------------------------------------------------------
# 'user' section from 'virtual_motion_conf/thread01.conf'
# ------------------------------------------------------------------------------

# Virtual motion configuration for advanced users. The content of this file
# is inserted into the 'real' motion configuration file by kmotion before
# the motion demon is started.

# The 'real' motion configuration can be viewed at '../core/motion_conf' after
# a 'kmotion restart'.

# ------------------------------------------------------------------------------
# 'override' section
# ------------------------------------------------------------------------------

ffmpeg_video_codec swf
snapshot_interval 1
webcam_localhost on

target_dir /home/robbert/kmotion/www/virtual_ramdisk
videodevice /dev/video0
input 8
width 640
height 480
quality 100
locate on
framerate 5
output_normal off
ffmpeg_bps 400000
ffmpeg_cap_new on

mask_file /home/robbert/kmotion/core/masks/mask01.pgm
jpeg_filename ../../../../../../home/robbert/kmotion/images_dbase/%Y%m%d/01/smov
ie/%H%M%S/%q
movie_filename ../../../../../../home/robbert/kmotion/images_dbase/%Y%m%d/01/mov
ie/%H%M%S
snapshot_filename 01/%Y%m%d%H%M%S
on_movie_end echo '$%H%M%S' >> /home/robbert/kmotion/images_dbase/%Y%m%d/01/movi
e_journal
on_event_start /home/robbert/kmotion/core/event_start.py 1
on_event_end /home/robbert/kmotion/core/event_end.py 1
on_picture_save echo %f > /home/robbert/kmotion/www/virtual_ramdisk/01/last_jpeg

</VERBATIM>

file: /home/robbert./kmotion/core/thread02_conf
<VERBATIM>
# ------------------------------------------------------------------------------
# This config file has been automatically generated by kmotion
# Do __NOT__ modify it in any way.
# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# 'default' section
# ------------------------------------------------------------------------------

gap 2
pre_capture 1
post_capture 16

# ------------------------------------------------------------------------------
# 'user' section from 'virtual_motion_conf/thread02.conf'
# ------------------------------------------------------------------------------

# Virtual motion configuration for advanced users. The content of this file
# is inserted into the 'real' motion configuration file by kmotion before
# the motion demon is started.

# The 'real' motion configuration can be viewed at '../core/motion_conf' after
# a 'kmotion restart'.

# ------------------------------------------------------------------------------
# 'override' section
# ------------------------------------------------------------------------------

ffmpeg_video_codec swf
snapshot_interval 1
webcam_localhost on

target_dir /home/robbert/kmotion/www/virtual_ramdisk
videodevice /dev/video1
input 8
width 640
height 480
quality 100
locate on
framerate 5
output_normal off
ffmpeg_bps 400000
ffmpeg_cap_new on

mask_file /home/robbert/kmotion/core/masks/mask02.pgm
jpeg_filename ../../../../../../home/robbert/kmotion/images_dbase/%Y%m%d/02/smov
ie/%H%M%S/%q
movie_filename ../../../../../../home/robbert/kmotion/images_dbase/%Y%m%d/02/mov
ie/%H%M%S
snapshot_filename 02/%Y%m%d%H%M%S
on_movie_end echo '$%H%M%S' >> /home/robbert/kmotion/images_dbase/%Y%m%d/02/movi
e_journal
on_event_start /home/robbert/kmotion/core/event_start.py 2
on_event_end /home/robbert/kmotion/core/event_end.py 2
on_picture_save echo %f > /home/robbert/kmotion/www/virtual_ramdisk/02/last_jpeg
</VERBATIM>

file: /home/robbert./kmotion/www/motion_out
<VERBATIM>

[0] Processing thread 0 - config file /home/robbert/kmotion/core/motion_conf/mot
ion.conf
[0] Processing config file /home/robbert/kmotion/core/motion_conf/thread01.conf
[0] Processing config file /home/robbert/kmotion/core/motion_conf/thread02.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3482112 LIBAVFORMAT_BUILD 3478528
[0] Thread 1 is from /home/robbert/kmotion/core/motion_conf/thread01.conf
[0] Thread 2 is from /home/robbert/kmotion/core/motion_conf/thread02.conf
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[2] Thread 2 started
[2] cap.driver: "pwc"
[2] cap.card: "Logitech QuickCam Pro 4000"
[2] cap.bus_info: "usb-0000:00:1d.0-1"
[2] cap.capabilities=0x05000001
[2] - VIDEO_CAPTURE
[2] - READWRITE
[2] - STREAMING
[2] Test palette YU12 (640x480)
[1] Thread 1 started
[2] Using palette YU12 (640x480) bytesperlines 960 sizeimage 460800 colorspace 0
0000000
[2] found control 0x00980900, "Brightness", range 0,127
[2]     "Brightness", default 72, current 72
[2] found control 0x00980901, "Contrast", range 0,63
[2]     "Contrast", default 32, current 32
[2] found control 0x00980902, "Saturation", range -100,100
[2]     "Saturation", default 0, current 0
[2] found control 0x0098090e, "Red Balance", range 0,255
[2]     "Red Balance", default 65, current 79
[2] found control 0x0098090f, "Blue Balance", range 0,255
[2]     "Blue Balance", default 65, current 19
[2] found control 0x00980910, "Gamma", range 0,31
[2]     "Gamma", default 18, current 18
[2] found control 0x00980911, "Exposure", range 0,255
[2]     "Exposure", default 213, current 213
[2] found control 0x00980912, "Gain, Automatic", range 0,1
[2]     "Gain, Automatic", default 0, current 0
[2] found control 0x00980913, "Gain", range 0,63
[2]     "Gain", default 45, current 45
[2] found control 0x08000000, "Auto contour", range 0,1
[2]     "Auto contour", default 0, current 0
[2] found control 0x08000001, "Contour", range 0,63
[2]     "Contour", default 32, current 32
[2] mmap information:
[2] frames=4
[2] 0 length=462848
[2] 1 length=462848
[2] 2 length=462848
[2] 3 length=462848
[2] Using V4L2
[2] Resizing pre_capture buffer to 1 items
[1] cap.driver: "uvcvideo"
[1] cap.card: "Microsoft LifeCam VX-800"
[1] cap.bus_info: "usb-0000:00:1d.7-3"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] Selected palette YUYV
[1] Test palette YUYV (640x480)
[1] Using palette YUYV (640x480) bytesperlines 1280 sizeimage 614400 colorspace
00000000
[1] found control 0x00980900, "Brightness", range -10,10
[1]     "Brightness", default 2, current 2
[1] found control 0x00980901, "Contrast", range 0,20
[1]     "Contrast", default 10, current 10
[1] found control 0x00980902, "Saturation", range 0,10
[1]     "Saturation", default 4, current 4
[1] found control 0x00980903, "Hue", range -5,5
[1]     "Hue", default 0, current 0
[1] found control 0x00980910, "Gamma", range 100,200
[1]     "Gamma", default 130, current 130
[1] found control 0x00980913, "Gain", range 32,48
[1]     "Gain", default 34, current 34
[1] mmap information:
[1] frames=4
[1] 0 length=614400
[1] 1 length=614400
[1] 2 length=614400
[1] 3 length=614400
[1] Using V4L2
[1] Resizing pre_capture buffer to 1 items
[1] Resizing pre_capture buffer to 2 items
[2] Resizing pre_capture buffer to 2 items


</VERBATIM>

Environment

Motion version: 3.2.12
ffmpeg version: 0.8.6-4:0.8.6-0ubuntu0.12.04.1
Libraries: ffmpeg, mysql, postgresql
Server OS: Ubuntu 12.04
-- RobbertBen - 12 Jul 2013

Answer

SupportForm edit

TopicTitle Autobrightness does not work on two USB cameras
SupportStatus AskedQuestions
AssignedQuestionTo
SubmittedBy robbertben.WikiGuest
Topic revision: r1 - 12 Jul 2013, RobbertBen
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.