Corrupt JPEG data: 1 extraneous bytes before marker 0xd9

Forum for questions and support relating to the 1.25.x releases only.
Locked
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Corrupt JPEG data: 1 extraneous bytes before marker 0xd9

Post by marcmerlin »

So this problem is not new, there are hits on google about it. In my case, it spams my ZM logs so hard that I can't even really look at them.
I've already setup rsyslog to delete all those entries so that they don't spam my disk.
I've tried binary editting my libjpeg to put a null instead of that string, but that just logs null lines.
I'd rather not fork libjpeg to remove the message from the source.

Is there another way?
Can't ZM be told to just filter out those messages so that they never get logged?

Thanks,
Marc
B F
Posts: 33
Joined: Sat May 05, 2012 5:06 pm

Re: Corrupt JPEG data: 1 extraneous bytes before marker 0xd9

Post by B F »

Shot in the dark but you could try disabling 'ADD_JPEG_COMMENTS' if it's enabled in case it's contributing to the problem? 'Options->Images->Add jpeg timestamp annotations as file header comments'.

Outside of ZoneMinder I've typically seen a similar message when a programme expects a JPEG file but it's actually something else e.g. a PNG.
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Re: Corrupt JPEG data: 1 extraneous bytes before marker 0xd9

Post by marcmerlin »

Thanks for the reply and suggestion.
ADD JPEG COMMENTS is indeed turned off (by default it seems)

Then, I made sure that the snapshot that ZM gets is indeed a jpeg:
gandalfthegreat:/tmp# identify snapshot.jpg
JPEG 640x480 640x480+0+0 8-bit DirectClass 29.3KB 0.000u 0:00.000

I'm attaching an actual snapshot in case that helps.
My source is configured as http with
/snapshot.cgi?user=user&pwd=pwd&resolution=32&rate=3

I get the same error with foscam 8910 or wansview.

Mmmh, I also just found out that all the log entries end up in mysql, are creating a huge table, and seem to be making everything either very slow, and maybe even crashing mysql in the end.
Logging to mysql as the log table fills up makes ZM very slow and unresponsive until I manually truncate the table.
Looking in the config, I just found (in case someone finds this post) that one must set LOG_LEVEL_DATABASE to none to turn off mysql logging.

google zoneminder-foscam-fi8918w-war-corrupt-jpeg-data-extraneous-bytes-before-marker-0xd9 (I can't post URLs, great...) says that one can recompile libjpeg to remove the warning, but I'd rather not do that because my next system upgrade will re-install a libjpeg that will spam my logs again.
Turning off mysql logging since it's unable to filter logs, and filtering the error in rsyslog seems to have taken care of the problem for me.

If you are using another syslog, install rsyslog and then add this line at the top of the config:
:msg, contains, "Corrupt JPEG data" ~


foscam sucks for making bad jpegs :(
Attachments
snapshot.jpg
snapshot.jpg (28.63 KiB) Viewed 5394 times
Locked