[MPlayer-dev-eng] [PATCH] Automatic downmix
ubitux
ubitux at gmail.com
Tue Aug 17 22:07:17 CEST 2010
On Tue, Aug 17, 2010 at 05:37:17PM +0200, Nicolas George wrote:
> Le nonidi 29 thermidor, an CCXVIII, ubitux a écrit :
> > > On the other hand, it seems that libavcodec's FLAC decoder does not respect
> > > the libavcodec policy about channels layout, and outputs in Xiph channel
> > > order (FL FC FR RL RR LF).
> > What you said is strange: I just encoded 6_Channel_ID.wav with flac, and
> > tried to play the generated 6_Channel_ID.flac with my patched MPlayer, and
> > everything went fine: channels assignment were good.
>
> Sorry, my mistake: I assumed that FLAC, being issued by the same
> organization as Vorbis, would follow the same channel layout, but I was
> wrong: Vorbis follows its own channel layout (FL FC FR RL RR LF) while FLAC
> follows the SMPTE/ITU-R recommendation (FL FR FC LF RL RR). Since ffmpeg
> uses the same SMPTE/ITU-R layout, the current behaviour is correct.
>
OK thanks for this clarification.
> Now, regarding your initial problem:
>
> >>> Also, I note that the channels assignements was wrong if I followed the
> >>> FLAC specs (are they wrong or is there a convertion somewhere?). So I used
> >>> those two samples in order to get the right assignement:
>
> The answer is: there is a conversion somewhere, namely in
> libmpcodecs/ad_ffmpeg.c, a call to reorder_channel_nch. Apart from bugs, all
> audio circulating inside mplayer, in particular through audio filters, is in
> the ALSA channel order: FL FR RL RR FC LF. The correct arguments for pan
> should therefore be:
>
> # in FL FR RL RR FC LF
> pan=2: 0.4:0 : 0:0.4 : 0.4:0 : 0:0.4 : 0.2:0.2 : 0.2:0.2
> # out L R L R L R L R L R L R
>
Are those quotients arbitrary? There is an overflow of 20% with this, is
it normal? I tried to keep them summing up to 1.0, was I wrong? Still my
values are totally arbitrary, so maybe we should correct them.
> (spacing added for better readability; where did my "Alternate syntax for -af
> pan" patch disappear?)
>
That would be interesting to have it :)
Also, you may have notice my patch make the values still readable:
"0.4:0:" // Front left
"0:0.4:" // Front right
"0.2:0:" // Back left
"0:0.2:" // Back right
"0.3:0.3:" // Center
"0.1:0.1" // LFE
That said, spacing would still be appreciated.
>
> Regards,
>
> --
> Nicolas George
--
ubitux
More information about the MPlayer-dev-eng
mailing list