Leave reference frames unspecified if REF_FRAMES_RESTRICT is not supported
FFmpeg codecs specify their own defaults that we shouldn't override.
This commit is contained in:
parent
808187397d
commit
8f74c3b482
1 changed files with 8 additions and 6 deletions
|
|
@ -1106,12 +1106,14 @@ namespace video {
|
||||||
|
|
||||||
ctx->keyint_min = std::numeric_limits<int>::max();
|
ctx->keyint_min = std::numeric_limits<int>::max();
|
||||||
|
|
||||||
if (config.numRefFrames == 0) {
|
// Some client decoders have limits on the number of reference frames
|
||||||
ctx->refs = video_format[encoder_t::REF_FRAMES_AUTOSELECT] ? 0 : 16;
|
if (config.numRefFrames) {
|
||||||
}
|
if (video_format[encoder_t::REF_FRAMES_RESTRICT]) {
|
||||||
else {
|
ctx->refs = config.numRefFrames;
|
||||||
// Some client decoders have limits on the number of reference frames
|
}
|
||||||
ctx->refs = video_format[encoder_t::REF_FRAMES_RESTRICT] ? config.numRefFrames : 0;
|
else {
|
||||||
|
BOOST_LOG(warning) << "Client requested reference frame limit, but encoder doesn't support it!"sv;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->flags |= (AV_CODEC_FLAG_CLOSED_GOP | AV_CODEC_FLAG_LOW_DELAY);
|
ctx->flags |= (AV_CODEC_FLAG_CLOSED_GOP | AV_CODEC_FLAG_LOW_DELAY);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue