Socket
Book a DemoInstallSign in
Socket

woobi

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

woobi

stream media across a lan

Source
npmnpm
Version
1.0.9
Version published
Weekly downloads
3
-75%
Maintainers
1
Weekly downloads
 
Created
Source

Woobi Media Streams

LAN media server, IPTV broadcaster, and media converter.

  • Stream the same media to multiple locations at once using multicast or unicast/http.
  • Stream your desktop to gaming/live servers.
  • Use a tv tuner to stream OTA tv to all connected devices.

Contents

Pre-Requisites
Installation
Usage Woobi UI Configuration
Woobi.Sources

Woobi.Streams

Woobi.Channel

Screen Shots
Contributing
License

Pre-Requisites

You need ffmpeg and node >= v4.

Installation

yarn install woobi

Usage

var Woobi = require('woobi');
Woobi.init({
	channelPort: 13000,
	host: 'studio',
	loadSaved: true,
	proxy: {
		port: 7001,
		nodeadmin: false,
		host: '0.0.0.0',
		keystone: true, // required to save channel configs
		auth: false, // set to true once you create a new user @ /keystone
	},
	adapters:  [
		{
			name: 'mysql',
			adapter: 'mysql',
			config: {
				user: 'MYSQLUSER',
				pass: 'MYSQLPASS',
				host: 'MYSQLHOST',
				database: 'MYSQLDB'
			},
		}
	]
});

Woobi UI

http://localhost:7001
If you set the proxy option you can use the Woobi UI.

  • Create Channels
  • View Channels
  • Save / Manage Channels
  • View local library

Configuration

Woobi.init(options, callback)

@param - options - Object
@param - callback - Function
return Promise

optiontypeinfo
hostStringHost to use to access Woobi UI and api routes.
proxyfalse|ObjectOptional server for api routes and Woobi UI.
adaptersObject|ArrayAdapters for local media.
loadSavedBooleanLoad saved channels on boot that are set to autostart.
channelPortNumberIf a port is not supplied the port will be pulled starting at this number.
mediaPathStringFull path to store saved HLS files. Defaults to /module_path/media
media passthrough routeStringApi route to direct access media.
media passthrough pathStringReplace the path above with the actual server path.
video passthrough routeStringApi route to direct access videos.
video passthrough pathStringReplace the path above with the actual server path.
proxy object
optiontypeinfo
hostStringHost to start on. default 0.0.0.0
portObjectPort for api routes and Woobi UI access.
keystoneBooleanUse keystone if you want to save channel configs from the UI.
nodeadminBooleanLoad the nodeadmin app.
authBooleanUsed with keystone. Set to false at first to create a new user @ http://localhost/keystone

You can add any keystone option to the proxy configuration.
If you want to use channel saving and do not want to use keystone, then attach a mongoose model to Woobi.libs._mongo.ChannelConfig.model

adapters Array of Objects
optiontypeinfo
nameStringUnique name for the adapter. Can be accessed at Woobi.libs[name]
adapterObjectPort for api routes and Woobi UI access.
configObject
config.userStringusername
config.passStringpassword
config.hostStringhost
config.databaseStringdatabase

note - The default adapter name should be mysql.

Woobi.Sources

.File(options, callback)

@param - options - Object
@param - callback - Function

let file = new Woobi.Sources.File({
    name: 'Test',
    file: '/home/woobi/Pitures/woobi.mp3'
});
optiontypeinfo
nameStringUnique name for asset
fileObjectFull path to file.

.Fluent(options, callback)

@param - options - Object
@param - callback - Function

let fluent = new Woobi.Sources.Fluent({
    name: 'Test',
    file: '/home/woobi/Videos/woobi.mp4',
    streamable: true
});
optiontypeinfo
nameStringUnique name for asset
fileObjectoptional Full path to file.
streamObjectoptional Source stream.
progressBooleanEmit progress info.
metadataObjectObject of information about file. Should be flat with exception of the art key(an Array).
seekNumber
inputFormatString
inputOptionsArray|String
outputOptionsArray|String
videoFiltersObject
onlyOptionsArray|String
encodeBoolean
streamableBoolean
formatString

.Program(options, callback)

@param - options - Object
@param - callback - Function

