jpeg-extractor
The module is designed to work with any streams that contains pictures in jpeg format (not only HTTP, like a mjpeg, but also any other).
Install
npm install jpeg-extractor
Example
Example of extracting images from MJPG stream to the console and written to the directory.
var request = ;var jpegExtractor = ;var fileOnWrite = ; var url = 'http://root:123@127.0.0.1:11164/axis-cgi/mjpg/video.cgi'; var je = ; var cnt = 0;var fow = { return 'file_' + cnt++; } path: '_output/' ext: '.jpg'; ;
Alternatives
mjpeg-consumer - I like this project. But unfortunately, it works only with HTTP streams. If there are several pictures in the chunk, it does not retrieve them. I used this project as a template for my project. Of course, I'm used a different extraction algorithm.