Preserve explicit VBV and report inactive call encoder state

This commit is contained in:
evgeny committed 2026-10-14 21:57:58 +02:00
1 parent 0f570edbd0
commit cab992228c
2 files changed
+5 -3

No files matched your search

+2 -1
View File
@@ -325,7 +325,8 @@ bool LiveVideoEncoder::setBitrate(int bitrate) {
#ifdef HAVE_FFMPEG
// libx264 перечитывает эти три значения через reconfig_encoder при подаче следующего кадра.
if (m->codec && m->name == "libx264" && m->config.profile == LiveVideoProfile::Automatic) {
m->codec->bit_rate = m->codec->rc_max_rate = bitrate; m->codec->rc_buffer_size = bitrate / 4; m->config.bitrate = bitrate;
m->codec->bit_rate = m->codec->rc_max_rate = bitrate;
m->codec->rc_buffer_size = m->config.vbvBits ? m->config.vbvBits : bitrate / 4; m->config.bitrate = bitrate;
DEBUG_INFO(DEBUG_CATEGORY_VIDEO, "desktop encoder bitrate updated in place name=libx264 bitrate=%d", bitrate); return true;
}
#endif