[Libav-user] libavcodec differences between versions

fkwatson at aol.com fkwatson at aol.com
Thu Nov 7 03:53:18 CET 2013




Hello! I've been using libavcodec 0.10.2 for decoding audio in a certain application (calling avcodec_decode_audio4() to use the "mp3" and "mp3float" decoders) and now I've tried to upgrade to version 2.0.2. Everything builds fine without changes in my code, but for some reason I get Mickey Mouse kind of sound after decoding. I've tried other releases and come to the conclusion that release 1.0.8 works straight off, but release 1.1.x (I've tried 1.1.7) and later will produce this effect.
 
>From reading the "Old FFmpeg Releases" page on the website I can see that 1.0 was branched on 2012-09-28 and 1.1 on 2013-01-06. So the change I'm looking for is probably somewhere between those dates. But I also see that the 1.1.7 release use libav 9.10 and 1.0.8 use libav 0.8.3. What does that mean, which versions are you referring to? Where can I find out what the differences (or rather "changes of concept") there are between these "libav" versions? Has there for instance been some change in the sample format, sample rate or whatever between these version, so that I need to call avcodec_open2() with some more or less undocumented option in order to get the same behaviour as before?
 
I've tried to find release notes or any kind of documentation where I can find out which changes were implemented and what I need to do to cope with this. Could anybody please spread some light on what might have changed, not the whole changelog for each and every change of a comment or whatever but for a broader picture. Is something like that available?
 
Better yet, perhaps somebody knows exactly what I’ll have to do to avoid this effect?
 
BR,
Mathias



Sorry Mathias,


You will have to make changes because the decoding API has changed.   See audio decoding example in examples directory.   The major difference is that what is contained in a decoded frame is not 16-bit linear interleaved samples. The output is now codec dependent.  You have to use the API to get the sample format, and planar/not planar.



avcodec_get_frame_defaults(decoded_frame);
avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
      
if (got_frame) {
            /* if a frame has been decoded, output it */
            int data_size = av_samples_get_buffer_size(NULL, c->channels,
                                                       decoded_frame->nb_samples,
                                                       c->sample_fmt, 1);
}



If you are only dealing with one codec you can modify your code to use this output sample format directly.  Otherwise use libresample with in rate = out rate to convert from c->sample_fmt to desired sample format.  See samplefmt.h and swresample.h.


-Felix

____________________________________


Libav-user mailing list
Libav-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131106/0db54dff/attachment.html>


More information about the Libav-user mailing list