* Revert "Revert vcpkg ffmpeg (#8751)"
This reverts commit 5c16a8302e6c9c1381873aff45dba1487ee51d4f.
* vcpkg: Reland ffmpeg and try to fix sciter build
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
* vcpkg: Detect AVX2 by requiring __m256i
(ubuntu18.04 sciter)
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
* Install nasm from debian buster and python3.7
... from ubuntu universe
[Skip CI]
* vcpkg: Add libyuv port with fix for windows
From
abc59feabf
Found by @deep-soft
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
* Bump vcpkg baseline to 2024.07.12
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
* Fix F-Droid version action
I thought the latest release will be updated by the time hook starts
but it is not the case. Get tag from GITHUB_REF instead if GITHUB_REF_TYPE
is "tag".
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
---------
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
72 lines
2.4 KiB
Diff
72 lines
2.4 KiB
Diff
From 4d0d20d96ad458cfec0444b9be0182ca6085ee0c Mon Sep 17 00:00:00 2001
|
|
From: 21pages <pages21@163.com>
|
|
Date: Sat, 24 Feb 2024 16:02:44 +0800
|
|
Subject: [PATCH 2/2] libavcodec/amfenc: reconfig when bitrate change
|
|
|
|
Signed-off-by: 21pages <pages21@163.com>
|
|
---
|
|
libavcodec/amfenc.c | 20 ++++++++++++++++++++
|
|
libavcodec/amfenc.h | 1 +
|
|
2 files changed, 21 insertions(+)
|
|
|
|
diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
|
|
index a033e1220e..3eab01a903 100644
|
|
--- a/libavcodec/amfenc.c
|
|
+++ b/libavcodec/amfenc.c
|
|
@@ -222,6 +222,7 @@ static int amf_init_context(AVCodecContext *avctx)
|
|
|
|
ctx->hwsurfaces_in_queue = 0;
|
|
ctx->hwsurfaces_in_queue_max = 16;
|
|
+ ctx->av_bitrate = avctx->bit_rate;
|
|
|
|
// configure AMF logger
|
|
// the return of these functions indicates old state and do not affect behaviour
|
|
@@ -575,6 +576,23 @@ static void amf_release_buffer_with_frame_ref(AMFBuffer *frame_ref_storage_buffe
|
|
frame_ref_storage_buffer->pVtbl->Release(frame_ref_storage_buffer);
|
|
}
|
|
|
|
+static int reconfig_encoder(AVCodecContext *avctx)
|
|
+{
|
|
+ AmfContext *ctx = avctx->priv_data;
|
|
+ AMF_RESULT res = AMF_OK;
|
|
+
|
|
+ if (ctx->av_bitrate != avctx->bit_rate) {
|
|
+ av_log(ctx, AV_LOG_INFO, "change bitrate from %d to %d\n", ctx->av_bitrate, avctx->bit_rate);
|
|
+ ctx->av_bitrate = avctx->bit_rate;
|
|
+ if (avctx->codec->id == AV_CODEC_ID_H264) {
|
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_TARGET_BITRATE, avctx->bit_rate);
|
|
+ } else if (avctx->codec->id == AV_CODEC_ID_HEVC) {
|
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TARGET_BITRATE, avctx->bit_rate);
|
|
+ }
|
|
+ }
|
|
+ return 0;
|
|
+}
|
|
+
|
|
int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
|
|
{
|
|
AmfContext *ctx = avctx->priv_data;
|
|
@@ -586,6 +604,8 @@ int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
|
|
AVFrame *frame = ctx->delayed_frame;
|
|
int block_and_wait;
|
|
|
|
+ reconfig_encoder(avctx);
|
|
+
|
|
if (!ctx->encoder)
|
|
return AVERROR(EINVAL);
|
|
|
|
diff --git a/libavcodec/amfenc.h b/libavcodec/amfenc.h
|
|
index e92120ea39..31172645f2 100644
|
|
--- a/libavcodec/amfenc.h
|
|
+++ b/libavcodec/amfenc.h
|
|
@@ -107,6 +107,7 @@ typedef struct AmfContext {
|
|
int me_half_pel;
|
|
int me_quarter_pel;
|
|
int aud;
|
|
+ int64_t av_bitrate;
|
|
|
|
// HEVC - specific options
|
|
|
|
--
|
|
2.43.0.windows.1
|
|
|