<div dir="ltr"><div class="gmail_extra"><br></div><div class="gmail_extra"> Hi Carl,</div><div class="gmail_extra"><br></div><div class="gmail_extra"> On Fri, Jun 29, 2018 at 11:51 PM, Carl Eugen Hoyos <span dir="ltr"><<a href="mailto:ceffmpeg@gmail.com" target="_blank">ceffmpeg@gmail.com</a>></span> wrote:</div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">2018-06-29 15:20 GMT+02:00, Javier Taibo <<a href="mailto:javier.taibo@gmail.com">javier.taibo@gmail.com</a>>:<br>
<br>
> I have a piece of code decoding audio that broke when upgrading from<br>
> ffmpeg 3 to 4. After tracing the code, the problem seems to be that the<br>
> sample format of some audio streams is incorrectly notified both in<br>
> AVCodecParameters and in AVCodecContext.<br>
><br>
> With ffmpeg up to 3.2, the audio stream reports s16p sample format (can<br>
> be seen in ffprobe output), and everything works fine.<br>
><br>
> Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 44100 Hz,<br>
> mono, s16p, 192 kb/s<br>
><br>
> Since ffmpeg 4.0 the audio stream reports fltp sample format, but the<br>
> decoder still delivers s16p samples, so it outputs noise.<br>
><br>
> Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 44100 Hz,<br>
> mono, fltp, 192 kb/s<br>
><br>
> Has anyone else experienced this issue?<br>
<br>
</span>Many people...<br>
<br>
> Maybe a ffmpeg bug?<br>
<br>
No, the sample format (and the pix_fmt) for a given input and a<br>
given decoder is not part of the api, you always have to check<br>
the sample format (and pix_fmt).<br>
<br>
(I left the above because many people forget this and we<br>
have changed both formats in the past and may change<br>
them in the future.)<br>
<br>
Edit: Re-reading your mail I see that you have a different<br>
issue, I believe you use different decoders to analyze and<br>
to decode the stream (mp2float vs mp2, the latter being<br>
the integer decoder that is slower on intel hardware), I am<br>
not sure if this is a bug in FFmpeg or in your code.<br></blockquote><div><br></div><div>
<div class="gmail_extra" style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><span> </span>Thanks for your response.</div><div class="gmail_extra" style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div></div><div class="gmail_extra" style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"> I didn't chose any of these decoders, my code is the same in ffmpeg 3.2 and ffmpeg 4.0.</div><div class="gmail_extra" style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_extra" style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"> Maybe the reason is that default mp2 audio codec was switched from mp2float to mp2.</div><div class="gmail_extra" style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_extra" style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"> Actually, the lines in my original message were the output of ffprobe (unmodified) in ffmpeg 3.2 and ffmpeg 4.0.</div><div><br></div><div><br></div><div> Regards,</div><div><br></div></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Javier Taibo<br><br></div>
</div></div>