[Libav-user] How to transcode without usage of av_opt_set_sample_fmt function

Gonzalo Garramuño ggarra13 at gmail.com
Sun Nov 7 05:38:49 EET 2021

El 6/11/21 a las 23:35, Robert Smith via Libav-user escribió:
> If I skip setting setting sample format option the swr_init display 
> warning
> [SWR @ 0x2c7b950] Requested sample format (null) is not supported 
> internally, only float & S16 is supported
> and eventually swr_convert fails on assertion:
> Assertion a->planar failed at libswresample/swresample.c:284
> Could you advise how to resolve this issue? Thanks
See if there's a swr_alloc_set_opts function in your libav.  If there 
is, you can pass all the flags like:

   swr_ctx  = swr_alloc_set_opts(NULL, out_ch_layout,
                                                in_ch_layout, in_sample_fmt,
                                                0, NULL);

Hope that helps!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20211107/c6385992/attachment.htm>

More information about the Libav-user mailing list