I need to write C++ function to transcode any mp3 file to G.711 encoded wav 
file using LibAV API. Since we run on custom ARM board, I can use only specific 
available cross compiled version of LibAV libraries (pretty old, not the latest 
one) and there is no way to use latest LibAV library.

As part of transcoding I need to perform resampling using swr_convert.To 
prepare swr context I need to setup input and output parameters including 
sample format, e.g.:
    av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt",  pMp3CodecCtx->sample_fmt, 
0);    av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", 
pG711CodecCtx->sample_fmt,  0);
The problem is that in my old version LibAV library there is NO method 
av_opt_set_sample_fmt defined.
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


_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to