2018-10-20 16:11 GMT+02:00, Finalspace <[email protected]>: > the example you are following just writes the frame out in raw format, > without doing any kind of sample rate or format conversion. > > To convert a sample you need to check against the sample format > (dec_ctx->sample_fmt) and implement the right conversion. > For example if your audio stream uses a sample format of S16 (Signed > 16-bit integer), converting that to float is really easy (Just divide by > max int16):
Note that libswresample should be able to do this conversion significantly faster. Also note that (just like the default decoder for a given file is not part of the API) decoders in different versions of FFmpeg may output different sample formats, the sample formats have changed in the past (without much information for you) and may change in the future: You always have to check the sample format of the decoder in your code! Carl Eugen _______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
