On Thu, 14 Jul 2011, Anton Khirnov wrote:

> 
> On Thu, 14 Jul 2011 11:37:17 +0300 (EEST), Martin Storsjö <mar...@martin.st> 
> wrote:
> > On Wed, 13 Jul 2011, Anton Khirnov wrote:
> > 
> > >      if (avctx->level > 0)
> > >          x4->params.i_level_idc = avctx->level;
> > >  
> > > +    if (x4->preset || x4->tune)
> > > +        if (x264_param_default_preset(&x4->params, x4->preset, x4->tune) 
> > > < 0) {
> > > +            av_log(avctx, AV_LOG_ERROR, "Error setting preset/tune 
> > > %s/%s.\n", x4->preset, x4->tune);
> > > +            return AVERROR(EINVAL);
> > > +        }
> > > +
> > > +    x4->params.pf_log               = X264_log;
> > > +    x4->params.p_log_private        = avctx;
> > > +    x4->params.i_log_level          = X264_LOG_DEBUG;
> > > +
> > > +    x4->params.b_intra_refresh      = avctx->flags2 & 
> > > CODEC_FLAG2_INTRA_REFRESH;
> > > +    x4->params.rc.i_bitrate         = avctx->bit_rate       / 1000;
> > > +    x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
> > > +    x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate    / 1000;
> > > +    x4->params.rc.b_stat_write      = avctx->flags & CODEC_FLAG_PASS1;
> > 
> > Doesn't this first set the x264 preset, the override all the individual 
> > options according to what's set in avctx, making this kinda useless? The 
> > other extreme of course isn't useful either - in my usecases I need to 
> > override invidiual options but still want to set the bulk of them via a 
> > preset.
> > 
> 
> Not all of them.
> Anyway, I'm planning to use codec-specific defaults to zero the defaults
> for all those options and use them only if the user explicitly set them

Ok, that sounds like a plan.

// Martin
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to