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

Diego Biurrun diego at biurrun.de
Mon Nov 19 22:58:19 CET 2007


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

> +Supports input 16-bit LE or BE format, max support 6 channel input.
> +If output raw ac3 stream (<tospdif> not set or zero), the output is BE.
> +If output to spdif (<tospdif> non-zero), the output is NE.

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

> --- 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.

> +#ifndef AC3_FRAME_SIZE
> +#define AC3_FRAME_SIZE 1536
> +#endif

Where could this be 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

> +            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

> --- 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.

Diego



More information about the MPlayer-dev-eng mailing list