Git Product home page Git Product logo

Snowem is a lightweight live streaming server, based on webrtc technology. Snowem has three built-in subsystems.

  • RESTful Web Service is used for channel management.
  • Websocket Sevrer plays a role of signaling service in WebRTC stack.
  • Media Server is basically SFU in WebRTC stack, it handles ICE protocol and forward media streams among peers.

Compile and setup Snowem

Snowem depends on the following libraries to build:

  • libopenssl.
  • libevent v2.1.xxx with openssl support.
  • libnettle.
  • libsofia-sip-ua.
  • libsrtp.
  • libconfig.
  • libbsd

Notes:

  • on Ubuntu system, one may install the following packages:
apt-get install libbsd-dev libbsd0 libssl1.0.0 libssl-dev libevent-dev \
libsofia-sip-ua-dev libsofia-sip-ua0 libsrtp0 libsrtp0-dev libnettle6 \
nettle-dev libconfig9 libconfig-dev libbsd0 libbsd-dev
  • for installing libevent 2.1.xx, one may do the following:
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar xfz libevent-2.1.8-stable.tar.gz 
cd libevent-2.1.8-stable
./configure --prefix=/usr/local
make && make install
  • on Ubuntu system, supporting ffmpeg requires to install the following packages:
apt-get install libavutil-dev libavresample-dev libavfilter-dev\
libavdevice-dev libavcodec-dev libavformat-dev

To build Snowem, execute the following commands:

git clone https://github.com/snowem/snowem.git
cd snowem
git submodule init
git submodule update
mkdir build
cd build
cmake ..
make
make install

Run Snowem

The configuration file is written in format of libconfig. The sample file is available at snowem.conf.

# General settings
cert_file = "<path-to-cert-file>"
key_file = "<path-to-key-file>"

# Websocket settings
wss_bind_ip = "0.0.0.0"
wss_bind_port = 8443

# Log level: TRACE=0, DEBUG=1, INFO=2, WARN=3, ERROR=4, FATAL=5
log_level = 1
log_file_maxsize = 10000000
log_rotate_num = 10
base_log_path = "<path-to-dir>"

To run Snowem, simple execute:

snowem <path-to>/snowem.conf

Check live demo at here.

Example

Source code of example is available at here.

To publish atream: if no camera available, then video file can be used as media source, check here.

var config = {
    'type': 'camera',
    'localNode': document.getElementById('localVideo'),
    'remoteNode':  document.getElementById('remoteVideo'),
    'media': {
      'audio': true,
      'video': true,
    },
  }
  var publishStream = new snowem.Stream(host, 8443)
  publishStream.publish(config)

To play a remote stream: to play a remote stream, you need stream id of the remote stream.

var config = {
  'streamid': streamId,
  'remoteNode':  document.getElementById('remoteVideo'),
  'audio': true,
  'video': true
 };
var playStream = new snowem.Stream(host, 8443)
playStream.play(config)

snowem's Projects

libcice icon libcice

An implementation of ICE-Lite protocol.

sdkjs icon sdkjs

Javascript sdk for snowem server.

snowem icon snowem

Snowem is a lightweight live streaming server, based on webrtc technology. Its design mainly focuses on simplicity, scalability and high performance.

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.