Motion - Bug Report 2012x 09x 19x 151452
You are here: Foswiki>Motion Web>BugReports>BugReport2012x09x19x151452 (17 Feb 2014, KeithWillis)Edit Attach

BUG: (PATCH) Handling of bad MJPEG/JPEG data

Hello,

I'm using Motion with a DCS-932L wireless netcam. The WiFi connection to this camera is medium to poor, so the transmission is not always perfect.

I've noticed that I've been getting pictures that are partially gray (garbage) at the end, and once I get one, I usually get a few in series. Looking at the logs, I see something like this when it happens:

netcam_fill_input_buffer: *fake EOI inserted*

netcam_image_conv: jpeg_error 0

event_newfile: File of type 1 saved to: /tmp/20120918122510-00.jpg

If I'm reading the code correctly, netcam_fill_input_buffer is trying to gracefully recover whatever partial image it already has by giving libjpeg a fake EOI. The problem I think is motion still uses this partial image to compare it to a full image, and this causes an invalid motion trigger.

Attached is a patch that simply calls ERREXIT() instead so a bad image is not used.

Thanks for Motion!
 

Environment

Motion version: git snapshot
ffmpeg version:  
Shared libraries:  
Server OS: Linux alarm 3.1.10-13-ARCH
-- JonGuess - 19 Sep 2012

Follow up

17 Feb 2014: Confirmed, (in fact this patch saved my skin! Thanks much...) KeithWillis.

Fix record

Topic revision: r3 - 17 Feb 2014, KeithWillis
Copyright © 1999-2024 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.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.