It seems my motion command config will not take complete pictures. It used to take a few tiny ok images, and a garbled image, now after adjusting it to full resolution it takes a large image of garbled blocks:

garbled image

It used to give a message about the wrong pallette type in its log, but I adjusted that to 15 (YUYV) and it doesn't complain about that:

cap.driver: "uvcvideo"
cap.card: "UVC Camera (046d:0825)"
cap.bus_info: "usb-ehci-platform-1.1"
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_get_capability: - VIDEO_CAPTURE
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_get_capability: - STREAMING
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_select_input: name = "Camera 1", type 0x00000002, status 00000000
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_select_input: - CAMERA
[1] [WRN] [VID] [Sep 11 22:24:03] v4l2_select_input: Device doesn't support VIDIOC_G_STD
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_do_set_pix_format: Testing palette YUYV (1280x720)
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_do_set_pix_format: Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 colorspace 00000008
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,255 
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Brightness", default 128, current 128
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980901, "Contrast", range 0,255 
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Contrast", default 32, current 32
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980902, "Saturation", range 0,255 
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Saturation", default 32, current 32
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980913, "Gain", range 0,255 
[1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Gain", default 64, current 64
[1] [NTC] [VID] [Sep 11 22:24:03] vid_v4lx_start: Using V4L2
[1] [NTC] [ALL] [Sep 11 22:24:03] image_ring_resize: Resizing pre_capture buffer to 1 items
[1] [NTC] [EVT] [Sep 11 22:24:32] event_new_video FPS 2
[1] [NTC] [ALL] [Sep 11 22:24:32] motion_detected: Motion detected - starting event 1
[1] [NTC] [EVT] [Sep 11 22:24:33] event_newfile: File of type 1 saved to: /mnt/sd/arduino/www/motion/01-20140911222431-01.jpg

Looking up that error, it seems there are two types of standards, VIDIOC_G_STD or VIDIOC_S_STD. Is there a way to switch it though?

  • 1
    Context. – user44370 Nov 20 '14 at 6:58
  • First of all, what version of motion are you running? I have here 3.2.12 and the output messages are different. My version segfaults if you try to write videos (ffmpeg changing apis), but works ok if you only want still frames. My Logitech C270 also uses uvcvideo, and I set the resolution to 1280x960. Does your camera works with other things like guvcview, skype, etc? – Jorge Nerín Nov 21 '14 at 11:54
  • @JorgeNerín No I haven't tried guvcview, I might try that. I highly doubt Skype would work on a device with no screen and less power than a Raspberry-pi. – NoBugs Nov 22 '14 at 1:46
  • Oh, I assumed it was a desktop, guvcview is a gui application. Then if you have a working compiler you could try twam.info/linux/v4l2grab-grabbing-jpegs-from-v4l2-devices, ma.juii.net/blog/capture-still-from-v4l2-webcam or code.google.com/p/camshot. BTW, motion requires quite a bit of cpu to compute frame differences, perhaps your device it's not fast enough to read the frames and you are getting overruns, test with the smaller resolution your camera supports. – Jorge Nerín Nov 24 '14 at 20:53
  • @JorgeNerín You may be right, since capturing still of full resolution usually works. It's odd motion doesn't work from the official repo. – NoBugs Nov 25 '14 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.