[Libav-user] FFmpeg 4.0 - wrong audio sample format

Javier Taibo javier.taibo at gmail.com
Mon Jul 2 10:48:03 EEST 2018


  Hi Carl,

 On Fri, Jun 29, 2018 at 11:51 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com>
wrote:

> 2018-06-29 15:20 GMT+02:00, Javier Taibo <javier.taibo at gmail.com>:
>
> >   I have a piece of code decoding audio that broke when upgrading from
> > ffmpeg 3 to 4. After tracing the code, the problem seems to be that the
> > sample format of some audio streams is incorrectly notified both in
> > AVCodecParameters and in AVCodecContext.
> >
> >   With ffmpeg up to 3.2, the audio stream reports s16p sample format (can
> > be seen in ffprobe output), and everything works fine.
> >
> >       Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 44100 Hz,
> > mono, s16p, 192 kb/s
> >
> >   Since ffmpeg 4.0 the audio stream reports fltp sample format, but the
> > decoder still delivers s16p samples, so it outputs noise.
> >
> >       Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 44100 Hz,
> > mono, fltp, 192 kb/s
> >
> >   Has anyone else experienced this issue?
>
> Many people...
>
> > Maybe a ffmpeg bug?
>
> No, the sample format (and the pix_fmt) for a given input and a
> given decoder is not part of the api, you always have to check
> the sample format (and pix_fmt).
>
> (I left the above because many people forget this and we
> have changed both formats in the past and may change
> them in the future.)
>
> Edit: Re-reading your mail I see that you have a different
> issue, I believe you use different decoders to analyze and
> to decode the stream (mp2float vs mp2, the latter being
> the integer decoder that is slower on intel hardware), I am
> not sure if this is a bug in FFmpeg or in your code.
>

  Thanks for your response.

  I didn't chose any of these decoders, my code is the same in ffmpeg 3.2
and ffmpeg 4.0.

  Maybe the reason is that default mp2 audio codec was switched from
mp2float to mp2.

  Actually, the lines in my original message were the output of ffprobe
(unmodified) in ffmpeg 3.2 and ffmpeg 4.0.


  Regards,

-- 
Javier Taibo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180702/68e27cd1/attachment.html>


More information about the Libav-user mailing list