BUG: Motion crashes with multiple netcams in v3.1.18 and higher

I can run motion with 4 network cameras on 3.1.17 with no problems (other than a buildup defunct processes). My camera models are the

Panasonic KX-HCM280 Panasonic KX-HCM270 Panasonic BL-C10A Toshiba IK-WB01A

When I run motion versions 3.1.18 and greater I have problems with it crashing almost immediately. I'm having motion grab the single JPEG snapshot image URL for each of the cameras, not a streaming MJPEG. I've included some of the error messages below.

I'd like to use the higher versions of motion (since Kenneth fixed the defunct process problem as of 3.1.18) but the netcam related crashes prevent me from using anything other than 3.1.17.

Test case

Here is an example from /var/log/messages:

Mar  5 10:01:00 cpe1 motion: Processing thread 0 - config file motion.conf
Mar  5 10:01:00 cpe1 motion: Unknown config option: "adjust_rate"
Mar  5 10:01:00 cpe1 motion: Unknown config option: "jpg_cleanup"
Mar  5 10:01:00 cpe1 motion: Unknown config option: "mpeg_encode"
Mar  5 10:01:00 cpe1 motion: Unknown config option: "output_all_on"
Mar  5 10:01:00 cpe1 motion: Unknown config option: "sql_log_timelapse"
Mar  5 10:01:00 cpe1 motion: Processing thread 1 - config file /usr/config/camera1.properties
Mar  5 10:01:00 cpe1 motion: Processing thread 2 - config file /usr/config/camera2.properties
Mar  5 10:01:00 cpe1 motion: Processing thread 3 - config file /usr/config/camera3.properties
Mar  5 10:01:00 cpe1 motion: Netcam: thread 1: starting...
Mar  5 10:01:00 cpe1 motion: Netcam: thread 2: starting...
Mar  5 10:01:00 cpe1 motion: Netcam: thread 3: starting...
Mar  5 11:36:45 cpe1 motion: Netcam: thread 3: error reading image, not completeMar  5 11:36:45 cpe1 motion: Netcam: thread 3: error frame [1]
Mar  5 11:38:33 cpe1 motion: Netcam: thread 3: error reading image, not completeMar  5 11:38:33 cpe1 motion: Netcam: thread 3: error frame [2]
Mar  5 11:38:51 cpe1 motion: Netcam: thread 3: error reading image, not complete
Mar  5 11:38:51 cpe1 motion: Netcam: thread 3: error frame [3]

Here is an example of motion output:
$ more 2005-03-03-20-17-33-motion.log
Thu Mar  3 20:17:33 PST 2005 - Starting ./start_motion.sh
Webcam port for thread 1 is 0
Webcam port for thread 2 is 0
Webcam port for thread 3 is 0
Thread1 device: http://192.168.254.53:10053/SnapshotJpeg?Resolution=320x240&Qual
ity=Standard input: -1
Netcam: thread 1: starting...
Thread2 device: http://192.168.254.51:10051/SnapshotJpeg?Resolution=320x240&Qual
ity=Standard input: -1
Thread3 device: http://192.168.254.52:10052/SnapshotJpeg?Resolution=320x240&Qual
ity=Standard input: -1
Netcam: thread 2: starting...
Netcam: thread 3: starting...
[HTTP/1.0 200 OK]
Netcam: thread 2: jpeg file
Netcam single: thread 2: Content-length supported
Netcam: thread 2: thread PID: 1261
[HTTP/1.0 200 OK]
Netcam: thread 3: jpeg file
[HTTP/1.0 200 OK]
Netcam: thread 1: jpeg file
Netcam single: thread 3: Content-length supported
Netcam: thread 3: thread PID: 1261
Netcam single: thread 1: Content-length supported
Netcam: thread 1: thread PID: 1261
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 3 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
Thread 2 Condiction timeout
--More--(0%)

One of my cameras (the KC-HCM270) has a spotty wireless link, but I can browse to it ok most times.

Environment

