by permitivity » Fri Jul 19, 2013 12:30 am
Good idea. I couldn't figure out if the "Palette" option in motion performs this function...I'm not really sure what to call it.
For MJPEG, I picked the value of 2. However, I'm not sure if Motion is actually taking this setting seriously. Below this code block is the output of Motion. See the bold text which I think means it's not using MJPEG - it seems to be using #6, YUYV. But output also seems to indicate that the webcam I'm using (Microsoft HD3000) supports MJPEG, right?
$this->bbcode_second_pass_code('', '
# v4l2_palette allows to choose preferable palette to be use by motion
# 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'
# V4L2_PIX_FMT_YUV420 : 8 'YU12'
v4l2_palette 2
')
$this->bbcode_second_pass_code('', '
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3489124 LIBAVFORMAT_BUILD 3481700
[0] Thread 1 is from /etc/motion/thread1.conf
[0] Thread 2 is from /etc/motion/thread2.conf
[1] Thread 1 started
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[2] Thread 2 started
[1] cap.driver: "uvcvideo"
[1] cap.card: "Microsoft® LifeCam HD-3000"
[1] cap.bus_info: "usb-orion-ehci.0-1.1"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[b][1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)[/b]
[1] Selected palette YUYV
[1] Test palette YUYV (1280x720)
[1] Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 colorspace 00000008
[1] found control 0x00980900, "Brightness", range 30,255
[1] "Brightness", default 133, current 133
[1] found control 0x00980901, "Contrast", range 0,10
[1] "Contrast", default 5, current 5
[1] found control 0x00980902, "Saturation", range 0,200
[1] "Saturation", default 83, current 83
[1] mmap information:
[1] frames=4
[1] 0 length=1843200
[1] 1 length=1843200
[1] 2 length=1843200
[1] 3 length=1843200
[1] Using V4L2
[1] Resizing pre_capture buffer to 1 items
[2] cap.driver: "uvcvideo"
[2] cap.card: "Microsoft® LifeCam HD-3000"
[2] cap.bus_info: "usb-orion-ehci.0-1.4"
[2] cap.capabilities=0x04000001
[2] - VIDEO_CAPTURE
[2] - STREAMING
[2] Config palette index 8 (YU12) doesn't work.
[b][2] Supported palettes:
[2] 0: YUYV (YUV 4:2:2 (YUYV))
[2] 1: MJPG (MJPEG)
[2] Selected palette YUYV[/b]
[b][2] Test palette YUYV (1280x720)[/b]
[b][2] Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 colorspace 00000008[/b]
[2] found control 0x00980900, "Brightness", range 30,255
[2] "Brightness", default 133, current 133
[2] found control 0x00980901, "Contrast", range 0,10
[2] "Contrast", default 5, current 5
[2] found control 0x00980902, "Saturation", range 0,200
[2] "Saturation", default 83, current 83
[2] mmap information:
[2] frames=4
[2] 0 length=1843200
[2] 1 length=1843200
[2] 2 length=1843200
[2] 3 length=1843200
[2] Error starting stream VIDIOC_STREAMON: No space left on device
[2] ioctl (VIDIOCGCAP): Invalid argument
[2] Could not fetch initial image from camera
[2] Motion continues using width and height from config file(s)
[2] Resizing pre_capture buffer to 1 items
')