From 574a33da0a41280c0f5f0591c2ef42c29d69722f Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 4 Dec 2023 12:43:00 +0100 Subject: [PATCH] lavc: enable header_inserter for h264_amf AMD RX 7600 needs this even though header_spacing is set to 1. RX 580 didn't need this. --- src/video_compress/libavcodec.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index 7f27de867..067f501ed 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -1549,6 +1549,11 @@ static void configure_amf([[maybe_unused]] AVCodecContext *codec_ctx, [[maybe_un check_av_opt_set(codec_ctx->priv_data, "header_insertion_mode", "gop", "header_insertion_mode for AMF"); } else if ("h264_amf"s == codec_ctx->codec->name) { check_av_opt_set(codec_ctx->priv_data, "header_spacing", 1); + if (param->header_inserter_req == -1) { + MSG(INFO, "Auto-enabling header inserter for %s.\n", + codec_ctx->codec->name); + param->header_inserter_req = 1; + } } } @@ -1879,8 +1884,8 @@ static void setparam_h264_h265_av1(AVCodecContext *codec_ctx, struct setparam_pa configure_nvenc(codec_ctx, param); } else if (strcmp(codec_ctx->codec->name, "h264_omx") == 0) { if (param->header_inserter_req == -1) { - MSG(INFO, "Enablling header inserter for h264_omx by " - "default.\n"); + MSG(INFO, "Auto-enabling header inserter for %s.\n", + codec_ctx->codec->name); param->header_inserter_req = 1; // (untested) } } else if (strcmp(codec_ctx->codec->name, "h264_qsv") == 0 ||