BUG: (PATCH) Handling of bad MJPEG/JPEG data
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!
| Motion version:
|| git snapshot
| ffmpeg version:
| Shared libraries:
| Server OS:
|| Linux alarm 3.1.10-13-ARCH
- 19 Sep 2012
17 Feb 2014: Confirmed, (in fact this patch saved my skin! Thanks much...) KeithWillis