Page 1 of 2

Not a JPEG file: starts with 0x35 0x39

Posted: Mon Jan 24, 2005 6:25 pm
by donatmote
Two issues, possibly related.

1) I'm trying to get zm running on a Debian AMD64 (Sid) system with the
GCC-3.4 compiler. I had to build both pcre and libjpeg.a because only the
.so libraries come in the Debian libs.

The monitor seems to be functioning. I'm trying to use a remote camers and get the followig in zmdc.log:

Starting pending process, zmc -m 1
'zmc -m 1' started at 05/01/21 16:22:49
'zmc -m 1' starting at 05/01/21 16:22:49, pid = 3544
Not a JPEG file: starts with 0x35 0x39
'zmc -m 1' crashed at 05/01/21 16:22:50, exit status 1

The error msg is coming from the jpeg lib. The jpeg is valid and can be displayed by, e.g. firefox and gimp. As well, the http url to get the jpeg
works with wget and firefox. I suspect a 64bit issue somewhere, but
don't know where to look next. Any help would be appreciated.

2) These warningsand errors are appearing in my syslog:

Jan 21 16:16:34 mano zms[2446]: INF [Debug Level = 0, Debug Log = ]
Jan 21 16:16:34 mano zms[2446]: WAR [Attempt to fetch boolean value for ZM_WATCH_MAX_DELAY, actual type is decimal]
Jan 21 16:16:34 mano zms[2446]: WAR [Attempt to fetch boolean value for ZM_FORCED_ALARM_SCORE, actual type is integer]
Jan 21 16:16:34 mano zms[2446]: WAR [Attempt to fetch boolean value for ZM_BULK_FRAME_INTERVAL, actual type is integer]
Jan 21 16:16:34 mano zms[2446]: WAR [Attempt to fetch boolean value for ZM_JPEG_FILE_QUALITY, actual type is integer]
Jan 21 16:16:34 mano zms[2446]: ERR [Shared memory not initialised by capture daemon]

Are they important? How can I fix them?

Thanks.

Don

Posted: Mon Jan 24, 2005 6:32 pm
by zoneminder
1) I don't know what this is. I get it occasionally when a network cam sends something a little corrupted occasionally. You could try doing a

Code: Select all

wget -s -S <path to netcam image> > log
and seeing if there's anything odd in there.

2) You have run zmconfig.pl on one version of ZM, which has loaded the config into the DB, and are running binaries of another version. Make sure you install the newer version or restart ZM or rerun zmconfig.pl for the older version.

Phil

Posted: Mon Jan 24, 2005 6:49 pm
by donatmote
Thanks Phil. Issue 2. went away, but issue 1 persists:

Output from wget:

--13:40:50-- http://cuncator:*password*@12.174.210.1 ... /video.jpg
=> `video.jpg'
Connecting to 12.174.210.12:80... connected.
HTTP request sent, awaiting response...
1 HTTP/1.1 200 OK
2 Content-Type: image/jpeg
3 Date: Mon, 24 Jan 2005 18:40:46 GMT
4 Expires: Thu, 26 Oct 1995 00:00:01 GMT
5 Last-Modified: Mon, 24 Jan 2005 18:40:46 GMT
6 Pragma: no-cache
7 Server: Vivotek MiniAVServer

[ <=> ] 12,004 65.73K/s

13:40:50 (65.54 KB/s) - `video.jpg' saved [12004]

The saved jpeg is viewable by gimp with no complaints.

Don

Posted: Mon Jan 24, 2005 7:09 pm
by zoneminder
What are the first few lines of 'log' or whatever your output file was?

Phil

Posted: Mon Jan 24, 2005 7:21 pm
by donatmote
0K .......... . 66.88 KB/s

