[Libav-user] How to set priv data options like VBR for ie libfdk_aac, or abr vor libmp3lame

Henri Zikken zikken at xs4all.nl
Sun Apr 1 13:16:43 EEST 2018


Dear all,

 

I am trying to control the settings for encoding to several formats, amongst
which libfdk_aac. Now I'm trying to set an option like the VBR settings, to
no avail.

 

The option can be between 0 and 5.  I have tried like 20 ways to set it now,
to no avail.

 

For instance:

 

int ret = av_opt_set(_codecContext, "vbr", 0, 0);

 

returns 'option not found'.

 

int ret = av_opt_set(_codecContext->priv_data, "vbr", 0, 0);

 

returns 'invalid argument'.

 

Same goes for av_opt_set(_codec, "vbr",0,0); and the variant with priv_data.

 

setting an AVDictionary also does not work:

 

AVDictionary * opts = NULL;

av_dict_set_int(&opts,"vbr",0,0)

 

int ret = av_opt_set_dict(_codecContext->priv_data, &opts);

int ret = av_opt_set_dict(_codecContext, &opts);

int ret = av_opt_set_dict(_codec, &opts);

int ret = av_opt_set_dict(_codec->priv_data, &opts);

 

al does exactly nothing.

 

So how do I set this blasted option?!?! :P

 

I know the option is present in the aac_enc_options struct:

 

static const AVOption aac_enc_options[] = {

[..]

  { "vbr", "VBR mode (1-5)", offsetof(AACContext, vbr), AV_OPT_TYPE_INT, {
.i64 = 0 }, 0, 5, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },

 

This ends up in aac_enc_class:

 

static const AVClass aac_enc_class = {

[..]

.option     = aac_enc_options,

 

Which in turn ends up as the .priv_class for the codec:

 

AVCodec ff_libfdk_aac_encoder = {

[..]

.priv_class            = &aac_enc_class,

 

Any help would be appriciated. 

 

Regards,

 

Henri Zikken

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180401/6adbe0b7/attachment.html>


More information about the Libav-user mailing list