Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Zern <jzern-at-google.com@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration
Date: Tue, 29 Mar 2022 13:58:12 -0700
Message-ID: <CABWgkXKCV0Z1E03jVx9tBzq-3k5R0pKOaj5JVZ97MOyWtyQ+Xw@mail.gmail.com> (raw)
In-Reply-To: <CACQca=dN2JfC27sH2CybbgEEY78sG6vmaQaWtuggTugebrDoHA@mail.gmail.com>

On Mon, Mar 28, 2022 at 7:05 AM Danil Chapovalov <danilchap@google.com> wrote:
>
> On Thu, Mar 24, 2022 at 7:27 PM James Zern <jzern@google.com> wrote:
> >
> > On Thu, Mar 24, 2022 at 6:12 AM Danil Chapovalov
> > <danilchap-at-google.com@ffmpeg.org> wrote:
> > >
> > > ---
> > >  libavcodec/libvpxenc.c | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > > index dff1d06b0e..463a658bb0 100644
> > > --- a/libavcodec/libvpxenc.c
> > > +++ b/libavcodec/libvpxenc.c
> > > @@ -1625,6 +1625,12 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
> > >      vpx_svc_layer_id_t layer_id;
> > >      int layer_id_valid = 0;
> > >
> > > +    if (avctx->qmax >= 0 && enccfg->rc_max_quantizer != avctx->qmax) {
> > > +        struct vpx_codec_enc_cfg cfg = *enccfg;
> > > +        cfg.rc_max_quantizer = avctx->qmax;
> > > +        vpx_codec_enc_config_set(&ctx->encoder, &cfg);
> > > +    }
> > > +
> >
> > Jan, I think this was what you were suggesting, no?
> > The docs could be updated to note qmax can be changed per-frame
> > [1][2]. Saying that, it does seem a bit unbalanced to only do qmax
> > here.
> >
> > [1] https://ffmpeg.org/ffmpeg-codecs.html#libvpx
> > [2] https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/doc/encoders.texi#l2000
>
> As I understand, docs describe command line options.
> I do not plan to expose changing qmax per frame as a command line
> option, I do not see how that can be reasonably done. My intent is to
> change max qp when ffmpeg is used as a library.
>

That is true, I was thinking about it from the library perspective.
libx264 doesn't mention this behavior but the codec options section
does talk about setting these from the API, so I think a note is
worthwhile as this is the only point of documentation for the codec
wrapper.

> I agree it looks unbalanced to change just the qmax, but that is the
> only parameter I currently need for my usecase. Personally I prefer to
> only add features that are planned to be used.
> Are there any particular configuration settings you want me to make
> configurable,
> or do you think it is better to support all settings that can be configurable?

Since libvpx supports a reconfigure it should be safe to check the
options again. There is some complexity in that, though, so we can
leave this as a targeted approach similar to libx264 for now unless
others have a strong opinion.
_______________________________________________
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".

  reply	other threads:[~2022-03-29 20:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 12:07 Danil Chapovalov
2022-03-16 12:39 ` Lynne
2022-03-16 23:53   ` James Zern
2022-03-17 18:45     ` Jan Ekström
2022-03-17 19:07 ` Danil Chapovalov
2022-03-24 13:11 ` Danil Chapovalov
2022-03-24 18:27   ` James Zern
2022-03-28 14:04     ` Danil Chapovalov
2022-03-29 20:58       ` James Zern [this message]
2022-03-30 18:24   ` Danil Chapovalov
2022-03-31 17:31     ` James Zern
2022-04-06  1:04       ` James Zern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABWgkXKCV0Z1E03jVx9tBzq-3k5R0pKOaj5JVZ97MOyWtyQ+Xw@mail.gmail.com \
    --to=jzern-at-google.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git