All Projects → matthew1000 → node-snowmix

matthew1000 / node-snowmix

Licence: other
A Node.JS library for the Snowmix video mixer

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to node-snowmix

vimix
Live Video Mixer
Stars: ✭ 172 (+855.56%)
Mutual labels:  gstreamer
AACS
Android Auto Server encapsulates communication with modern car infotainment system
Stars: ✭ 138 (+666.67%)
Mutual labels:  gstreamer
photos
Photo viewer and organizer designed for elementary OS
Stars: ✭ 101 (+461.11%)
Mutual labels:  gstreamer
kms-filters
Filter elements for Kurento Media Server
Stars: ✭ 15 (-16.67%)
Mutual labels:  gstreamer
telecarla
TELECARLA: An Open Source Extension of the CARLA Simulator for Teleoperated Driving Research Using Off-the-Shelf Components
Stars: ✭ 34 (+88.89%)
Mutual labels:  gstreamer
surfacecast
SurfaceCast: send background-subtracted depth camera video via GStreamer (with optional perspective correction)
Stars: ✭ 22 (+22.22%)
Mutual labels:  gstreamer
Buildopencvtx2
Build and install OpenCV for the NVIDIA Jetson TX2
Stars: ✭ 249 (+1283.33%)
Mutual labels:  gstreamer
reco
A simple audio recording app for modern Linux desktop environment like Pantheon
Stars: ✭ 47 (+161.11%)
Mutual labels:  gstreamer
APStreamline
Live Video Streaming Made Easy!
Stars: ✭ 98 (+444.44%)
Mutual labels:  gstreamer
gpt
Simple GoPro media organization tool
Stars: ✭ 37 (+105.56%)
Mutual labels:  gstreamer
node-gstreamer-superficial
Superficial gstreamer binding
Stars: ✭ 111 (+516.67%)
Mutual labels:  gstreamer
subtitleeditor
Subtitle Editor is a GTK+3 tool to create or edit subtitles for GNU/Linux/*BSD.
Stars: ✭ 79 (+338.89%)
Mutual labels:  gstreamer
zed-gstreamer
GStreamer source plugin for ZED Cameras
Stars: ✭ 34 (+88.89%)
Mutual labels:  gstreamer
parlatype
GNOME audio player for transcription
Stars: ✭ 151 (+738.89%)
Mutual labels:  gstreamer
gstcefsrc
A simple gstreamer wrapper around Chromium Embedded Framework
Stars: ✭ 46 (+155.56%)
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 (+683.33%)
Mutual labels:  gstreamer
overscan
A live coding environment for live streaming video
Stars: ✭ 36 (+100%)
Mutual labels:  gstreamer
Me-TV
It's TV for me computer.
Stars: ✭ 39 (+116.67%)
Mutual labels:  gstreamer
object-detection-inference
Object detection inference from rtsp ip camera stream using gstreamer
Stars: ✭ 29 (+61.11%)
Mutual labels:  gstreamer
linux-show-player
Linux Show Player - Cue player designed for stage productions
Stars: ✭ 147 (+716.67%)
Mutual labels:  gstreamer

node-snowmix

node-snowmix is a Node.JS library for the excellent Snowmix video mixer. It allows you to create video and audio inputs (feeds), switch between them, and add graphics on top.

Installation

  • This library has been tested on MacOS and Linux
  • Snowmix must be downloaded & installed
  • The gstreamer command-line, version 1.x, is also required. (Install this via your package manager.)
  • Node.JS must be version 6 or higher
  • If you haven't got a Node development underway, create one with npm init
  • Install node-snowmix using npm:
$ npm i --save node-snowmix

Introduction

Snowmix is tool that's built on GStreamer. Snowmix allows the video & audio so that they can be mixed and changed in real-time. This library, node-snowmix, helps you control Snowmix, and provides methods that make it easy to do common tasks, such as switching video and adding text.

This library models and provides helper functions for feeds, vfeeds (virtual feeds), audio feeds, texts, and images. Other things (e.g. shapes) can still be handled by sending the relevant Tcl commands.

This library does not currently start Snowmix. Nor does it help control the (GStreamer) inputs and outputs, though there are some example scripts to get you going.

Usage

node-snowmix is a class that needs instantiating, using the new() method.

let Snowmix = require('node-snowmix'),
    snowmix = Snowmix.new()

port and host can be optionally provided, to override the defaults (which are 9999 and 127.0.0.1, respectively), e.g.

snowmix = Snowmix.new({ port: 1234 })

(Multiple Snowmix instances can be created if you are running multiple Snowmixes on different ports/hosts. If the same host/port is requested multiple times, the same Snowmix instance is supplied to prevent multiple identical connections.)

Sending raw Snowmix commands

Snowmix is controlled by a range of commands. Use this library to send any Snowmix command with sendCommand():

snowmix.connect()
.then(() => {
    return snowmix.sendCommand('system geometry')
})
.then(response => {
    console.log('System geometry response:', response)
    return snowmix.close()
})

However, the real benefit comes when you use the helper functions, which make it easier to provide parameters and understand Snowmix's response. Fore example, geometry can be fetched with:

snowmix.connect()
.then(() => {
    let geometry = snowmix.systemInfo.systemGeometry
    console.log(`The system geometry width is ${geometry.width} and height is ${geometry.height}`)
    return snowmix.close()
})

Helper functions around video, audio, text and images are available, and summarised below.

Video control

In an OO style, video feeds, and virtual video feeds, are given instances of the 'Feed' and 'Vfeed' class (respectively). Any existing feeds/vfeeds are automatically populated when this library first connects to Snowmix.

Access feeds by ID using snowmix.feeds.byId(<FEED ID>) And likewise, vfeeds with snowmix.vfeeds.byId(<VFEED ID>)

All feeds can be accessed with snowmix.feeds.all(), and the same for vfeed. For example, to see how many vfeeds there are:

snowmix.connect()
.then(() => {
    console.log(`There are ${snowmix.vfeeds.all().length} vfeeds.`)
})

To switch to a vfeed (and only that vfeed), use switch():

snowmix.vfeeds.byId(1).switch()
.then(() => { console.log('Enjoy watching vfeed 1!') })

This is plain video switching - full-screen switching, nothing more. (It is hoped to offer more powerful video switching, such as picture-in-picture, in the future. In the mean time, you can use sendCommand() to access all of Snowmix's abilities.)

Audio control

Audio feeds can also be switched, on the audio mixer. For example, this command switches audio mixer 1 exclusively to audio feed 2:

snowmix.audioMixers.byId(1).switchToAudioFeeds(2)
.then(() => { ... })

It is hoped to offer more flexible offers (e.g. volume control) in the future. Until then, if you need it, please raise an Issue, address with a pull request, or work around with sendCommand().

Text

To overlay text on your video, create a 'Text' object, and then show() it.

var myText1 = snowmix.texts.create({ string: 'Snowmix is great!' })
myText1.show()
.then(() => { ... })

By default, text will be shown in the bottom-left, black on a translucent grey background.

All fields can be overridden, such as x and y (to set the location) and location (which can be one of ne, nw, se, sw).

Images

To overlay a PNG image on your video, create a 'Image' object, and then create a place for it.

snowmix.images.create({ id: 1, filename: '/path/to/image.png' })
.then(image => {
    return image.addPlace({x: 100, y: 200})
    .then(imagePlace => {
        return imagePlace.show()
    })
})

Full Documentation and tutorials...

...are available here

Further examples...

...can be found in the examples/ directory.

## Debugging (including seeing the commands & responses with Snowmix)

To see the commands sent and responses received from Snowmix, and gstreamer, set the LOG_LEVEL environment variable to debug:

export LOG_LEVEL=debug

(Or for even more, set to silly.)

Conclusions, Contributions, Feedback

It is hoped that this library hits the sweet-spot between simplicity (helper functions that get you off the ground quickly) and flexibility (access to Snowmix's commands directly).

Feedback welcome via 'Issues'. Contributions (pull requests) also very welcome.

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].