This is a transform stream for MJPEG streams or any jpeg-streams.
$ npm i mjpeg-frame-stream
const MjpegFrameStream = require('mjpeg-frame-stream');
const fs = require('fs');
let mgpegStream = fs.createReadStream('./mjpeg.dump'),
frameStream = new MjpegFrameStream();
mgpegStream.pipe(frameStream)
.on('frame', frame => console.log(frame));
Licensed under the MIT License