All Projects → dturing → node-gstreamer-superficial

dturing / node-gstreamer-superficial

Licence: MIT license
Superficial gstreamer binding

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to node-gstreamer-superficial

Pitivi
MIRROR of https://gitlab.gnome.org/GNOME/pitivi for your convenience
Stars: ✭ 79 (-28.83%)
Mutual labels:  gstreamer
Meta Gstreamer1.0
OpenEmbedded layer for GStreamer 1.0
Stars: ✭ 134 (+20.72%)
Mutual labels:  gstreamer
Buildopencvtx2
Build and install OpenCV for the NVIDIA Jetson TX2
Stars: ✭ 249 (+124.32%)
Mutual labels:  gstreamer
Gstreamer Rockchip
The Gstreamer hardware encoder/decoder plugins for Rockchip platform
Stars: ✭ 86 (-22.52%)
Mutual labels:  gstreamer
Notes
let me know if my notes help you :D (it's a mess, I know)
Stars: ✭ 119 (+7.21%)
Mutual labels:  gstreamer
Openob
The Open Outside Broadcast project for radio contribution links and studio-transmitter links.
Stars: ✭ 140 (+26.13%)
Mutual labels:  gstreamer
Media Toc
Build a table of contents from a media file or split a media file into chapters
Stars: ✭ 59 (-46.85%)
Mutual labels:  gstreamer
parlatype
GNOME audio player for transcription
Stars: ✭ 151 (+36.04%)
Mutual labels:  gstreamer
Glide
Linux/macOS media player based on GStreamer and GTK+
Stars: ✭ 123 (+10.81%)
Mutual labels:  gstreamer
Quicktime video hack
Record iOS device audio and video
Stars: ✭ 177 (+59.46%)
Mutual labels:  gstreamer
Music
Music player and library designed for elementary OS
Stars: ✭ 92 (-17.12%)
Mutual labels:  gstreamer
Faster Mobile Retinaface
[CVPR 2020] Reimplementation of RetinaFace, faster and stronger.
Stars: ✭ 117 (+5.41%)
Mutual labels:  gstreamer
Stb Tester
Automated Testing for Set-Top Boxes and Smart TVs
Stars: ✭ 148 (+33.33%)
Mutual labels:  gstreamer
Mediasoup3 Record Demo
Simple Record Demo using Mediasoup 3 and GStreamer
Stars: ✭ 84 (-24.32%)
Mutual labels:  gstreamer
Smart-City-Sample
The smart city reference pipeline shows how to integrate various media building blocks, with analytics powered by the OpenVINO™ Toolkit, for traffic or stadium sensing, analytics and management tasks.
Stars: ✭ 141 (+27.03%)
Mutual labels:  gstreamer
Gst Plugin Rs
Rust crate for writing GStreamer plugins and various plugins - This repository moved to https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
Stars: ✭ 63 (-43.24%)
Mutual labels:  gstreamer
Pragha
Pragha is a Lightweight Music Player for GNU/Linux.
Stars: ✭ 136 (+22.52%)
Mutual labels:  gstreamer
kms-filters
Filter elements for Kurento Media Server
Stars: ✭ 15 (-86.49%)
Mutual labels:  gstreamer
vimix
Live Video Mixer
Stars: ✭ 172 (+54.95%)
Mutual labels:  gstreamer
Gaupol
Editor for text-based subtitle files
Stars: ✭ 159 (+43.24%)
Mutual labels:  gstreamer

gstreamer-superficial

Superficial GStreamer binding

What?

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

How?

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

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

const target = pipeline.findChild('text');

target.text = 'Hello';
Object.assign(target.text, {
	text: 'Hello', 
	'font-desc': 'Helvetica 32',
})

(see also examples/basic-pipeline.js)

Pipeline also knows .stop(), .pause() and .pollBus(), the elements returned by .findChild() getting and setting all properties the real GObjects do, appsinks also support .pull() (see below).

Seeking and Querying Position and Duration

There is a simple .seek(position, flags) function. Normally you should pass 1 for flags (GST_SEEK_FLAG_FLUSH). See Flags and Seek Docs.

You can query the pipeline's duration and current position with .getDuration() and .getPosition() (both might return -1). All time position values are in Seconds.

(see also examples/seek.js)

Polling the GStreamer Pipeline Bus

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

pipeline.pollBus(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:

const appsink = pipeline.findChild('sink');

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

	// !buf probably means EOS
}

appsink.pull(onData);

(see examples/appsink.js)

A simple Ogg/Theora streaming server

should be working as implemented in examples/streaming/
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 originally written by Daniel Turing, and has received contributions from various individuals as seen on github and in package.json.

Requisites

  • libgstreamer-plugins-base1.0-dev
  • libgstreamer1.0-dev
  • nan
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].