From: Mike W. <kno...@gm...> - 2014-08-25 22:14:02
|
There is a config option for more tolerant jpeg decoding. Did you try that? If that didn't do it, you can always patch the code to do the same thing your script does if you didn't like the script for some reason. On Sat, Aug 23, 2014 at 3:49 AM, Gabriele Tozzi <gab...@to...> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi there! > > I am a new motion user, experimenting with a Trendnet TV-VS1 network > camera. When i tried to directly connect the camera to motion, I ended > up with a bunch of errors repeated over and over again: > > motion: [1] libjpeg decompression failure on first frame - giving up! > motion: [1] Retrying until successful connection with camera > > So, when I went to investigate further, I found that the MJPEG stream > from this camera also includes "extra" data before the start of the > image that makes motion's libjpeg unable to decode it. > > I then decided to write a python script that reads any (M)JPEG stream > in a very tolerant way (by just looking for the JPEG start and end > magics and ignoring everything else) and then streams it back to > motion (by opening an http server on port 8000). > > So my motion now connects to the script and no longer has to bother > about dealing with the webcam itself. > > Here, you can find the script and a more detailed description of how > it works: > https://github.com/gtozzi/netcam_fix > > If anybody finds it useful, feel free to use it :) > > The same approach could be applied to do virtually a lot of more > advanced features like transcoding, frame rate reduction, image > manipulation, reading unsupported protocols, etc... > > Now, my question is: is there a better way to "inject" the images > directly into motion's core (like using inter-process communication)? > > Thank you, > > Gabriele Tozzi > > - -- > GPG Key Fingerprint: > DAD1 E3E3 C3E9 36FB C570 F405 9B5F 7108 A1D0 2FFF > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1 > > iEYEARECAAYFAlP4R5IACgkQm19xCKHQL/9SaACfdih3eOYJetYGrp91WcnZCQoZ > oikAnAwwtsGldVEenf+i0fO9KsNoddXk > =sXOB > -----END PGP SIGNATURE----- > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > Motion-user mailing list > Mot...@li... > https://lists.sourceforge.net/lists/listinfo/motion-user > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome > |