A simple program that accepts RTMP streams and then restreams them directly to other services. I use it to record at a higher rate but stream to target services at the rate they want. It's also useful for streaming to multiple sites.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
distributary/config.cpp

27 lines
656 B

#include "config.hpp"
#include <fstream>
using namespace nlohmann;
Config::Config(const string json_file) {
load(json_file);
}
void Config::load(const string file_name) {
std::ifstream infile(file_name);
json_config = json::parse(infile);
listen_at = json_config["listen_at"].template get<string>();
fail_max = json_config["fail_max"].template get<int>();
json send_list = json_config["send_to"];
for(auto &el : send_list.items()) {
json spec = el.value();
SendTo send_spec{
.url = spec["url"].template get<string>(),
.bitrate = spec["bitrate"].template get<string>()
};
send_to[el.key()] = send_spec;
}
}