Motion - Support Question 2009x 03x 19x 233334

How to disable warnings about corrupt image?

Question

When I connect an other webcam by a USB 1.1 port to my notebook and start motion, I get the message, that only the palette MJPG (MJPEG) is supported. After that I get about every second a warning about a corrupt image. This is also written into /var/log/messages. But motion seems to work. So I only want wo disable the waring messages. How is that possible?

The output of motion:

>>>
[0] conf_load: Processing thread 0 - config file <path to home>/.motion/motion.conf
[0] conf_cmdparse: Unknown config option "control_port"
[0] motion_startup: Motion trunk-r441 Started
[0] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3360512 LIBAVFORMAT_BUILD 3413505
[0] main: Thread 1 is from <path to home>/.motion/motion.conf
[1] motion_init: Thread 1 started
[1] v4l2_get_capability: 
------------------------
cap.driver: "uvcvideo"
cap.card: "iSlim 321R"
cap.bus_info: "0000:00:1d.1"
cap.capabilities=0x04000001
------------------------
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] v4l2_set_pix_format: Supported palettes:
[1] 0: MJPG (MJPEG)
[1] v4l2_set_pix_format: index_format 5 Testing palette MJPG (640x480)
[1] v4l2_set_pix_format: Using palette MJPG (640x480) bytesperlines 0 sizeimage 307200 colorspace 00000008
[1] v4l2_set_pix_format: VIDIOC_G_JPEGCOMP not supported but it should be (does your webcam driver support this ioctl?): Invalid argument
[1] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,255 
[1] v4l2_scan_controls:    "Brightness", default 133, current 133
[1] v4l2_scan_controls: found control 0x00980901, "Contrast", range 0,100 
[1] v4l2_scan_controls:    "Contrast", default 10, current 10
[1] v4l2_scan_controls: found control 0x00980902, "Saturation", range 100,200 
[1] v4l2_scan_controls:    "Saturation", default 110, current 110
[1] v4l2_scan_controls: found control 0x00980903, "Hue", range -180,180 
[1] v4l2_scan_controls:    "Hue", default 0, current 0
[1] v4l2_scan_controls: found control 0x00980910, "Gamma", range 40,100 
[1] v4l2_scan_controls:    "Gamma", default 75, current 75
[1] v4l2_set_mmap: mmap information: frames=4
[1] v4l2_set_mmap: 0 length=307200
[1] v4l2_set_mmap: 1 length=307200
[1] v4l2_set_mmap: 2 length=307200
[1] v4l2_set_mmap: 3 length=307200
[1] vid_v4lx_start: Using V4L2
[1] image_ring_resize: Resizing pre_capture buffer to 1 items
Not a JPEG file: starts with 0xc5 0xba
Corrupt JPEG data: 2 extraneous bytes before marker 0xd9
[1] mjpegtoyuv420p: Corrupt image ... continue
Corrupt JPEG data: 1 extraneous bytes before marker 0xd9
[1] mjpegtoyuv420p: Corrupt image ... continue
<<<

Environment

Motion version: SVN version from 12.032009
ffmpeg version: ffmpeg-0.4.9-0.54.20080908
Libraries: ffmpeg
Server OS: Fedora 10, kernel 2.6.27.19-170.2.35

-- CapKid - 19 Mar 2009

Answer

You have to edit source code until a new feature i'm working on is ready and realeased with 3.3.0 :

edit video_common.c and locate function mjpegtoyuv420p() there comment out or set level :

* orginal code *

motion_log(LOG_ERR, 0, "%s: Corrupt image ... continue", __FUNCTION__; ret = 2;
  * with level *

if (debug_level >= CAMERA_INFO) motion_log(LOG_ERR, 0, "%s: Corrupt image ... continue", __FUNCTION__); ret = 2;

-- AngelCarpintero - 22 Mar 2009

Reply

Now I get the following warnings, one per second:
Corrupt JPEG data: 1 extraneous bytes before marker 0xd9
Corrupt JPEG data: 1 extraneous bytes before marker 0xd9
Corrupt JPEG data: 2 extraneous bytes before marker 0xd9
Corrupt JPEG data: 2 extraneous bytes before marker 0xd9
Corrupt JPEG data: 1 extraneous bytes before marker 0xd9
How can I disable the warnings?


That part is not so obviuos to implement , jpeglib error, warning , ouput routines must to be overridden with custom one with some filters

to allow enable or disabled. This is part of work i'm doing and soon will be in svn trunk. If you want a quick hack take a look to netcam_jpeg.c

where was implemente already some filters and you can do something like in jpegutils.c

-- AngelCarpintero - 24 Mar 2009


In motion 3.2.11.1 this message appears if debug level is equal or greater than 3. ( i.ex ./motion -d 3 )

-- AngelCarpintero - 10 Aug 2009
Topic revision: r6 - 10 Aug 2009, AngelCarpintero
Copyright © 1999-2017 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.