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

Javier Taibo javier.taibo at gmail.com
Fri Jun 29 16:20:51 EEST 2018


  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? Maybe a ffmpeg bug? Or am I the

  The problem can be seen in this MPEG-TS transport:

  Update: Luckily I have found that decoded AVFrames report the right
sample format in ffmpeg 4.0, so I could implement a workaround, but it
would be nice to know the right sample format after opening the stream,
before decoding, as it was in previous ffmpeg versions.


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

More information about the Libav-user mailing list