let program = new Woobi.Sources.Program({
    name: 'TV',
    program: 'gnutv',
    arg: '-channels /home/woobi/dvb/channels.conf -out udp 10.10.10.82 13333 WAGA5',
    redo: '-channels /home/woobi/dvb/channels.conf -out udp 10.10.10.82 13333 ##CMD##',
});
optiontypeinfo
nameStringUnique name for asset
programStringProgram name.
argsStringArgument String.
redoStringString used to restart program.

.UDP(options, callback)

@param - options - Object
@param - callback - Function

let updSource = new Woobi.Sources.UDP({
    name: 'UDPSource',
    host: '10.10.10.10',
    port: 7005
});
optiontypeinfo
nameStringUnique name for asset
hostString
portNumber

Woobi.Streams

.bridge()

let bridge = new Woobi.Streams.bridge();

normal passthrough stream

.HLS(options, callback)

@param - options - Object
@param - callback - Function

let hls = new Woobi.Streams.HLS({
    name: 'Test',
    file: '/home/woobi/Videos/woobi.mp4',
    streamable: true
});
optiontypeinfo
nameStringUnique name for asset
fileObjectoptional Full path to file.
streamObjectoptional Source stream.
progressBooleanEmit progress info.
metadataObjectObject of information about file. Should be flat with exception of the art key(an Array).
seekNumber
inputFormatString
inputOptionsArray|String
outputOptionsArray|String
onlyOptionsArray|String
hlsOptionsArray|String
passthroughBoolean
streamableBoolean
formatString

.MpegTS(options, callback)

@param - options - Object
@param - callback - Function

let mpegts = new Woobi.Streams.MpegTS({
    name: 'Test',
    file: '/home/woobi/Videos/woobi.mp4',
    streamable: true
});
optiontypeinfo
nameStringUnique name for asset
programString
pathString
urlPathString
sourceObjectinput source.
videoString
audioString
otherString
segmentString

.throttle(source, rate, onEnd)

@param - source - Stream
@param - rate - Number @param - onEnd - Function

let throttle = new Woobi.Streams.throttle(stream, 1000);
// throttle.stream.pipe(somewhere)

.transform()

let transformer = new Woobi.Streams.transform();

transform stream

.UDP(options, callback)

@param - options - Object
@param - callback - Function

let updStream = new Woobi.Streams.UDP({
    name: 'UDPSource',
    host: '10.10.10.11',
    port: 7006
});
optiontypeinfo
nameStringUnique name for asset
hostString
portNumber

Woobi.Channel

Use Woobi.addChannel(name, opts).then() to add channels instead of directly with new Woobi.Channel(name, opts, callback). This gives a directory of channels for iptv.

/**
 * grabbing a tv tuner card
 **/
Woobi.addChannel('TV', {
	loop: true,
	assets: [
		{
			type: 'program',
			name: 'Air',
			arg: 'gnutv -channels /home/woobi/dvb/channels.conf -out udp 10.10.10.82 13333 WAGA5',
			redo: 'gnutv -channels /home/woobi/dvb/channels.conf -out udp 10.10.10.82 13333 ##CMD##',
		},
		{
			type: 'udpSink',
			port: 13333,
			host: '10.10.10.82',
			name: 'AirTV',
		},
		{
			type: 'udpStream',
			port: 13333,
			host: '10.10.10.87',
			name: 'streamAir'
		},
		
	],
}, (err) => {
	if(err) console.log('##ERROR##',err);
});

/**
 * using the library adapter
 **/
Woobi.libs.mysql.movies()
.then((movies) => {
    movies = movies.map(r => {
		return { name: r.name, file: r.file, progress: true, metadata: r, encode: false }
    });
    return Woobi.addChannel('recentMovies', {
		files: movies,
		loop: true,
		noTransition: true,
		hls: {
			type: 'hls',
			name: 'movieChannel',
			passthrough: true, // uses the stream as is / no transcoding
		}
    });
})
.catch((err) => {
    if(err) debug('##ERROR##',err);
});

// channel is now available at Woobi.channels['movieChannel']

Options

Adding Assets

Properties

API Routes

Watch / Listen

Screen Shots

Contributing

License

Keywords

ffmpeg

FAQs

Package last updated on 20 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts