npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-snowmix

v0.2.0

Published

A Node.JS library to the Snowmix video mixer

Downloads

18

Readme

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 or stop 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

As with video, switch to an audio source using switch() on the relevant AudioFeed instance:

snowmix.audioFeeds.byId(1).switch()
.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).

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.