GithubHelp home page GithubHelp logo

peerstreamer's Introduction

Peerstreamer

peer to peer fast streaming using node.js

  • you need libzmq
  • python zerorpc

Then, npm install will install the dependencies listed in package.json

Setting Up

this will all be described on one machine, but works equally well on multiple machines

  1. First, you need a video source

    • create a video database: mkdir video_data
    • add a file: bin/split_video -d video_data -s $MY_AWESOME_MOVIE -c 1m -f myawesomemovie
    • run the video source: node node.js --name source --port 7999 --videodatabase video_data --ip 0.0.0.0
  2. Check that you can stream from this source:

    • node video_streamer.js --source tcp://0.0.0.0:7999 --filename myawesomemovie --interval 100
  3. Add nodes:

    • node node.js \
      --name <node name, must be unique for nodes sharing a master> \
      --port <what port should this node listen on> \
      --ip   <what is the ip address of this node> \
      --chunkdirectory <where should this nodes ChunkStore persist?> \
      --master <full address of master> \
      --supermaster <full address of supermaster, if one is setup> \
      

Example:

  • video source: node node.js --name source --port 7999 --videodatabase video_data --ip 0.0.0.0

  • make chunk directories: mkdir chunks/mit chunks/harvard chunks/ben chunks/alyssa chunks/john chunks/lawrence

  • level 1 node (1): node node.js --name mit --port 8000 --ip 0.0.0.0 --chunkdirectory chunks/mit --master tcp://0.0.0.0:7999

  • level 1 node (2): node node.js --name harvard --port 8001 --ip 0.0.0.0 --chunkdirectory chunks/harvard --master tcp://0.0.0.0:7999

  • level 2 node (1): node node.js --name ben --port 8002 --ip 0.0.0.0 --chunkdirectory chunks/ben --master tcp://0.0.0.0:8000 --supermaster tcp://0.0.0.0:7999

  • level 2 node (2): node node.js --name alyssa --port 8002 --ip 0.0.0.0 --chunkdirectory chunks/ben --master tcp://0.0.0.0:8000 --supermaster tcp://0.0.0.0:7999

  • level 2 node (3): node node.js --name john --port 8002 --ip 0.0.0.0 --chunkdirectory chunks/john --master tcp://0.0.0.0:8001 --supermaster tcp://0.0.0.0:7999

  • level 2 node (4): node node.js --name lawrence --port 8002 --ip 0.0.0.0 --chunkdirectory chunks/lawrence --master tcp://0.0.0.0:8001 --supermaster tcp://0.0.0.0:7999

  • Then use video_streamer.js to stream from any of them. They will cooperate, sharing among peers when possible.

peerstreamer's People

Watchers

James Cloos avatar  avatar Nolan Eastin avatar  avatar

Forkers

hunterchen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.