Streaming a live camera

In this tutorial we set up a streaming session using PeerStreamer and VLC and we consume the RTP media content using the PeerStreamer-ng ReST interface.

Source setup

From the source side we need:
0. A media content (a live cam in this case)
1. A VLC RTP streaming session
2. A PeerStreamer instance serving RTP in a P2P overlay
3. An HTTP server serving the SDP file associated with the RTP flow

We use an Ubuntu platform, in which the live cam is captured through v4l2:///dev/video0
Clone and compile pstreamer to get the source streaming executable

Download our pre-packaged script and change the variable HOST_EXT_IP with the outer IP address of your machine, to be matched by the address chosen by PeerStreamer. PeerStreamer automatically detects the ip address but if, for some reasons, it picks the wrong interface, you can add to its configuration string (parameter "-c") iface=<interface_name>, where interface_name is for example eth0.

Running the script starts the VLC and pstreamer process plus a python instance serving the SDP file and it produces the file channels.csv which is supposed to be transferred to the consumer machine in some ways (through SERF).

Consumer setup

Clone and complie PeerStreamer-ng. Supposing you received the file channels.csv and you stored it in /tmp/channels.csv, run

$> ./peerstreamer-ng -c /tmp/channels.csv