On 1 April 2018 at 12:16, Henri Zikken <zik...@xs4all.nl> wrote:

> 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
>
>
>
>
Hi Henri

Try this:
av_opt_set(_codecContext, "vbr", "0", AV_OPT_SEARCH_CHILDREN);

or if you want to set the integer value:

av_opt_set_int(_codecContext, "vbr", 0, AV_OPT_SEARCH_CHILDREN);

Please bear in mind that this is out of my head and untested

Jaka
_______________________________________________
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to