After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 548002 - libavcodec doesn't provide audio channel mappings
libavcodec doesn't provide audio channel mappings
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal normal
: 0.10.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-16 09:09 UTC by Sebastian Dröge (slomo)
Modified: 2008-12-13 07:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2008-08-16 09:09:08 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)
Comment 1 Sebastian Dröge (slomo) 2008-08-16 09:17:49 UTC
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?
Comment 2 Sebastian Dröge (slomo) 2008-08-28 19:08:18 UTC
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.
Comment 3 Edward Hervey 2008-08-29 07:02:04 UTC
We'll leave this bug until there's enough information provided by ffmpeg to properly export the channel mapping in the caps.
Comment 4 Edward Hervey 2008-08-29 09:53:38 UTC
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

Comment 5 Edward Hervey 2008-12-06 16:17:38 UTC
As of current revision used by gst-ffmpeg, the AVCodecContext and AVCodec structures have new fields for channel layouts, we should use them :)
Comment 6 Sebastian Dröge (slomo) 2008-12-13 07:55:32 UTC
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.