Git Product home page Git Product logo

node-gstreamer-superficial's Introduction

node-gstreamer-superficial

Superficial GStreamer binding

What?

This is a superficial binding of GStreamer to nodejs. It does not attempt at being a complete binding, and will hopefully one day be replaced by (or implemented with) node-gir.

How?

var gstreamer = require('gstreamer-superficial');
var pipeline = new gstreamer.Pipeline("videotestsrc ! textoverlay name=text ! autovideosink");
pipeline.play();

Then, you can find an element within the pipeline, and set its properties:

var target = pipeline.findChild("text");

target.set("text", "Hello");
target.set( {
	"text":"Hello", 
	"font-desc":"Helvetica 32",
	} );

(see also examples/basic-pipeline.js)

Pipeline also knows .stop(), .pause() and .pollBus(), the elements returned by findChild support .set(object) and .set(name,value), appsinks also support .pull (see below).

Polling the GStreamer Pipeline Bus

You can asynchronously handle bus messages using Pipeline.pollBus(callback):

pipeline.pollBus( function(msg) {
	console.log( msg );
});

(see also examples/bus.js)

Handling binary data

You can feast off GStreamer's appsink to handle binary data. .pull starts a background work queue and calls your callback whenever a buffer is (or caps are) available:

var appsink = pipeline.findChild("sink");

appsink.pull( function(buf) {
	console.log("BUFFER size",buf.length);
}, function(caps) {
	console.log("CAPS",caps);
} );

(see examples/appsink.js)

A simple Ogg/Theora streaming server

is implemented in examples/streaming, just run server.js (requires express) and point your browser to http://localhost:8001. (Tested only with Chromium). This handles retaining the streamheader to feed first to every newly connected client.

Who?

gstreamer-superficial was written by Daniel Turing (mail AT danielturing.com) and currently licensed under the GPLv3. Pester me if you prefer a different License..

node-gstreamer-superficial's People

Contributors

dturing avatar linux4kix avatar

Stargazers

Anton avatar

Watchers

 avatar James Cloos avatar

Forkers

dasantonym

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.