Broadcast and charge Bitcoin for video streams. You can use any file or output of software like OBS or AWS MediaLive to stream to Dazaar.
- Broadcast video from multiple compatible sources.
- RTMP (OBS, AWSMediaLive, Wowzer ..etc)
- Video files (MKV, MP4)
- Convert data sources to HLS segments
- Charge for per second of streaming of video via Lightning network
- Based on Dazaar and Hypercore
- Lightning Network Node: LND and C-Lightning
- A video source (File, RTMP Stream)
- FFMPEG for transcoding input into HLS
- Make sure
ffmpeg
isPATH
- Make sure
You can start charging for streams right now with a LND node.
// First setup of config.json.
node index.js -f <path to video file> // Stream a video file
node index.js -r // Stream from a RTMP stream from `config.rtmp` setting
When Station key is available, you can share the key with your viewers.
Streamer class deals with broadcasting data to Dazaar and handling payment processing
{
"rpcPort": "127.0.0.1:9001", // RPC port for LN node
"lnddir": "~/.lightning", // Lightning Node Directory
"network": "regtest", // Bitcoin network (Mainnet, testnet)
"implementation": "lnd", // LND, C-Lightning
"stream_price":"1 Sat/s" // Price per second in Satoshi
"rtmp":"rtmp://127.0.0.1:9001" // RTMP server bind address. (Only in RTMP mode)
}
Streamer's Dazaar instance
Streamer's Dazaar Lightning instance
Connects to DHT and prepares to broadcast.
Broadcasts a video file.
Emitted when the public key for the broadcast has been created.
Append data to the feed.
- Media must be
Buffer
- Meta is a JSON object that will be encoded with Protobuffer. See
bs.proto
for schema.- Meta is used to pass HLS playlist info
HLS class deals with encoding an incoming stream with fluent-ffmpeg
{
"PLAYLIST_PATH" : "./.playlist", //Folder where the HLS output is saved
"PLAYLIST_FILE" : "output.m3u8", //Name of playlist file
}
Delete the current playlist path and make a new empty directory
Start encoding a readable stream
Information about the encoder progress
Information about the encoder has started converting
Encoder has finished converting
The encoder has encountered an error
Serialize a HLS playlist for broadcasting
{
"PLAYLIST_PATH" : "./.playlist", //Folder where the HLS output is saved
"PLAYLIST_FILE" : "output.m3u8", //Name of playlist file
}
Tail a playlist file and start emitting media on the fly.
A new HLS segment is ready and will be processed.
A new HLS segment media chunk
A segment has finished being read.