<div dir="ltr"><div>Hi,</div><div><br></div><div>I wasn't able to set audio sample format using av_opt_set functions. It seems it is not available in libavcodec/options_table.h.</div><div><br></div><div>As an example I used encode_audio.c</div><div><br></div><div>---</div><div>    av_opt_set_int (c, "ab", 64000, 0);<br>    av_opt_set_int (c, "ac", av_get_channel_layout_nb_channels (c->channel_layout), 0);<br>    av_opt_set_int (c, "ar", select_sample_rate (codec), 0);<br>    av_opt_set_int (c, "channel_layout", AV_CH_LAYOUT_STEREO, 0);<br>#if 0</div><div>    // error: Specified sample format -1 is invalid or not supported<br></div><div>    av_opt_set_sample_fmt (c, "sample_fmt", AV_SAMPLE_FMT_S16, 0);<br>#else</div><div>    // no error<br></div><div>    c->sample_fmt = AV_SAMPLE_FMT_S16;<br>#endif</div><div>---</div><div><br></div><div>Is it possible to set sample format using av_opt_set* functions?<br></div></div>