diff mbox series

[FFmpeg-devel,v2,2/7] lavc/libcodec2: Report actual bitrate used both when decoding and encoding

Message ID e8a8a5b0762e31471341487644d9bdbb679766fa.camel@haerdin.se
State New
Headers show
Series [FFmpeg-devel,v2,1/7] lavc/codec2utils: Use actual libcodec2 version | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/configure_x86 warning Failed to apply patch

Commit Message

Tomas Härdin Dec. 30, 2023, 9:23 p.m. UTC
Without this it looks like the encoder runs at 128 kbit/s

/Tomas
diff mbox series

Patch

From 5c913a3eaf5cf8c21edc119870b7fdc8251bd900 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <git@haerdin.se>
Date: Fri, 29 Dec 2023 14:09:51 +0100
Subject: [PATCH 2/7] lavc/libcodec2: Report actual bitrate used both when
 decoding and encoding

---
 libavcodec/libcodec2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c
index 950d48685e..2e03236b81 100644
--- a/libavcodec/libcodec2.c
+++ b/libavcodec/libcodec2.c
@@ -72,6 +72,7 @@  static av_cold int libcodec2_init_common(AVCodecContext *avctx, int mode)
     }
 
     codec2_set_natural_or_gray(c2->codec, 1);
+    avctx->bit_rate = avctx->sample_rate / avctx->frame_size * avctx->block_align * 8;
 
     return 0;
 
-- 
2.39.2