[FFmpeg-devel] [PATCH] Use channel count if channel layout is undefined

Marcin Gorzel gorzel at google.com
Tue Jul 10 12:05:36 EEST 2018


Thanks for the explanation Nicolas.

When the matrix is not explicitly provided, lswr computes it. For that,
> it needs the channel layout, because you do not mix a rear channel the
> same way as a subwoofer. This patch absolutely needs to be tested under
> these circumstances too.
>

This patch does not affect the behavior when the downmix matrix is not
explicitly provided. For example, running:

./ffmpeg -i input_9ch.wav -ac 6 output_6ch.wav

Results in:

[auto_resampler_0 @ 0x5617a8668c80] [SWR @ 0x5617a8669180] Rematrix is
needed between 9 channels and 5.1 but there is not enough information to do
it
[auto_resampler_0 @ 0x5617a8668c80] Failed to configure output pad on
auto_resampler_0

Which I think is a reasonable expectation. Since the channel layout for 9
channel audio is undefined, there is no 'standard' way to downmix it to 5.1
or 2.0 etc.

For 'known' channel layouts, the output is correct as well:

./ffmpeg -i input_8ch.wav -ac 6 output_6ch.wav

[auto_resampler_0 @ 0x55adfbd6fa00] [SWR @ 0x55adfbd6fec0] FL: FL:0.585786
FR:0.000000 FC:0.000000 LFE:0.000000 BL:0.000000 BR:0.000000 SL:0.000000
SR:0.000000
[auto_resampler_0 @ 0x55adfbd6fa00] [SWR @ 0x55adfbd6fec0] FR: FL:0.000000
FR:0.585786 FC:0.000000 LFE:0.000000 BL:0.000000 BR:0.000000 SL:0.000000
SR:0.000000
[auto_resampler_0 @ 0x55adfbd6fa00] [SWR @ 0x55adfbd6fec0] FC: FL:0.000000
FR:0.000000 FC:0.585786 LFE:0.000000 BL:0.000000 BR:0.000000 SL:0.000000
SR:0.000000
[auto_resampler_0 @ 0x55adfbd6fa00] [SWR @ 0x55adfbd6fec0] LFE: FL:0.000000
FR:0.000000 FC:0.000000 LFE:0.585786 BL:0.000000 BR:0.000000 SL:0.000000
SR:0.000000
[auto_resampler_0 @ 0x55adfbd6fa00] [SWR @ 0x55adfbd6fec0] BL: FL:0.000000
FR:0.000000 FC:0.000000 LFE:0.000000 BL:0.585786 BR:0.000000 SL:0.414214
SR:0.000000
[auto_resampler_0 @ 0x55adfbd6fa00] [SWR @ 0x55adfbd6fec0] BR: FL:0.000000
FR:0.000000 FC:0.000000 LFE:0.000000 BL:0.000000 BR:0.585786 SL:0.000000
SR:0.414214
[auto_resampler_0 @ 0x55adfbd6fa00] ch:8 chl:7.1 fmt:s16 r:48000Hz -> ch:6
chl:5.1 fmt:s16 r:48000Hz

Thank you for raising that point and please let me know if you still have
concerns.

Regards,

-- 

Marcin Gorzel |  Software Engineer |  gorzel at google.com |


More information about the ffmpeg-devel mailing list