Motion - Support Question 2012x 01x 28x 093058

Motion with Logitech cam works for the first time, the second always fails

Question

If I run Motion with Logitech cam for the first time - it works fine. If I kill Motion, wait 5 sec and start it again - it begins to fail in a loop. To make it working again I need to to either:

* disconnect and reconnect the camera, or

* run vlc

There is something that vlc can do with the camera that Motion can't do. Also, I noticed, mplayer fails as well as Motion until you fix it by disconnecting or running vlc

See Verbatim text for full log details
Full log is available here: http://pastebin.com/9dmfJ6fE

1. Start Motion for the first time - it's OK
2. Kill it and start again - it fails:

1] VIDIOC_TRY_FMT failed for format YUYV:
[1] Unable to find a compatible palette format.
[1] ioctl(VIDIOCGMBUF) - Error device does not support memory map
[1] V4L capturing using read is deprecated!
[1] Motion only supports mmap.
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items

3. run vlc:

vlc v4l2:///dev/video1

4. now try Motion - it works again

So why Motion fails for the second time? And what vlc can do with the camera so it works again?

Reproducible: always with Logitech cameras 046d:08c1 and 046d:0991
Not reproducible with HP laptop integrated webcamera 5986:0137


Thanks

UPDATE. Latest trunk version on ARM device behaves same way with the same camera:

[1] [NTC] [VID] v4l2_get_capability:
------------------------
cap.driver: "uvcvideo"
cap.card: "UVC Camera (046d:080a)"
cap.bus_info: "usb-fsl-ehci.0-1.4"
cap.capabilities=0x04000001
------------------------
[1] [NTC] [VID] v4l2_get_capability: - VIDEO_CAPTURE
[1] [NTC] [VID] v4l2_get_capability: - STREAMING
[1] [NTC] [VID] v4l2_select_input: name = "Camera 1", type 0x00000002, status 00000000
[1] [NTC] [VID] v4l2_select_input: - CAMERA
[1] [WRN] [VID] v4l2_select_input: Device doesn't support VIDIOC_G_STD
[0] [NTC] [STR] httpd_run: motion-httpd testing : IPV4 addr: 127.0.0.1 port: 8080
[0] [NTC] [STR] httpd_run: motion-httpd Bound : IPV4 addr: 127.0.0.1 port: 8080
[0] [NTC] [STR] httpd_run: motion-httpd/Git-8619d7c17ce112e7196975905c6e840f345141ba running, accepting connections
[0] [NTC] [STR] httpd_run: motion-httpd: waiting for data on 127.0.0.1 port TCP 8080
[1] [NTC] [VID] v4l2_set_pix_format: Config palette index 8 (MJPG) doesn't work.
[1] [NTC] [VID] v4l2_set_pix_format: Supported palettes:
[1] [NTC] [VID] v4l2_set_pix_format: (0) YUYV (YUV 4:2:2 (YUYV))
[1] [NTC] [VID] v4l2_set_pix_format: 0 - YUV 4:2:2 (YUYV) (compressed : 0) (0x56595559)
[1] [NTC] [VID] v4l2_set_pix_format: (1) MJPG (MJPEG)
[1] [NTC] [VID] v4l2_set_pix_format: 1 - MJPEG (compressed : 1) (0x47504a4d)
[1] [NTC] [VID] v4l2_set_pix_format Selected palette YUYV
[1] [ERR] [VID] VIDIOC_TRY_FMT failed for format v4l2_set_pix_format:
[1] [ERR] [VID] v4l2_set_pix_format: Unable to find a compatible palette format.
[1] [NTC] [VID] vid_v4lx_start: Using V4L1
[1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
[1] [ERR] [ALL] motion_init: Error capturing first image
[1] [NTC] [STR] http_bindsock: motion-stream testing : IPV4 addr: 0.0.0.0 port: 8081
[1] [NTC] [STR] http_bindsock: motion-stream Bound : IPV4 addr: 0.0.0.0 port: 8081
[1] [NTC] [ALL] motion_init: Started motion-stream server in port 8081 auth Disabled
[1] [ERR] [ALL] motion_loop: Video device fatal error - Closing video device


Workaround

As for now I'm using a workaround:

1. stop motion
2. run script: su - linaro -c "cvlc -I dummy v4l2:///dev/video0 --run-time=1 vlc://quit -vvv"
3. start motion

Environment

Motion version: 3.2.12
ffmpeg version: SVN "motion compatible"
Libraries: ffmpeg, v4l, v4l2
Server OS: openSUSE 11.4 32bit kernel 2.6.37.6-0.11-desktop
-- TosiaraT - 28 Jan 2012

Answer

SupportForm edit

TopicTitle Motion with Logitech cam works for the first time, the second always fails
SupportStatus AskedQuestions
AssignedQuestionTo
SubmittedBy TosiaraT
Topic revision: r2 - 27 Dec 2013, TosiaraT
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.