Gathering detailed insights and metrics for gstreamer-superficial-cf
Gathering detailed insights and metrics for gstreamer-superficial-cf
Gathering detailed insights and metrics for gstreamer-superficial-cf
Gathering detailed insights and metrics for gstreamer-superficial-cf
npm install gstreamer-superficial-cf
Typescript
Module System
Min. Node Version
Node Version
NPM Version
69.9
Supply Chain
98.8
Quality
75.2
Maintenance
100
Vulnerability
100
License
C++ (86.3%)
Python (9.09%)
CMake (2.76%)
JavaScript (1.86%)
Total Downloads
281
Last Day
1
Last Week
2
Last Month
6
Last Year
66
104 Commits
2 Watching
2 Branches
1 Contributors
Latest Version
1.8.0
Package Id
gstreamer-superficial-cf@1.8.0
Unpacked Size
0.99 MB
Size
0.96 MB
File Count
31
NPM Version
8.19.2
Node Version
16.18.1
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
2
Compared to previous week
Last month
-33.3%
6
Compared to previous month
Last year
-24.1%
66
Compared to previous year
Note: This is a fork from https://github.com/dturing/node-gstreamer-superficial that adds a new method
getPad
that case be used to get pads and change their properties at pipeline play-time. See https://github.com/dturing/node-gstreamer-superficial/pull/56 for details. The plan is to delete this fork and published package when the above PR is merged into upstream and a new version of the package is released.
Superficial GStreamer binding
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.
1const gstreamer = require('gstreamer-superficial'); 2const pipeline = new gstreamer.Pipeline(`videotestsrc ! textoverlay name=text 3 ! autovideosink`); 4 5pipeline.play();
Then, you can find an element within the pipeline, and set its properties:
1const target = pipeline.findChild('text'); 2 3target.text = 'Hello'; 4Object.assign(target.text, { 5 text: 'Hello', 6 'font-desc': 'Helvetica 32', 7})
(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 GObject
s do, appsinks also support .pull()
(see below).
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)
You can asynchronously handle bus messages using Pipeline.pollBus(callback):
1pipeline.pollBus(msg => { 2 console.log(msg); 3});
(see also examples/bus.js)
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:
1const appsink = pipeline.findChild('sink'); 2 3function onData(buf, caps) { 4 if (caps) { 5 console.log('CAPS', caps); 6 } 7 if (buf) { 8 console.log('BUFFER size', buf.length); 9 appsink.pull(onData); 10 } 11 12 // !buf probably means EOS 13} 14 15appsink.pull(onData);
(see examples/appsink.js)
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.
gstreamer-superficial was originally written by Daniel Turing, and has received contributions from various individuals as seen on github and in package.json.
libgstreamer-plugins-base1.0-dev
libgstreamer1.0-dev
nan
No vulnerabilities found.
No security vulnerabilities found.