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

Ulion ulion2002 at gmail.com
Tue Nov 20 03:20:49 CET 2007


2007/11/20, Diego Biurrun <diego at biurrun.de>:
> On Tue, Nov 20, 2007 at 01:33:00AM +0800, Ulion wrote:
> >
> > Update with man page.
> >
> > --- DOCS/man/en/mplayer.1     (revision 25106)
> > +++ DOCS/man/en/mplayer.1     (working copy)
> > @@ -4695,6 +4695,28 @@
> >  .TP
> > +.B lavcac3enc[=tospdif[:bitrate[:minchn]]]
> > +Encode multi-channel audio to ac3 stream with <bitrate> at runtime using lavc.
>
> AC-3, s/stream//, libavcodec

Fixed, but what 's/stream//' mean?

>
> The output is big-endian when outputting a raw AC-3 stream,
> native-endian when outputting to S/PDIF.
>
> > +Need to specify input channel number by '-channels N' to make the decoder decode
> > +audio to N channel, then the filter can encode the N channel input to ac3.
>
> See above, do not abbreviate [LBN]E.
>
> > +.IPs <bitrate>
> > +The bit rate to encode the ac3 stream, default 192kbits for 2ch, 384kbits for more channels if not set. Either set it with 384 or 384000 to got 384kbits.
>
> Bitrate, break this line, new sentences new lines.
>
> > +.IPs <minchn>
> > +Min channel number of the input audio to use this filter, default 5.
>
> minimum, (default: 5)
>
> > +If input channel number less than it, filter will detach itself.
>
> missing verb

Manpage fixed as you suggested.

>
> > --- libaf/af_lavcac3enc.c     (revision 0)
> > +++ libaf/af_lavcac3enc.c     (revision 0)
> > @@ -0,0 +1,269 @@
> > +// Copyright (c) 2007 Ulion <ulion # gmail dot com>
> > +// #inlcude <GPL_v2.h>
>
> Use a standard GPL header, see the files in the vidix/ directory.  You
> have also misspelled the preprocessor directive.

Fixed with a proper license header.

>
> > +#ifndef AC3_FRAME_SIZE
> > +#define AC3_FRAME_SIZE 1536
> > +#endif
>
> Where could this be defined?

ac3.h in libavcodec, but since we do not use it directly, so I define
it if not defined.

>
> > +        if (data->format != AF_FORMAT_S16_LE && data->format != AF_FORMAT_S16_BE) {
> > +            af_msg(AF_MSG_ERROR, "af_lavcac3enc only support s16le or s16be input, current input: %s.", af_fmt2str_short(data->format));
>
> supports

Fixed.

>
> > +            return AF_ERROR;
> > +        }
> > +        /*
> > +        if (data->rate != 48000 && data->rate != 44100 && data->rate != 32000) {
> > +            af_msg(AF_MSG_ERROR, "af_lavcac3enc only support 48kHz, 44.1kHz, 32kHz sample rate, current input: %d.", data->rate);
>
> ditto

Fixed.

>
> > --- libaf/Makefile    (revision 25106)
> > +++ libaf/Makefile    (working copy)
> > @@ -30,6 +30,7 @@
> >                $(AF_SRCS) \
> >
> >  SRCS_COMMON-$(HAVE_SYS_MMAN_H)      += af_export.c
> > -SRCS_COMMON-$(LIBAVCODEC)           += af_lavcresample.c
> > +SRCS_COMMON-$(LIBAVCODEC)           += af_lavcresample.c \
> > +                                       af_lavcac3enc.c
>
> Add another backslash, this will reduce the diff once the next filter
> gets added.
>

Sure.

Here's the fixed version. Still need peoples familar with encoder or
ac3 or audio filter give suggestions and helps.

-- 
Ulion



More information about the MPlayer-dev-eng mailing list