Statistics
| Branch: | Revision:

peerstreamer-src / README.md @ 3127f1c4

History | View | Annotate | Download (3.52 KB)

1
# PeerStreamer-ng (ffmpeg based)
2

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

    
6
## Compilation
7

    
8
You can get the executable by running:
9

    
10
``
11
$> make
12
``
13

    
14
To turn on all the debugging features, set the DEBUG environment variable:
15

    
16
``
17
$> DEBUG=1 make
18
``
19

    
20
## Test
21

    
22
PeerStreamer-ng comes with a unit test suite. It does require valgrind
23
installed to run.  In the "test" folder are stored the test files. To run them
24
and check code consistency run:
25

    
26
``
27
$> make tests
28
``
29

    
30
## Example
31

    
32
In test\_script directory there are a few scripts that can be used to perform a
33
quick test of PeerStreamer-ng using the loopback interface. The test scenario
34
is very simple as it involves only a single PeerStreamer source.
35

    
36
Currently the scripts have been tested only on Ubuntu 16.04LTS.
37

    
38
Currenlty this version of PeerStreamer-ng supports only the Desktop version fo
39
Chrome browser.
40

    
41
NOTE: for installing ffmpeg and downloading the video file you need an Internet
42
connection.
43

    
44
First of all, the scripts relies on a custom built ffmpeg version for streaming
45
the video. Dont' use the ffmpeg version shipped by the package manager of your
46
OS distribution.
47

    
48
You can use the script ffmpeg\_install.sh for building the ffmpeg tool with the
49
required configuration. By default the custom ffmpeg tool will be installed in
50
${HOME}/ffmpeg-src/install. You can change this by modifing the value of the
51
variable FFDIR inside the ffmpeg\_install.sh script. Once the FFDIR variable
52
has been set to the desired value, run the following command:
53

    
54
```
55
./ffmpeg_install.sh
56
```
57

    
58
Then you will need a video to stream. You can download the one we used for
59
testing [sintel.m4v](https://drive.google.com/uc?id=1Phz0HYduIH2X2eMWvYIhUnVzq8_TuqhR&export=download)
60

    
61
Alternatively, you can generate your own file by using h264 encoding for the
62
video and AAC encoding for the audio. Moreover, we currently tested
63
PeerStreamer-ng using a video/audio file with the following characteristics:
64
for the h264 encoding we used the main profile with level 3.1, a constant frame
65
rate of 30fps and a constant bitrate of 2000kbps. For the AAC encoding,
66
instead, we used a sampling rate of 48kHz with a constant bitrate of 160kbps.
67

    
68
Once you have both the custom ffmpeg version and the video to stream you can
69
use the scripts start\_psng.sh and rtp\_source.sh for running the actual test.
70
However, before proceeding, you must open the script start\_psng.sh and set the
71
value of the variable PSNGBASEDIR to the directory where you cloned
72
PeerStreamer-ng. Then open the script rtp\_source.sh and modify the following
73
variables:
74

    
75
* FFMPEGBIN: this must point to the ffmpeg executable you built with the script
76
  ffmpeg\_install.sh
77

    
78
* PSTREAMERBIN: this must point to the pstreamer executable. If $PS is the
79
  directory where PeerStreamer-ng has been cloned, then the pstreamer
80
  executable is located in $PS/Libs/pstreamer/pstreamer.
81

    
82
* VNAME: thism must be set to the full path name of the video file.
83

    
84
At this point you can execute the source pstreamer by running in a terminal tab
85
the following command:
86

    
87
```
88
./rtp_source.sh 30000 5001
89
```
90

    
91
where the first parameter is the port used by the source pstreamer and the
92
second parameter is the RTP base port.
93

    
94
In a second terminal tab execute the following command for starting
95
peerstreamer-ng:
96

    
97
```
98
./start-psng.sh
99
```
100

    
101
Finally, use Chrome for connecting to http://localhost:3000 and select the
102
"Sintel" channel from the list on the right.
103

    
104

    
105
## References
106

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