Motion version: 3.1.19, 3.2.1_snap3
ffmpeg version: 0.4.8
Shared libraries: curl, xmlrpc, ffmpeg, mysql, postgresql
Server OS: RedHat? 2.4.21-20.EL #1 Wed Aug 18 20:46:27 EDT 2004 i686 athlon i386 GNU/Linux

-- BruceDurham - 06 Mar 2005

Follow up

This appears to be a dup of BugReport2005x02x12x172946. See possible fix located there.

-- ChristopherPrice - 18 Mar 2005


I'm reverting BugStatus to Assigned since I don't think the noted patch fixed the problem. The specific bug described may be fixed in a recent 3.2.1 or 3.1.20 snap release, but Bruce is apparently still having some problems related to the Toshiba netcam.

-- ChristopherPrice - 28 Mar 2005


After further testing I've definitely narrowed it down to the Toshiba IK-WB01A. If it's used, motion crashes; otherwise everything is ok. I've uploaded the output from mjpegsnif of this camera; There appear to be ctl-M's (carriage-return, CR) in the header info; could this be the problem?

-- BruceDurham - 12 Apr 2005


I reviewed the mjpegsnif dump again and it appears normal. Standard response from an http server should be:

HTTP/1.0 200 OK^M
Content-type: image/jpeg^M^L
^M^L
<binary image>

The Toshiba is slightly non-standard:

HTTP/1.0 200 OK^M^L
Content-type: image/jpeg^M^L
^M^L
<binary image>

but the parsing code is built to be.. lenient. So, this should not be an issue.

I believe I solved a lot of problems as of 3.1.20-snap5 and 3.2.1-snap12 (originally the post4 netcam patch). Could you let me know which version you performed the tests on?

-- ChristopherPrice - 15 Apr 2005


I've just tried motion v3.1.20_snap6. It works with my other three netcams, but when I add the Toshiba IK-WB01A it produces the following output (btw, I'm not using any passwords on this camera as opposed to the others):

Thread4 device: http://192.168.254.54:10054/__live.jpg?&&& input: -1
[4] netcam: starting...
[2] netcam: content-length supported
[3] netcam: content-length supported
[1] netcam: content-length supported
[2] netcam: entering loop...
[4] netcam: entering loop...
[3] netcam: entering loop...
[1] netcam: entering loop...
Not a JPEG file: starts with 0x00 0x00
[4] netcam: jpeglib decompression failed
Not a JPEG file: starts with 0x91 0xd8
[4] netcam: jpeglib decompression failed
Not a JPEG file: starts with 0xb4 0x00
[4] netcam: jpeglib decompression failed
Not a JPEG file: starts with 0xef 0x40
[4] netcam: jpeglib decompression failed
Not a JPEG file: starts with 0xf9 0xf4
[4] netcam: jpeglib decompression failed
Not a JPEG file: starts with 0x8c 0xf2
[4] netcam: jpeglib decompression failed
Not a JPEG file: starts with 0x0f 0xd2
[4] netcam: jpeglib decompression failed
Not a JPEG file: starts with 0x28 0x1a

-- BruceDurham - 24 Apr 2005


I would like to hear if this issue is better after the latest changes to the Netcam code.

-- KennethLavrsen - 11 Jul 2005


Please try with the http://www.lavrsen.dk/twiki/bin/view/Motion/MotionRelease3x2x2snap8 or later. I may have resolved this bug. We believe it should have but need actial feedback.

-- KennethLavrsen - 02 Aug 2005

Fix record

Reports from other testers reports that this issue is resolved in motion-3.2.2_snap10 and forward.

- KennethLavrsen - 11 Aug 2005

BugReportForm edit

TopicTitle Motion crashes with multiple netcams in v3.1.18 and higher
BugStatus Released
AssignedBugTo BillBrack
SubmittedBy BruceDurham
Topic revision: 13 Aug 2005, KennethLavrsen
 
Motion - Bug Report 2005x 03x 06x 023010
Copyright 1999-2014 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.