[Libav-user] Converting audio sample buffer format

René J.V. Bertin rjvbertin at gmail.com
Mon Feb 25 10:44:00 CET 2013

Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

>Brad O'Hearne <brado at ...> writes:
>> On Feb 18, 2013, at 3:50 PM, Carl Eugen Hoyos <cehoyos at ...> wrote:
>> > While I have _no_ idea what the "flv audio codec" could 
>> > be, please use either the aconvert filter or libswresample 
>> > directly to convert from one audio format to another.
>> This has turned out to be much more difficult than expected.
>Before you start debugging (the cast to sourceData looks 
>suspicious): Did you look at doc/examples/filtering_audio.c 
>and doc/examples/resampling_audio.c ?
>I suspect using the aconvert filter has the advantage that 
>you can do other changes to the audio without additional 
>code (and bugs).
>In any case, using gdb should quickly show you were the 
>problem lies.
>Carl Eugen
>Libav-user mailing list
>Libav-user at ffmpeg.org

Exactly, but you'd need to build the libav libs yourself, with debugging info.

There's another thing that's nagging me. IIUC, the goal here is to convert a buffer of (C) floats into signed shorts. I have some difficulty believing that doing this through a generic workhouse function can be more efficient than writing a simple loop and let a good optimising compiler create the best assembly out of it ...


More information about the Libav-user mailing list