{"action":"created","issue":{"url":"https://api.github.com/repos/Mr-Dave/motion/issues/65","labels_url":"https://api.github.com/repos/Mr-Dave/motion/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/Mr-Dave/motion/issues/65/comments","events_url":"https://api.github.com/repos/Mr-Dave/motion/issues/65/events","html_url":"https://github.com/Mr-Dave/motion/issues/65","id":66188265,"number":65,"title":"Handling MJPEG with warnings","user":{"login":"tosiara","id":3600973,"avatar_url":"https://avatars.githubusercontent.com/u/3600973?v=3","gravatar_id":"","url":"https://api.github.com/users/tosiara","html_url":"https://github.com/tosiara","followers_url":"https://api.github.com/users/tosiara/followers","following_url":"https://api.github.com/users/tosiara/following{/other_user}","gists_url":"https://api.github.com/users/tosiara/gists{/gist_id}","starred_url":"https://api.github.com/users/tosiara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tosiara/subscriptions","organizations_url":"https://api.github.com/users/tosiara/orgs","repos_url":"https://api.github.com/users/tosiara/repos","events_url":"https://api.github.com/users/tosiara/events{/privacy}","received_events_url":"https://api.github.com/users/tosiara/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-03T17:07:33Z","updated_at":"2015-08-30T03:20:35Z","closed_at":null,"body":"This was initially reported back in 2011:\r\n\r\nhttp://www.lavrsen.dk/foswiki/bin/view/Motion/SupportQuestion2011x01x09x193606\r\n\r\nThe Logitech C910 camera simply does not work with motion in MJPEG format:\r\n```\r\nCorrupt JPEG data: 4 extraneous bytes before marker 0xd4\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\nCorrupt JPEG data: 9 extraneous bytes before marker 0xd4\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\nCorrupt JPEG data: 1 extraneous bytes before marker 0xd2\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\nCorrupt JPEG data: 1 extraneous bytes before marker 0xd3\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\nCorrupt JPEG data: 1 extraneous bytes before marker 0xd4\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\nCorrupt JPEG data: 1 extraneous bytes before marker 0xd1\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\nCorrupt JPEG data: 1 extraneous bytes before marker 0xd1\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\nCorrupt JPEG data: 2 extraneous bytes before marker 0xd4\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\nCorrupt JPEG data: 5 extraneous bytes before marker 0xd1\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\nCorrupt JPEG data: 2 extraneous bytes before marker 0xd1\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\nCorrupt JPEG data: 1 extraneous bytes before marker 0xd2\r\n[1] [CRT] [VID] mjpegtoyuv420p: Corrupt image ... continue\r\n```\r\nTo workaround the issue I changed this code:\r\n```\r\ndiff --git a/video_common.c b/video_common.c\r\nindex 54569c6..f98154f 100644\r\n--- a/video_common.c\r\n+++ b/video_common.c\r\n@@ -394,7 +394,7 @@ int mjpegtoyuv420p(unsigned char *map, unsigned char *cap_map, int width, int he\r\n \r\n     if (ret == 1) {\r\n         MOTION_LOG(CRT, TYPE_VIDEO, NO_ERRNO, \"%s: Corrupt image ... continue\");\r\n-        ret = 2;\r\n+        ret = 0;\r\n     }\r\n     return ret;\r\n }\r\n```\r\nAny other more sophisticated way to handle libjpeg warnings?\r\n\r\nMail list bump: http://sourceforge.net/p/motion/mailman/message/33700242/"},"comment":{"url":"https://api.github.com/repos/Mr-Dave/motion/issues/comments/136081688","html_url":"https://github.com/Mr-Dave/motion/issues/65#issuecomment-136081688","issue_url":"https://api.github.com/repos/Mr-Dave/motion/issues/65","id":136081688,"user":{"login":"Mr-Dave","id":5959350,"avatar_url":"https://avatars.githubusercontent.com/u/5959350?v=3","gravatar_id":"","url":"https://api.github.com/users/Mr-Dave","html_url":"https://github.com/Mr-Dave","followers_url":"https://api.github.com/users/Mr-Dave/followers","following_url":"https://api.github.com/users/Mr-Dave/following{/other_user}","gists_url":"https://api.github.com/users/Mr-Dave/gists{/gist_id}","starred_url":"https://api.github.com/users/Mr-Dave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mr-Dave/subscriptions","organizations_url":"https://api.github.com/users/Mr-Dave/orgs","repos_url":"https://api.github.com/users/Mr-Dave/repos","events_url":"https://api.github.com/users/Mr-Dave/events{/privacy}","received_events_url":"https://api.github.com/users/Mr-Dave/received_events","type":"User","site_admin":false},"created_at":"2015-08-30T03:20:35Z","updated_at":"2015-08-30T03:20:35Z","body":"I read this again and don't think that the code I was thinking of will resolve this issue.  The code I was looking at before was for handling netcams instead of webcams.  Do you have one of these cameras to use as a sample?  I think we'd need to get a few of the images and see whether they are still valid images if we were to ignore the extra bytes."}}