diff --git a/src/Sender.cpp b/src/Sender.cpp index e9edde9..61be16d 100644 --- a/src/Sender.cpp +++ b/src/Sender.cpp @@ -31,6 +31,8 @@ int main(int argc, char* argv[]) { .default_value("60"); parser.add_argument("--file") .default_value("file.mp4"); + parser.add_argument("--bitrate") + .default_value("1G"); parser.add_argument("mode") .default_value("file"); parser.add_argument("-v") @@ -53,14 +55,15 @@ int main(int argc, char* argv[]) { exit(EXIT_FAILURE); } spdlog::set_level(static_cast(loglevel)); - spdlog::info("Log level: {}", loglevel); + std::cout << "Log level: " << loglevel << std::endl; spdlog::debug("Generating settings"); std::unordered_map settings({ {"RES_X", split_res(parser.get("--resolution"), "x")}, {"RES_Y", split_res(parser.get("--resolution"), "y")}, {"X", split_res(parser.get("--dimensions"), "x")}, {"Y", split_res(parser.get("--dimensions"), "y")}, - {"FRAMERATE", parser.get("--framerate")} + {"FRAMERATE", parser.get("--framerate")}, + {"BITRATE", parser.get("--bitrate")} }); Hyperwall::Hyperwall hyperwall = [&settings, &parser](std::string mode) { spdlog::info("Chosen mode: {}", mode); diff --git a/src/impl/FFmpeg.cpp b/src/impl/FFmpeg.cpp index 81fca0f..a630e07 100644 --- a/src/impl/FFmpeg.cpp +++ b/src/impl/FFmpeg.cpp @@ -5,6 +5,7 @@ #include #include +#include #include "FFmpeg.hpp" diff --git a/src/impl/Hyperwall.cpp b/src/impl/Hyperwall.cpp index bfe75e0..c3ce33e 100644 --- a/src/impl/Hyperwall.cpp +++ b/src/impl/Hyperwall.cpp @@ -2,11 +2,13 @@ #include #include +#include + #include "Utils.hpp" #include "FFmpeg.hpp" #include "Hyperwall.hpp" -Hyperwall::FFmpeg default_ffmpeg(const int RES_X, const int RES_Y, const int X, const int Y, const int FRAMERATE, const int x, const int y) { +Hyperwall::FFmpeg default_ffmpeg(const int RES_X, const int RES_Y, const int X, const int Y, const int FRAMERATE, const std::string BITRATE, const int x, const int y) { Hyperwall::FFmpegBuilder builder; spdlog::debug("Creating default ffmpeg instance"); return builder.add("-re") @@ -22,6 +24,7 @@ Hyperwall::FFmpeg default_ffmpeg(const int RES_X, const int RES_Y, const int X, .add("-s", std::format("{}x{}", RES_X/X, RES_Y/Y)) .add("-r", std::to_string(FRAMERATE)) .add("-f", "rtsp") + .add("-b:v", BITRATE) .url(std::format("rtsp://0.0.0.0:8554/frame/{}/{}", x, y)) .build(std::format("ffmpeg-{}-{}.log", x, y)); } @@ -68,10 +71,11 @@ Hyperwall::Hyperwall::Hyperwall(VideoSourceT& source, std::unordered_map #include #include +#include #include "Sources/FileSource.hpp" #include "Sources/VideoSource.hpp"