GNOME Bugzilla – Bug 548002
libavcodec doesn't provide audio channel mappings
Last modified: 2008-12-13 07:55:32 UTC
Hi, gst-ffmpeg doesn't handle audio with >2 channels correctly. First of all the pad template caps use [1,2] channels (gstffmpegcodecmap.c:174) which then results in the "pad returned caps which are not a real subset of its template caps" error. Then, if that's fixed, it doesn't set a channel layout on the multichannel audio which leads to other bugs. Sample file: http://dragon.async.com.br/~jdahlin/ffdec_ac30_bugg.avi (when decoding the audio with ffdec_ac3)
From a short look at the ffmpeg sources it seems that ffmpeg doesn't provide any information about the channel layout, only on the number of channels which is rather useless... Did I miss anything?
Partially fixed by this commit: 2008-08-28 Edward Hervey <edward.hervey@collabora.co.uk> * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new): ffmpeg audio decoders can now do up to 6 channels... and actually expose it properly. Don't expect any channel mapping though.
We'll leave this bug until there's enough information provided by ffmpeg to properly export the channel mapping in the caps.
Ok, marking all codecs as accepting up to 6 channels wasn't the smartest idea ever. I fixed it so that only whitelisted codecs show up to 6 channels. It still leaves the problem with channel mapping (which the ffmpeg devs are currently working on). 2008-08-29 Edward Hervey <edward.hervey@collabora.co.uk> * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new): Instead of marking all audio decoders/encoders as accepting up to 6 channels, we white-list those for which we are sure they can handle those 6 channels. Fixes #549799
As of current revision used by gst-ffmpeg, the AVCodecContext and AVCodec structures have new fields for channel layouts, we should use them :)
2008-12-13 Sebastian Dröge <sebastian.droege@collabora.co.uk> * ext/ffmpeg/Makefile.am: * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_channel_layout_to_gst), (gst_ff_aud_caps_new): * ext/ffmpeg/gstffmpegcodecmap.h: Set the channel layout if it's exposed by the decoder. Fixes bug #548002. This is only for decoding now. ffmpeg has infrastructure for listing the encoder supported channel layouts but unfortunately no encoder uses this yet.