1.0.0 • Published 4 years ago

gstreamer-recorder v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

gstreamer-recorder

License Downloads Donate Donate

GStreamer wrapper for recording desktop.

Requires GStreamer-1.0 with gst-launch-1.0 binary and following GStreamer1 plugins: base, good, bad, ugly.

Used by GNOME Shell Extension Cast to TV and gst-rec terminal app.

Examples

Record desktop directly to file:

var gstRecorder = require('gstreamer-recorder');
var recorder = new gstRecorder({
  output: 'file',
  format: 'mp4',
  file: {
    dir: '/tmp',
    name: 'My Recording'
  }
});
var duration = 10000;

recorder.start();
setTimeout(() => recorder.stop(), duration);

console.log(`Recording ${duration/1000} sec video to ${recorder.opts.file.dir}`);

Pipe output:

var fs = require('fs');
var gstRecorder = require('gstreamer-recorder');
var recorder = new gstRecorder({ output: 'stdout', format: 'matroska' });
var destFile = '/tmp/recording.mkv';
var writableStream = fs.createWriteStream(destFile);
var duration = 10000;

recorder.start().pipe(writableStream);
setTimeout(() => recorder.stop(), duration);

console.log(`Piping output to ${destFile} for ${duration/1000} seconds`);

Create tcp server:

var gstRecorder = require('gstreamer-recorder');
var recorder = new gstRecorder({ output: 'server', server: { port: 8080 }});

recorder.start();
process.on('SIGINT', () => recorder.stop());
process.on('SIGTERM', () => recorder.stop());

console.log(`Started tcp media server on port ${recorder.opts.server.port}`);

Donation

If you like my work please support it by buying me a cup of coffee :grin:

PayPal

1.0.0

4 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago