[FFmpeg-devel] [PATCH 2/2] lavfi: add channelremap audio filter.

Nicolas George nicolas.george at normalesup.org
Wed Jan 11 21:35:58 CET 2012


Le duodi 22 nivôse, an CCXX, Clément Bœsch a écrit :
> +Remap the channels of an audio stream using channel indexes.
> +
> +This filter allows to re-order, copy, remove or insert muted channels in an
> +audio stream. It accepts a list of channel indexes separated by ":". Using "-1"
> +as channel index means it is a muted channel.
> +
> +For example, if you have a 5.1 source and want a stereo audio stream by
> +dropping the extra channels:
> + at example
> +channelremap=0:1
> + at end example
> +
> +Given the same source, you can also switch front left and front right channels
> +and keep the input channel layout:
> + at example
> +channelremap=1:0:2:3:4:5
> + at end example
> +
> +If the input is a stereo audio stream, you can mute the front left channel (and
> +still keep the stereo channel layout) with:
> + at example
> +channelremap=-1:1
> + at end example
> +
> +Still with a stereo audio stream input, you can copy the right channel in both
> +front left and right:
> + at example
> +channelremap=0:0
> + at end example
> +

I did not yet look at the code, but I must say I do not like it very much,
for two major reasons:

- As far as I can see, all it can do, af_pan can do as well. Possibly,
  af_pan may be slower and/or support less formats, but this is just a
  matter of optimization and coverage.

- It does not take the channel layout into account at all.

More broadly speaking, having several implementations of roughly the same
features is very confusing for the users: they always wonder why there are
several versions, which one they are supposed to use. And for us, it makes
twice the amount of work to maintain.

For this particular case, I really see no reason not to use and improve
af_pan rather than start a new filter.

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/20120111/3c92ee1b/attachment.asc>


More information about the ffmpeg-devel mailing list