# png-split-stream

> Split a concatenated stream of PNG images into individual PNG frames

Latest version **1.0.1** (published 2016-11-14) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install png-split-stream
pnpm add png-split-stream
yarn add png-split-stream
bun add png-split-stream
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-11-14 |
| First published | 2016-11-11 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Eugene Ware |
| Maintainers | eugeneware |
| Keywords | png, stream, streaming, streams |

## Links

- npm: https://www.npmjs.com/package/png-split-stream
- Repository: https://github.com/eugeneware/png-split-stream
- Homepage: https://github.com/eugeneware/png-split-stream#readme
- Issues: https://github.com/eugeneware/png-split-stream/issues
- npm.io page: https://npm.io/package/png-split-stream

## Dependencies (2)

- [bl](https://npm.io/package/bl.md) ^1.1.2
- [buffer-equal](https://npm.io/package/buffer-equal.md) ^1.0.0

## 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

- 1.0.1 (latest) — 2016-11-14
- 1.0.0 — 2016-11-11

## README

# png-split-stream

Split a concatenated stream of PNG images into individual PNG frames

[![build status](https://secure.travis-ci.org/eugeneware/png-split-stream.png)](http://travis-ci.org/eugeneware/png-split-stream)

## Installation

This module is installed via npm:

``` bash
$ npm install png-split-stream
```

## Example Usage

### Reading a concatenated PNG file

``` js
var pngSplitStream = require('png-split-stream');

// all.png is a concatenation of multiple PNGs
// eg. `cat a.png b.png > all.png`
fs.createReadStream(__dirname + '/fixtures/all.png')
  .pipe(pngSplitStream())
  .on('data', function(data) {
    // each 'data' event contains one of the whole images as a single chunk
    console.log(data.slice(1, 4));
    // 'PNG'
  });
```

### Splitting an ffmpeg `image2pipe` PNG stream

``` js
var ffmpegBin = require('ffmpeg-static');
var spawn = require('child_process').spawn;
var ffmpeg = spawn(ffmpegBin.path, [
  '-i', 'myfile.mp4',
  '-f', 'image2pipe',
  '-vcodec', 'png',
  '-'
]);
ffmpeg.stdout
  .pipe(pngSplitStream())
  .on('data', function (data) {
    // each 'data' event contains one of the frames from the video as a single chunk
    console.log(data.slice(1, 4));
    // 'PNG'
  });
```

### Acknowledgements

This code was heavily adapted and stripped down for just splitting purposes
from [@devongott/png-stream](https://github.com/devongovett/png-stream).

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