diff options
author | Cameron Gutman <[email protected]> | 2025-08-31 16:05:15 -0500 |
---|---|---|
committer | James Almer <[email protected]> | 2025-09-01 12:40:36 +0000 |
commit | 126671e73065e29c9582e47bc74774af2200fc8f (patch) | |
tree | 603f35d1162a2c99d342b90b38597ac8f1e31512 | |
parent | f2414fb1aa0dcc620ed043201d329b3fe43a4690 (diff) |
avcodec/mfenc: add AVLowLatencyMode support
Set CODECAPI_AVLowLatencyMode when AV_CODEC_FLAG_LOW_DELAY is enabled on
the AVCodecContext. AVLowLatencyMode can acheive lower latency encoding
that may not be accessible using eAVScenarioInfo options alone.
Signed-off-by: Cameron Gutman <[email protected]>
-rw-r--r-- | libavcodec/mfenc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c index 6f79386404..541f7fb961 100644 --- a/libavcodec/mfenc.c +++ b/libavcodec/mfenc.c @@ -876,6 +876,9 @@ static int mf_encv_output_adjust(AVCodecContext *avctx, IMFMediaType *type) if (c->opt_enc_scenario >= 0) ICodecAPI_SetValue(c->codec_api, &ff_CODECAPI_AVScenarioInfo, FF_VAL_VT_UI4(c->opt_enc_scenario)); + + if (avctx->flags & AV_CODEC_FLAG_LOW_DELAY) + ICodecAPI_SetValue(c->codec_api, &ff_CODECAPI_AVLowLatencyMode, FF_VAL_VT_UI4(1)); } return 0; |