This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 695768baed avcodec/libx265: set has_b_frames
695768baed is described below

commit 695768baedfef8eab6e75129750ecec9fd1c6728
Author:     Baptiste Coudurier <[email protected]>
AuthorDate: Thu Nov 12 13:47:45 2026 -0800
Commit:     Baptiste Coudurier <[email protected]>
CommitDate: Fri Nov 13 16:42:30 2026 +0000

    avcodec/libx265: set has_b_frames
    
    The wrapper never reported the encoder's reorder delay, unlike libx264.
    Export it from the parameters the encoder actually uses, since
    x265_encoder_open() may change bframes and b-pyramid (all-intra,
    intra refresh, MCSTF, temporal layers).
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Baptiste Coudurier <[email protected]>
---
 libavcodec/libx265.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 0ec4f87f5f..a6738aaa9b 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -608,6 +608,11 @@ static av_cold int libx265_encode_init(AVCodecContext 
*avctx)
         return AVERROR_INVALIDDATA;
     }
 
+    /* x265 may adjust the B-frame settings when opening the encoder */
+    ctx->api->encoder_parameters(ctx->encoder, ctx->params);
+    avctx->has_b_frames = ctx->params->bframes ?
+                          ctx->params->bBPyramid ? 2 : 1 : 0;
+
     if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
         x265_nal *nal;
         int nnal;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to