[MPlayer-dev-eng] [PATCH] [TEST AFILTER] Encode ac3 at runtime using lavc

Ulion ulion2002 at gmail.com
Wed Nov 21 14:28:08 CET 2007


2007/11/21, Ulion <ulion2002 at gmail.com>:
> 2007/11/20, Ulion <ulion2002 at gmail.com>:
> > 2007/11/20, Ulion <ulion2002 at gmail.com>:
> > > 2007/11/19, Ulion <ulion2002 at gmail.com>:
> > > > 2007/11/19, Ulion <ulion2002 at gmail.com>:
> > > > > Hello,
> > > > >
> > > > > As a wellknown feature of AC3Filter, it support encode ac3 at runtime
> > > > > and passthrough it to spdif. With this feature, peoples has only a
> > > > > decoder support ac3 can enjoy multi-channel audio from dts, aac, wma
> > > > > pro, eac3, etc.
> > > > >
> > > > > Here's a test audio filter which do this work by using lavc to encode
> > > > > ac3 at runtime. It works with me on ppc and intel, but seems it now
> > > > > introduce a little more flick of subtitles on mac system.
> > > > > And also, I'm not familar with audio filters, so the code probably do
> > > > > things in some wrong way, or missed something, such as encode the last
> > > > > audio frame, calculate the delay, etc, and also the calculate af->mul.
> > > > > If this filter is worth to do, please give suggests on it, or someone
> > > > > else make a better one.
> > > > >
> > > > > The patch need to reorder channels, so it rely on my reorder_copy
> > > > > patch I sent just now. Or I should make it independent?
> > > > >
> > > >
> > > > I forgot to say the usage:
> > > >
> > > > normally, add these to cmdline to encode multi-channel to spdif
> > > > -channels 6 -af lavcac3enc=1
> > > >
> > > > full usage is
> > > > -af lavcac3enc=A:B:C
> > > >
> > > > A: 0: output raw ac3 stream. 1: passthrough to spdif. current default is 0
> > > > B: bitrate, if not set default for 2ch is 192kbits, and 384kbits for
> > > > more than 2ch.
> > > > C: min_channel_num to apply this filter, if nch is less than this
> > > > value, detach the filter. current default is 5
> > >
> > > Slight update version.
> > >
> >
> > I found the test filter introduce little gaps or tremolo, but I had no
> > idea what caused it. Anyone familar with encoder or filter can help
> > me?
> >
>
> The tremolo is some little noise like little spark, after some test, I
> found the noise also exists when I use the current svn of ffmpeg to
> encode some raw 5.1 wav, so this could caused by some encoder
> bug of libavcodec
>

Finally I found the reason cause noise, it's my code bug, now fixed.
Other update: remove spdif sample rate limit; use different default
bitrates for different input channel numbers.

-- 
Ulion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: af_lavcac3enc9.diff
Type: text/x-diff
Size: 13618 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071121/a10b493b/attachment.diff>


More information about the MPlayer-dev-eng mailing list