Reduce ffmpeg latency

This commit is contained in:
Thulinma 2020-08-03 23:08:32 +02:00
parent 4fb1031508
commit 92cb7fb214

View file

@ -460,7 +460,7 @@ namespace Mist{
std::string samplerate; std::string samplerate;
if (sample_rate){samplerate = "-ar " + JSON::Value(sample_rate).asString();} if (sample_rate){samplerate = "-ar " + JSON::Value(sample_rate).asString();}
snprintf(ffcmd, 10240, snprintf(ffcmd, 10240,
"ffmpeg -hide_banner -loglevel warning -i - -acodec %s %s -strict -2 -ac 2 %s %s -f " "ffmpeg -fflags nobuffer -hide_banner -loglevel warning -i - -acodec %s %s -strict -2 -ac 2 %s %s -f "
"matroska -live 1 -cluster_time_limit 100 - ", "matroska -live 1 -cluster_time_limit 100 - ",
codec.c_str(), samplerate.c_str(), getBitrateSetting().c_str(), flags.c_str()); codec.c_str(), samplerate.c_str(), getBitrateSetting().c_str(), flags.c_str());
@ -586,7 +586,7 @@ namespace Mist{
if (!preset.empty()){options.append(" -preset " + preset);} if (!preset.empty()){options.append(" -preset " + preset);}
snprintf(ffcmd, 10240, "ffmpeg -hide_banner -loglevel warning -f lavfi -i color=c=black:s=%dx%d %s %s -c:v %s %s %s %s -an -force_key_frames source -f matroska - ", snprintf(ffcmd, 10240, "ffmpeg-fflags nobuffer -hide_banner -loglevel warning -f lavfi -i color=c=black:s=%dx%d %s %s -c:v %s %s %s %s -an -force_key_frames source -f matroska - ",
res_x, res_y, s_input.c_str(), s_overlay.c_str(), codec.c_str(), options.c_str(), res_x, res_y, s_input.c_str(), s_overlay.c_str(), codec.c_str(), options.c_str(),
getBitrateSetting().c_str(), flags.c_str()); getBitrateSetting().c_str(), flags.c_str());