Statistics
| Branch: | Revision:

peerstreamer-src @ 58fb2cdc

Name Size Revision Age Author Comment
  Libs 0d8b0d2f over 2 years Luca Baldesi add janus submodule for RTP/WEBRTC streaming
  Public 58fb2cdc about 2 years Luca Baldesi Add web source creation files
  Test 3af4c8d7 about 2 years Luca Baldesi add source creation feature add ReST interface...
  Tools 58fb2cdc about 2 years Luca Baldesi Add web source creation files
  src 58fb2cdc about 2 years Luca Baldesi Add web source creation files
.gitignore 66 Bytes 92a361ca over 2 years Luca Baldesi return the channel name with the channel creati...
.gitmodules 428 Bytes a89389f2 over 2 years Luca Baldesi fix remote path for the janus-gateway submodule...
COPYING 33.7 KB 9eb656e7 about 3 years Luca Baldesi First commit Add ReST URL router Add the task ...
Makefile 2.07 KB 3af4c8d7 about 2 years Luca Baldesi add source creation feature add ReST interface...
README.md 3.08 KB 54b339eb over 2 years Luca Baldesi add tutorial for streaming a usb camera through...
peerstreamer-ng.c 5 KB c81c126e over 2 years Luca Baldesi integrate Janus platform with PeerStreamer-ng (...

Latest revisions

# Date Author Comment
58fb2cdc 01/25/2018 02:43 PM Luca Baldesi

Add web source creation files

3af4c8d7 01/24/2018 01:33 PM Luca Baldesi

add source creation feature

add ReST interface for source management; sources are served through
the Janus videoroom plugin.

54b339eb 12/20/2017 04:38 PM Luca Baldesi

add tutorial for streaming a usb camera through WebRTC

a89389f2 12/04/2017 11:50 AM Luca Baldesi

fix remote path for the janus-gateway submodule

path referred to the ssh service, change it to https

92a361ca 12/01/2017 10:30 AM Luca Baldesi

return the channel name with the channel creation json answer

add utilities functions, refactor streamer_creation_callback

a95383e2 11/30/2017 06:35 PM Luca Baldesi

change default player page to handle janus_streaming_id

PeerStreamer-ng now exploits Janus gateway to deliver RTP streams

c81c126e 11/30/2017 04:22 PM Luca Baldesi

integrate Janus platform with PeerStreamer-ng (back-end)

add a module to drive the Janus executable and create/destroy RTP mountpoints

7c37cd35 11/27/2017 12:36 PM Luca Baldesi

switch to http transport module

2123cd4e 11/24/2017 04:30 PM Luca Baldesi

set janus transport layer to UNIX socket

minimize the janus configuration and store it in Tools/janus_conf

0d8b0d2f 11/20/2017 01:31 PM Luca Baldesi

add janus submodule for RTP/WEBRTC streaming

View all revisions | View revisions

README


PeerStreamer-ng

PeerStreamer-ng [1] is P2P rel-time streaming platform. It is specifically design for mesh networks and it is meant to be purely decentralized.

Documentation

You can find documentation on usage and development on the official wiki: https://ans.disi.unitn.it/redmine/projects/peerstreamer-ng/wiki

Compilation

You need to install Janus dependencies, on ubuntu: aptitude install libmicrohttpd-dev libjansson-dev libnice-dev \ libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev \ libopus-dev libogg-dev libcurl4-openssl-dev pkg-config gengetopt \ libtool automake

After that, you can get the executable by running: $> make

To turn on all the debugging features, set the DEBUG environment variable: $> DEBUG=1 make

Test

PeerStreamer-ng comes with a unit test suite. It does require valgrind installed to run. In the "test" folder are stored the test files. To run them and check code consistency run: $> make tests

Tutorial: Stream a web camera with WebRTC

Tested on Ubuntu 17.10

In this tutorial we are creating a streaming source first, * Acquiring a media content from a local (usb) camera; * Encapsulating it in a RTP stream; * Creating a pstreamer P2P overlay; * Injecting the RTP stream in the overlay.

Then, we will launch PeerStreamer-ng to serve the P2P stream to the user through a browser supporting WebRTC.

The source

The following script captures a usb camera (/dev/video0) with FFmpeg which is used to stream it locally through RTP. It is important to note, to be able to serve the stream through WebRTC, FFmpeg must transcode the video with VP8. It also launches a source instance of pstreamer that takes such stream in input and use P2P mechanism to distribute it to the attaching peers.

Overall, this script creates a PeerStreamer-ng channel at IP address 127.0.0.1 on port 6000 and it saves its description on a local channel list file called channels.csv which we will use to feed PeerStreamer-ng with.

``` NAME="My Channel" VIDEO=/dev/video0 SDPFILE="file://${PWD}/channel.sdp" SOURCEPEERPORT=6000 RTPBASEPORT=5002 HOSTEXTIP=127.0.0.1

echo "$NAME,$HOSTEXTIP,$SOURCEPEERPORT,QUALITY,http://$HOSTEXTIP:8000/channel.sdp" > channels.csv

ffmpeg -re -i ${VIDEO} -vcodec libvpx -deadline realtime -an -f rtp rtp://127.0.0.1:$((RTPBASEPORT+2))\ -sdpfile $SDPFILE & FFMPEGPID=$!

Libs/pstreamer/pstreamer -p 0 -c "iface=lo,port=$SOURCEPEERPORT,chunkiser=rtp,audio=$RTPBASEPORT,\ video=$((RTPBASEPORT+2)),addr=127.0.0.1,maxdelayms=50" SOURCEPEERPID=$!

trap "kill $SOURCEPEERPID $FFMPEG_PID" SIGINT SIGTERM EXIT ```

You can download the script above from the project site.

PeerStreamer-ng

The following command executes PeerStreamer-ng and it start the HTTP interfaces. Pages are now served on port 3000 (overridable through the flags, see the command line help).

./peerstreamer-ng -c channel.csv

References

[1] https://ans.disi.unitn.it/redmine/projects/peerstreamer-ng

Also available in: Atom