(Using redirection, the file was empty -- using -o wget.log the content looked just as in the previous post with the addition of the above.

Don

Posted: Mon Jan 24, 2005 8:36 pm
by zoneminder
If you used the '-s' flag then the received headers should be stored somewhere. Either in the saved file or the log. That (and the first bit of the image) is what I'm after. What camera is it by the way?

Phil

Posted: Mon Jan 24, 2005 8:48 pm
by donatmote
Hi Phil,

The error message seems to be coming from this piece of libjpeg:

LOCAL(boolean)
first_marker (j_decompress_ptr cinfo)
/* Like next_marker, but used to obtain the initial SOI marker. */
/* For this marker, we do not allow preceding garbage or fill; otherwise,
* we might well scan an entire input file before realizing it ain't JPEG.
* If an application wants to process non-JFIF files, it must seek to the
* SOI before calling the JPEG library.
*/
{
int c, c2;
INPUT_VARS(cinfo);

INPUT_BYTE(cinfo, c, return FALSE);
INPUT_BYTE(cinfo, c2, return FALSE);
if (c != 0xFF || c2 != (int) M_SOI)
ERREXIT2(cinfo, JERR_NO_SOI, c, c2);

cinfo->unread_marker = c2;

INPUT_SYNC(cinfo);
return TRUE;
}


------------------------------

The first four byte of the "video.jpg" file are:

<FF><D8><FF><C0>

which seem to be good, as far as I can tell.

Don

Posted: Mon Jan 24, 2005 8:51 pm
by donatmote
Received headers from the top of the saved image file:

HTTP/1.1 200 OK
Content-Type: image/jpeg
Date: Mon, 24 Jan 2005 20:16:28 GMT
Expires: Thu, 26 Oct 1995 00:00:01 GMT
Last-Modified: Mon, 24 Jan 2005 20:16:28 GMT
Pragma: no-cache
Server: Vivotek MiniAVServer

the camera is a Vivotek IP3112

Thanks.

Don

Posted: Mon Jan 24, 2005 9:18 pm
by donatmote
Hi Phil,

Looking over the output from the zm build, I find this warning repeatedly:

In file included from jinclude.h:20,
from zm_jpeg.h:20,
from zm_image.h:37,
from zm_monitor.h:28,
from zmc.cpp:26:
jconfig.h:12:1: warning: "HAVE_STDLIB_H" redefined
In file included from zm_config.h:20,
from zm.h:31,
from zmc.cpp:24:
../config.h:58:1: warning: this is the location of the previous definition

Maybe it's a clue?

Don

Posted: Mon Jan 24, 2005 10:15 pm
by zoneminder
Hi Don,

I don't think that is a problem. You've posted the headers but I'm interested to see what follows immediately on from them in case there is an unusual pattern of linefeeds etc between the headers and the image.

I've not heard of your camera, can you post the URL path you use for the image?

Cheers

Phil

ps. I've been to Mote Marine I think, about 10 years or so ago when on holiday in Sarasota! Nice to know you're still going strong.

Posted: Tue Jan 25, 2005 2:47 pm
by donatmote
Hi Phil,

Here are the headers through the first bytes of the image, from the file
saved from wget -s -S:

HTTP/1.1 200 OK
Content-Type: image/jpeg
Date: Mon, 24 Jan 2005 20:16:28 GMT
Expires: Thu, 26 Oct 1995 00:00:01 GMT
Last-Modified: Mon, 24 Jan 2005 20:16:28 GMT
Pragma: no-cache
Server: Vivotek MiniAVServer

<FF><D8><FF><C0>^@^^@<F0>^A`^C^@"^@^A^Q^A^B^Q^A<FF><DB>^@<84>^@^P^K^L^N^L
^

When I do a simple wget or save the image from a firefox get, the file starts
imediately with: <FF><D8><FF><C0>

A URL that works for this camera is:

http://demo@keatlobby.mote.org/cgi-bin/video.jpg

The camera is actually in my office. Mote has changed a bit in the last ten
years. You might not recognize it..

Don

Posted: Tue Jan 25, 2005 4:17 pm
by donatmote
Hi Phil,

Turned on some more debugging output and got this from zmc before it failed:

Jan 25 10:36:56 mano zmc_m1[9675]: DB1 [Monitor Keating LBF = '%%s - %y/%m/%d %H
:%M:%S', LBX = 0, LBY = 0]
Jan 25 10:36:56 mano zmc_m1[9675]: DB1 [Monitor Keating IBC = 100, WUC = 25, pEC
= 10, PEC = 10, EAF = 1, FRI = 1000, RBP = 10]
Jan 25 10:36:56 mano zmc_m1[9675]: DB1 [Got 1 zones for monitor Keating]
Jan 25 10:36:56 mano zmc_m1[9675]: DB1 [Initialised zone 1/All - 1 - 352x240 - R
gb:ff0000, CM:3, MnAT:25, MxAT:0, MnAP:2534, MxAP:63360, FB:3x3, MnFP:2534, MxFP
:63360, MnBS:1689, MxBS:0, MnB:1, MxB:0]
Jan 25 10:36:56 mano zmc_m1[9675]: DB1 [Loaded monitor 1(Keating), 1 zones]
Jan 25 10:36:56 mano zmc_m1[9675]: INF [Starting Capture]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Connected to host, socket = 5]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Request sent]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Expecting 224 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Read 224 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Got status '200' (OK), http version 1.1]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Got connection 'close']
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Got content type 'image/jpeg' ]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Expecting 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Read 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Expecting 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Read 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Expecting 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Read 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Expecting 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Read 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Expecting 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Read 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Expecting 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Read 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Expecting 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Read 1445 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Expecting 1025 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Read 1025 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Expecting 0 bytes]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Socket closed]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Got end of image by closure, content-len
gth = 11140]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Trimmed end of image, new content-length
= 11136]
Jan 25 10:36:56 mano zmc_m1[9675]: DB3 [Returning 11136 (11140) bytes of capture
d content]


The filesystem size of the image is:

ls -l /home/don/video.jpg
-rw-r--r-- 1 don don 12079 Jan 24 15:25 /home/don/video.jpg

Hope this is useful.

Don

Posted: Tue Jan 25, 2005 4:24 pm
by donatmote
Set debug to 4 and saw this:

Jan 25 11:16:43 mano zmc_m1[9959]: DB4 [Captured header (224 bytes): 'HTTP/1.1 2
00 OK^M Content-Type: image/jpeg^M Date: Tue, 25 Jan 2005 16:16:37 GMT^M Cache-C
ontrol: no-cache^M Expires: Thu, 26 Oct 1995 00:00:01 GMT^M Transfer-Encoding: c
hunked^M Server: Vivotek MiniAVServer^M Connection: close^M ^M ']

Don

Posted: Fri Jan 28, 2005 9:14 pm
by donatmote
Hi Phil,

II've tried several things. Built zm-1.20.1 on AMD64 as well as a 32bit Debian system (the builds went smoothly). I tried gcc-3.4, gcc-4.0 as well as gcc-3.3
on the 32 bit system. This error persists, so it doesn't seem to be 64bit related. Is there some other information I can get that might be useful? Is there a way to dump the monitor configuration for you to review?

thanks.

Don

Posted: Mon Jan 31, 2005 5:25 pm
by donatmote
Hi Phil,

I make a short perl script using LWP::Useragent to get the image from the camera and dump it into an apache server directory. I told zm to get the image from the server. I'm now getting a monitor image -- usually stills but sometimes stream. The error in the log stopped.

Any idea where to look to see why zm can't get it directly from the camera?

Thanks.

Don