<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 07.11.2013 04:53, <a class="moz-txt-link-abbreviated" href="mailto:fkwatson@aol.com">fkwatson@aol.com</a>
wrote:<br>
</div>
<blockquote
cite="mid:8D0A97BA587CF2F-D04-B104@webmail-m142.sysops.aol.com"
type="cite"><font size="2" color="black" face="arial"><br>
<div style="color: black; font-family: arial, helvetica;
font-size: 10pt;">
<blockquote style="border-left: 2px solid blue; padding-left:
3px;">
<div class="MsoNormal"><span lang="EN-US">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.</span></div>
<div class="MsoNormal"><span lang="EN-US"> </span></div>
<div class="MsoNormal"><span lang="EN-US">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?</span></div>
<div class="MsoNormal"><span lang="EN-US"> </span></div>
<div class="MsoNormal"><span lang="EN-US">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?</span></div>
<div class="MsoNormal"><span lang="EN-US"> </span></div>
<div class="MsoNormal"><span lang="EN-US">Better yet,
perhaps somebody knows exactly what I’ll have to do to
avoid this effect?</span></div>
<div class="MsoNormal"><span lang="EN-US"> </span></div>
<div class="MsoNormal">BR,</div>
<div class="MsoNormal">Mathias</div>
</blockquote>
</div>
<div style="color: black; font-family: arial;"><br>
</div>
<font face="arial">Sorry Mathias,</font>
<div style="color: black; font-family: arial;"><br>
</div>
<div style="color: black; font-family: arial;">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.</div>
<div style="color: black; font-family: arial;"><br>
</div>
<div>
<div class="line" style="color: black; font-family: monospace,
fixed; line-height: 1; min-height: 13px; white-space:
pre-wrap; word-wrap: break-word; text-indent: -53px;
padding-left: 53px; padding-bottom: 0px; margin: 0px;
transition: background-color, box-shadow;
-webkit-transition: background-color, box-shadow;"><a
moz-do-not-send="true" class="code"
href="http://ffmpeg.org/doxygen/trunk/group__lavc__core.html#ga1cb4e0fd7b8eb2f56d977ff96973479d"
title="Set the fields of the given AVFrame to default
values." style="color: rgb(70, 101, 162); text-decoration:
none;">avcodec_get_frame_defaults</a>(decoded_frame);</div>
<div class="line" style="line-height: 1; min-height: 13px;
white-space: pre-wrap; word-wrap: break-word; text-indent:
-53px; padding-left: 53px; padding-bottom: 0px; margin: 0px;
-webkit-transition: background-color, box-shadow;
transition: background-color, box-shadow;"><a
moz-do-not-send="true" class="code"
href="http://ffmpeg.org/doxygen/trunk/group__lavc__decoding.html#ga834bb1b062fbcc2de4cf7fb93f154a3e"
title="Decode the audio frame of size avpkt->size from
avpkt->data into frame." style="line-height: 1;
font-size: 10pt; text-decoration: none;">avcodec_decode_audio4</a><span
style="color: black; font-family: monospace, fixed;
line-height: 1; font-size: 10pt;">(c, decoded_frame,
&got_frame, &avpkt);</span></div>
<div class="line" style="color: black; font-family: monospace,
fixed; line-height: 1; min-height: 13px; white-space:
pre-wrap; word-wrap: break-word; text-indent: -53px;
padding-left: 53px; padding-bottom: 0px; margin: 0px;
transition: background-color, box-shadow;
-webkit-transition: background-color, box-shadow;"> </div>
<div class="line" style="color: black; font-family: monospace,
fixed; line-height: 1; min-height: 13px; white-space:
pre-wrap; word-wrap: break-word; text-indent: -53px;
padding-left: 53px; padding-bottom: 0px; margin: 0px;
transition: background-color, box-shadow;
-webkit-transition: background-color, box-shadow;"><span
class="keywordflow" style="color: rgb(224, 128, 0);">if</span>
(got_frame) {</div>
<div class="line" style="color: black; font-family: monospace,
fixed; line-height: 1; min-height: 13px; white-space:
pre-wrap; word-wrap: break-word; text-indent: -53px;
padding-left: 53px; padding-bottom: 0px; margin: 0px;
transition: background-color, box-shadow;
-webkit-transition: background-color, box-shadow;"> <span
class="comment" style="color: rgb(128, 0, 0);">/* if a
frame has been decoded, output it */</span></div>
<div class="line" style="color: black; font-family: monospace,
fixed; line-height: 1; min-height: 13px; white-space:
pre-wrap; word-wrap: break-word; text-indent: -53px;
padding-left: 53px; padding-bottom: 0px; margin: 0px;
transition: background-color, box-shadow;
-webkit-transition: background-color, box-shadow;"> <span
class="keywordtype" style="color: rgb(96, 64, 32);">int</span>
data_size = <a moz-do-not-send="true" class="code"
href="http://ffmpeg.org/doxygen/trunk/samplefmt_8c.html#aa7368bc4e3a366b688e81938ed55eb06"
title="Get the required buffer size for the given audio
parameters." style="color: rgb(70, 101, 162);
text-decoration: none;">av_samples_get_buffer_size</a>(NULL,
c-><a moz-do-not-send="true" class="code"
href="http://ffmpeg.org/doxygen/trunk/structAVCodecContext.html#ac1e6c2cd1269caa7570575725c682a49"
title="number of audio channels" style="color: rgb(70,
101, 162); text-decoration: none;">channels</a>,</div>
<div class="line" style="color: black; font-family: monospace,
fixed; line-height: 1; min-height: 13px; white-space:
pre-wrap; word-wrap: break-word; text-indent: -53px;
padding-left: 53px; padding-bottom: 0px; margin: 0px;
transition: background-color, box-shadow;
-webkit-transition: background-color, box-shadow;">
decoded_frame-><a moz-do-not-send="true" class="code"
href="http://ffmpeg.org/doxygen/trunk/structAVFrame.html#a02f45ab8191aea1660159f1e464237ea"
title="number of audio samples (per channel) described by
this frame" style="color: rgb(70, 101, 162);
text-decoration: none;">nb_samples</a>,</div>
<div class="line" style="color: black; font-family: monospace,
fixed; line-height: 1; min-height: 13px; white-space:
pre-wrap; word-wrap: break-word; text-indent: -53px;
padding-left: 53px; padding-bottom: 0px; margin: 0px;
transition: background-color, box-shadow;
-webkit-transition: background-color, box-shadow;"> c-><a
moz-do-not-send="true" class="code"
href="http://ffmpeg.org/doxygen/trunk/structAVCodecContext.html#a1bdba69ea111e2a9d03fdaa7a46a4c45"
title="audio sample format" style="color: rgb(70, 101,
162); text-decoration: none;">sample_fmt</a>, 1);</div>
<div class="line" style="color: black; font-family: monospace,
fixed; line-height: 1; min-height: 13px; white-space:
pre-wrap; word-wrap: break-word; text-indent: -53px;
padding-left: 53px; padding-bottom: 0px; margin: 0px;
transition: background-color, box-shadow;
-webkit-transition: background-color, box-shadow;"><span
style="font-family: Arial, Helvetica, sans-serif;
line-height: 1; font-size: 10pt;">}</span></div>
</div>
<div class="line" style="color: black; font-family: monospace,
fixed; line-height: 1; min-height: 13px; white-space:
pre-wrap; word-wrap: break-word; text-indent: -53px;
padding-left: 53px; padding-bottom: 0px; margin: 0px;
transition: background-color, box-shadow; -webkit-transition:
background-color, box-shadow;"><span style="font-family:
Arial, Helvetica, sans-serif; line-height: 1; font-size:
10pt;"><br>
</span></div>
<div class="line" style="color: black; line-height: 1;
min-height: 13px; white-space: pre-wrap; word-wrap:
break-word; text-indent: -53px; padding-left: 53px;
padding-bottom: 0px; margin: 0px; -webkit-transition:
background-color, box-shadow; transition: background-color,
box-shadow;"><font face="Arial, Helvetica, sans-serif">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.</font></div>
<div class="line" style="color: black; font-family: monospace,
fixed; line-height: 1; min-height: 13px; white-space:
pre-wrap; word-wrap: break-word; text-indent: -53px;
padding-left: 53px; padding-bottom: 0px; margin: 0px;
transition: background-color, box-shadow; -webkit-transition:
background-color, box-shadow;"><span style="font-family:
Arial, Helvetica, sans-serif; line-height: 1; font-size:
10pt;"><br>
</span></div>
</font><br>
</blockquote>
<font size="2"><font face="arial">Hello,<br>
Most Audio outputs Plananar stuff now a days and it sounds like
Mickey. Like abo said MP3 outputs S16P and Ogg/Vorbis FLTP. So
just playing them like 0.10 is out of question witth out major
source overhaul. When I developped Mixxx input plugin I also
suffered this one and broken out little example app to solve
this problem with resampling audio to wanted (As FFmpeg has real
good capabilities to do that). I uploaded it to Github:
<a class="moz-txt-link-freetext" href="https://github.com/illuusio/ffmpeg-example">https://github.com/illuusio/ffmpeg-example</a> <br>
Look at 'example2.c' there is this dirty resampler example that
can use swresampler/avresampler which is provided. It should
work from FFmpeg versions 0.10->2.1.<br>
<br>
Sincerely,<br>
Tuukka<br>
</font></font>
</body>
</html>