# mjpeg-consumer

> a stream implementation that consumes http mjpeg streams and emits jpegs as buffers

Latest version **2.0.0** (published 2019-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install mjpeg-consumer
pnpm add mjpeg-consumer
yarn add mjpeg-consumer
bun add mjpeg-consumer
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-07-20 |
| First published | 2012-12-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 0 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 62 |
| Author | Mike Maelzer |
| Maintainers | mmaelzer |
| Keywords | mjpg, mjpeg, motion jpeg, stream, http, ip camera |

## Links

- npm: https://www.npmjs.com/package/mjpeg-consumer
- Repository: https://github.com/mmaelzer/mjpeg-consumer
- Homepage: https://github.com/mmaelzer/mjpeg-consumer#readme
- Issues: https://github.com/mmaelzer/mjpeg-consumer/issues
- npm.io page: https://npm.io/package/mjpeg-consumer

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2019-07-20
- 1.1.0 — 2016-02-26
- 1.0.5 — 2015-12-08
- 1.0.4 — 2015-12-04
- 1.0.3 — 2015-12-04
- 1.0.2 — 2015-12-04
- 1.0.1 — 2015-11-28
- 1.0.0 — 2015-11-28
- 0.6.2 — 2015-07-05
- 0.6.1 — 2015-06-13
- 0.6.0 — 2015-06-10
- 0.5.0 — 2015-06-10
- 0.4.0 — 2014-04-16
- 0.3.1 — 2014-01-04
- 0.3.0 — 2014-01-02
- … 2 more at https://npm.io/package/mjpeg-consumer/versions

## README

mjpeg-consumer
==================
  
A node.js transform stream implementation that consumes http multipart mjpeg streams and emits jpegs.

[![build status](https://secure.travis-ci.org/mmaelzer/mjpeg-consumer.png)](http://travis-ci.org/mmaelzer/mjpeg-consumer)
[![Coverage Status](https://coveralls.io/repos/mmaelzer/mjpeg-consumer/badge.svg?branch=master&service=github)](https://coveralls.io/github/mmaelzer/mjpeg-consumer?branch=master)

  
### Install

```bash
npm install mjpeg-consumer
```
  
----------------------  
### Usage
The `mjpeg-consumer` isn't very useful without a writable pipe to pipe jpegs to. I've built the [file-on-write](https://github.com/mmaelzer/file-on-write) stream to write a file every time `write` is called on it. The below example opens a stream to an IP camera, pipes the results to the `mjpeg-consumer` which processes the stream and emits parsed jpegs to the `file-on-write` writer.

```javascript
var request = require("request");
var MjpegConsumer = require("mjpeg-consumer");
var FileOnWrite = require("file-on-write");

var writer = new FileOnWrite({ 
	path: './video',
	ext: '.jpg'
});
var consumer = new MjpegConsumer();

request("http://mjpeg.sanford.io/count.mjpeg").pipe(consumer).pipe(writer);
```

---
_Source: https://npm.io/package/mjpeg-consumer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
