corrupt jpeg

Forum for questions and support relating to the 1.25.x releases only.
Locked
mael
Posts: 14
Joined: Sun Nov 06, 2011 10:03 pm

corrupt jpeg

Post by mael »

hello,
i use zm 1.25.0 it work fine but after install heden v2.2 camera i have this message
"Corrupt JPEG data: 1 extraneous bytes before marker 0xd9 zm_jpeg.cpp 63"
what is this???
Maël
mael
Posts: 14
Joined: Sun Nov 06, 2011 10:03 pm

Re: corrupt jpeg

Post by mael »

i find more solution on the web but any one is no good.

sudo apt-get remove libjpeg8

Extract the files after the download. Before configuring or making the installation, the line which is creating the errornous warning needs to be commented out (or removed if you are a person who likes to live of the edge). The file for modification is jdmarker.c which needs the following line commented out:

WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);

and reconpile

why???
everwake
Posts: 13
Joined: Wed Jul 18, 2012 11:32 am

Re: corrupt jpeg

Post by everwake »

recompiling libjpg really is the only good option, this is not the fault of zoneminder, but a problem with most low cost cameras (foscam and tenvis among others) and libjpg, it is just a warning and you can ignore it, but it you do not want it to ruin your logs, it is best to recompile libjpg.
User avatar
punch-card
Posts: 39
Joined: Thu Nov 25, 2010 10:29 pm
Location: St Peters MO

Re: corrupt jpeg

Post by punch-card »

This would look like a good candidate to add "filter string" to logging options, then it would ignore any type erroneous error log. Recompiling libraries are fine for more experience users, but all too often in some version of Linux that do not have every dependent library quickly available to recompile. Of course anything is possible to be done, but personally, it would be nice to just put in a regular expression field that would allow filtering.... Just my 2C

Needless to say, I experience the same issue.....
Best Regards
Mike
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: corrupt jpeg

Post by knight-of-ni »

In my opinion, it's much safer to patch the zoneminder source code rather than a library that is used by the entire system.

I used the code posted in an older forum thread (can't recall which at the moment) to make the attached patch.
The patch is intended to remove the corrupt jpeg errors that appear in Zoneminder logs for cameras with Foscam firmware. It'll probably work with others cameras that cause the same or similar error.

Huh... the patch file did not attach. Let me try again...

OK, I'll try this another way. Save the following code as "zoneminder-1.25.0-corrupt_jpeg.patch":

Code: Select all

--- src/zm_jpeg.orig.cpp        2012-01-31 18:24:01.468888077 -0600
+++ src/zm_jpeg.cpp     2012-01-31 18:26:34.170857019 -0600
@@ -59,7 +59,8 @@
                 */
                if ( zmerr->pub.num_warnings == 0 || zmerr->pub.trace_level >= 3 )
                {
-                       (zmerr->pub.format_message)( cinfo, buffer ); 
+                       (zmerr->pub.format_message)( cinfo, buffer );
+                       if (!strstr(buffer, "Corrupt JPEG data:")) 
                        Warning( "%s", buffer );
                }
                /* Always count warnings in num_warnings. */
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
McFuzz
Posts: 181
Joined: Tue Aug 28, 2012 7:03 am

Re: corrupt jpeg

Post by McFuzz »

knnniggett wrote:In my opinion, it's much safer to patch the zoneminder source code rather than a library that is used by the entire system.

I used the code posted in an older forum thread (can't recall which at the moment) to make the attached patch.
The patch is intended to remove the corrupt jpeg errors that appear in Zoneminder logs for cameras with Foscam firmware. It'll probably work with others cameras that cause the same or similar error.

Huh... the patch file did not attach. Let me try again...

OK, I'll try this another way. Save the following code as "zoneminder-1.25.0-corrupt_jpeg.patch":

Code: Select all

--- src/zm_jpeg.orig.cpp        2012-01-31 18:24:01.468888077 -0600
+++ src/zm_jpeg.cpp     2012-01-31 18:26:34.170857019 -0600
@@ -59,7 +59,8 @@
                 */
                if ( zmerr->pub.num_warnings == 0 || zmerr->pub.trace_level >= 3 )
                {
-                       (zmerr->pub.format_message)( cinfo, buffer ); 
+                       (zmerr->pub.format_message)( cinfo, buffer );
+                       if (!strstr(buffer, "Corrupt JPEG data:")) 
                        Warning( "%s", buffer );
                }
                /* Always count warnings in num_warnings. */

Hmph - didn't work for me :(
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: corrupt jpeg

Post by mastertheknife »

This is a problem with foscam cameras. knnniggett's patch is a good fix which doesn't involve messing around with libjpeg.
If the patch doesn't apply cleanly, you can always apply it manually by hand editing the file.

mastertheknife
Kfir Itzhak.
McFuzz
Posts: 181
Joined: Tue Aug 28, 2012 7:03 am

Re: corrupt jpeg

Post by McFuzz »

mastertheknife wrote:This is a problem with foscam cameras. knnniggett's patch is a good fix which doesn't involve messing around with libjpeg.
If the patch doesn't apply cleanly, you can always apply it manually by hand editing the file.

mastertheknife
The problem I encountered is that due to my rather... interesting install method per the wiki guide for debian, after manually patching the file and recompiling, it caused my zoneminder install to go boom.

Thankfully, I had a VM snapshot so I reverted, then adjusted the file in your package, applies the performance patch and voila - life is good.
Locked