[FFmpeg-devel] Incorrect usage of timefilter by alsa-audio-dec?

Nicolas George nicolas.george at normalesup.org
Sat Dec 24 18:44:25 CET 2011


Le duodi 2 nivôse, an CCXX, Andreas U. Trottmann a écrit :
> The immediate symptom I found was that "-async stopped working".
> More specifically, when using audio input via alsa together with
> "-async [any-number-larger-than-zero]", the encoding process
> would "hang" after a couple seconds.
<snip>

Ok, there are three distinct problems here:

- This call:
  pkt->pts = ff_timefilter_update(s->timefilter, dts, res);
  is not correct: res is the number of samples that come after dts and
  before the next call, while timefilter expects the number of sample that
  came before dts since the last call. That is easily fixed.

- o = 2 * M_PI * s->period_size / s->sample_rate * 1.5;
  is completely nonsensical. I think the best course of action is to add
  just after: o = 1 - exp(-o), but I do not understand the theory behint the
  2 * M_PI and the o*o afterwards.

- The timefilter is designed for fixed periods. Unfortunately, in
  non-blocking mode, ALSA will often return a few samples before raising
  EAGAIN. Feedback factors computed for a 8192-samples period are way too
  large for these short reads. I have to think about a solution for that
  one. If someone has a suggestion, it would be welcome.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111224/0a916908/attachment.asc>


More information about the ffmpeg-devel mailing list