-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrsconfig.js
77 lines (69 loc) · 1.94 KB
/
srsconfig.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const fs = require('fs');
async function genConfig(
match_id_court1, stream_id_court1,
match_id_court2, stream_id_court2,
match_id_court3, stream_id_court3,
match_id_court4, stream_id_court4)
{
const conf_str = `
# the config for srs to delivery stream for OSVB, rtmp + ffmpeg
listen 1935;
srs_log_tank file;
srs_log_file /root/SRS-CentOS6-x86_64-2.0.258/usr/local/srs/objs/osvb2-srs.log;
pid /root/SRS-CentOS6-x86_64-2.0.258/usr/local/srs/objs/osvb2.pid;
max_connections 1000;
vhost __defaultVhost__ {
transcode {
enabled on;
ffmpeg /root/bin/ffmpeg;
engine court2 {
enabled on;
vfilter {
loop 1;
f image2;
i /root/volleyscore-downloader/${match_id_court2}.png;
filter_complex 'overlay';
}
vcodec libx264;
vthreads 4;
vprofile main;
vpreset medium;
vparams {
}
acodec libfdk_aac;
aparams {
}
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine court4 {
enabled on;
vfilter {
loop 1;
f image2;
i /root/volleyscore-downloader/${match_id_court4}.png;
filter_complex 'overlay';
}
vcodec libx264;
vthreads 4;
vprofile main;
vpreset medium;
vparams {
}
acodec libfdk_aac;
aparams {
}
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
}
}`
fs.writeFileSync(
"/root/SRS-CentOS6-x86_64-2.0.258/usr/local/srs/conf/osvb2.conf",
conf_str, function(err)
{
if (err) {
return console.log(err);
}
console.log("OSVB config file updated");
});
}
module.exports = genConfig