From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 1B62C411F6 for ; Thu, 17 Mar 2022 18:45:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 49AA268AE62; Thu, 17 Mar 2022 20:45:24 +0200 (EET) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7EE22680BBE for ; Thu, 17 Mar 2022 20:45:22 +0200 (EET) Received: by mail-lj1-f172.google.com with SMTP id g24so7229244lja.7 for ; Thu, 17 Mar 2022 11:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=CrGyCWwMC+nVnEt71zslKrUBO+3UU2Kut2urCEnxya4=; b=D8GXeG6NHt+y51a/NrL2qAsIs9mYCGRkaIgDA17BfyjihjUm0C8Z8kIFnxsIysH3wj hjsobfLCMzJBQ2s/35EomnspeqbdsbL2K14d2czN/bXHAUwg+YEkFXWZlUFXuvkb2OZX xPJJBCpOPLoa5SThK3NwG+YdaGDsj2iubb3sLtrxhG+9V+alwtdYQHM/G7VFOTyhcJN7 mgpdc47UKlhDI/KpxtLHUs56zWDAmKmGayOhTSIhGGQ1rmMbpZ8sXNutkqnWHaeRNZt7 VnFZmhe3J1onQlAsiFOEKLW809rblYWKFbnI8YYFM8Zg0zOasa8iS3kY6M0ScZmIOzXy YM1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=CrGyCWwMC+nVnEt71zslKrUBO+3UU2Kut2urCEnxya4=; b=pcFLUMWU9TgHDIgO7+8H0riGS8MFvAksh4tQiZhDlAQXjO1EsRPI2QBWtpKPdsPP9a DbiUX4Q6l0G52gweWWpukCEXAt9Gh4npoKJIxxVgOXXuYHDhuT8mL2AoBZ0Ro37g3q0/ /JVqUf7IKDXTrzibNKwg36JxtpDRL+GOGh+uaTkJ+rZVJRYsfxo/Kcbfk5YOex8N4bUr JJ1Kb3SCCgyNQtJhgAKAuB4zvJS1aQnXBWaaqEOKxswEN40lMylPovelkFdH+0a0/FCv lxlr1xJ+Q4M+emXi3VBim3c1KVV1AWKZznLXsQ4ddF3p9+cz18r/MnKVN7vcE0dmwfFB umXw== X-Gm-Message-State: AOAM531WIQYJ9BYdYzOlFXHkncRh+237bxcSekBw4F042TJdQ8m3Iagp AoyxuueGCaUa+cdF35cYLT0JAnCqpZ0RxPUpRc0Untmw7r4= X-Google-Smtp-Source: ABdhPJwgfaI01AoBdRSHUumgi9Lte6iUoea9zr7M7zGGXGfRuURdJfllcHydV/x8Lw+urTkZKZtnHLz+v5eB49vyisw= X-Received: by 2002:a05:651c:311:b0:246:1250:d6f with SMTP id a17-20020a05651c031100b0024612500d6fmr3839047ljp.455.1647542721327; Thu, 17 Mar 2022 11:45:21 -0700 (PDT) MIME-Version: 1.0 References: <20220316120759.2292546-1-danilchap@google.com> In-Reply-To: From: =?UTF-8?B?SmFuIEVrc3Ryw7Zt?= Date: Thu, 17 Mar 2022 20:45:10 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Thu, Mar 17, 2022 at 1:53 AM James Zern wrote: > > Lynne, > > > On Wed, Mar 16, 2022 at 5:39 AM Lynne wrote: > > > > 16 Mar 2022, 13:07 by danilchap-at-google.com@ffmpeg.org: > > > > > --- > > > libavcodec/libvpxenc.c | 7 +++++++ > > > 1 file changed, 7 insertions(+) > > > > > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c > > > index 8f94ba15dc..45baeed435 100644 > > > --- a/libavcodec/libvpxenc.c > > > +++ b/libavcodec/libvpxenc.c > > > @@ -1658,6 +1658,13 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt, > > > flags |= strtoul(en->value, NULL, 10); > > > } > > > > > > + en = av_dict_get(frame->metadata, "max-quantizer", NULL, 0); > > > + if (en) { > > > + struct vpx_codec_enc_cfg cfg = *enccfg; > > > + cfg.rc_max_quantizer = strtoul(en->value, NULL, 10); > > > + vpx_codec_enc_config_set(&ctx->encoder, &cfg); > > > + } > > > > > > > I was going to NAK the earlier patch, but forgot. > > Please think of a better way than stuffing random data in > > inappropriate fields, and fix the earlier patch that was mistakenly > > merged to not do that. > > I agree this isn't great. Would you suggest updating the qmax setting > and checking it / all options on a per-frame basis or is there a > better way to reconfigure the codec on the fly? The libx264 wrapper is probably one of the oldest that supports runtime reconfiguration. Looking at how it does it right now, it seems to call its reconfig_encoder function for each fed non-nullptr AVFrame. So yes, re-reading configuration from the context seems like a viable alternative. Jan _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".