1
0
mirror of https://github.com/BELABOX/belaUI.git synced 2026-07-04 14:46:41 +00:00

Set the bitrate and bind IPs filepaths in setup.json

Also moves the default bitrate file from the belacoder directory to /tmp
This commit is contained in:
rationalsa
2021-01-01 19:03:35 +00:00
parent 3257f1ec05
commit 24bb10a3a2
3 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ def set_bitrate(params)
return nil if max_br < 500 or max_br > 12000
return nil if min_br > max_br
File.write("#{$setup['belacoder_path']}/br", "#{min_br*1000}\n#{max_br*1000}\n")
File.write($setup['bitrate_file'], "#{min_br*1000}\n#{max_br*1000}\n")
return [min_br, max_br]
end
+3 -4
View File
@@ -24,11 +24,10 @@ def gen_ip_file(filename)
file.close()
end
ips_file = "/tmp/srtla_ips"
gen_ip_file(ips_file)
system("#{$setup['srtla_path']}/srtla_send 9000 #{ARGV[2]} #{ARGV[3]} #{ips_file} &")
gen_ip_file($setup['ips_file'])
system("#{$setup['srtla_path']}/srtla_send 9000 #{ARGV[2]} #{ARGV[3]} #{$setup['ips_file']} &")
while true do
system("#{$setup['belacoder_path']}/belacoder #{ARGV[0]} 127.0.0.1 9000 #{ARGV[1]} #{$setup['belacoder_path']}/br")
system("#{$setup['belacoder_path']}/belacoder #{ARGV[0]} 127.0.0.1 9000 #{ARGV[1]} #{$setup['bitrate_file']}")
sleep 0.5
end
+3 -1
View File
@@ -1,5 +1,7 @@
{
"hw": "jetson",
"belacoder_path": "/home/nvidia/belacoder/",
"srtla_path": "/home/nvidia/srtla/"
"srtla_path": "/home/nvidia/srtla/",
"bitrate_file": "/tmp/belacoder_br",
"ips_file": "/tmp/srtla_ips"
}