Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thibauts/node-rtmpdump
A streamable wrapper around the rtmpdump CLI
https://github.com/thibauts/node-rtmpdump
Last synced: 2 months ago
JSON representation
A streamable wrapper around the rtmpdump CLI
- Host: GitHub
- URL: https://github.com/thibauts/node-rtmpdump
- Owner: thibauts
- Created: 2014-02-13T00:10:56.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-30T10:49:30.000Z (almost 10 years ago)
- Last Synced: 2024-08-10T23:44:31.241Z (5 months ago)
- Language: JavaScript
- Size: 151 KB
- Stars: 19
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
rtmpdump
=============
### A streamable wrapper around the rtmpdump CLIThis module is a thin wrapper around the `rtmpdump` binary. It provides
a readable stream you can pipe to your heart's content.The `rtmpdump` binary must be installed on your system.
The options are those used by `rtmpdump`, both short and long options are supported (see example).
`$ rtmpdump --help` to list them all.Installation
------------``` bash
$ npm install rtmpdump
```Example
-------``` javascript
var rtmpdump = require('rtmpdump');
var fs = require('fs');var options = {
rtmp: 'rtmp://host.tld/app/path',
playpath: 'mp4:playpath',
pageUrl: 'http://host.tld/somepage.html',
swfVfy: 'http://host.tld/player.swf',
v: null // parameter-less command line switches must have null as a value
};var stream = rtmpdump.createStream(options);
stream.on('connected', function(info) {
// info provides various details about the stream
// duration, resolution, codecs, ...
console.log(info);
});stream.on('progress', function(kbytes, elapsed, percent) {
console.log('%s kbytes read, %s secs elapsed, %s%%', kbytes, elapsed, percent);
});stream.on('error', function(err) {
// as usual, unhandled error events will throw
console.log(err);
process.exit(1);
});stream.pipe(fs.createWriteStream('video.mp4'));
```