Page 1 of 1
corrupt jpeg
Posted: Thu Aug 02, 2012 8:15 pm
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
Re: corrupt jpeg
Posted: Sat Aug 04, 2012 2:06 pm
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???
Re: corrupt jpeg
Posted: Wed Aug 08, 2012 11:17 am
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.
Re: corrupt jpeg
Posted: Wed Aug 08, 2012 5:47 pm
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.....
Re: corrupt jpeg
Posted: Sat Aug 18, 2012 2:59 pm
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. */
Re: corrupt jpeg
Posted: Wed Sep 05, 2012 11:34 pm
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
Re: corrupt jpeg
Posted: Thu Sep 06, 2012 6:21 pm
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
Re: corrupt jpeg
Posted: Thu Sep 06, 2012 10:11 pm
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.