[FFmpeg-user] aresample in_channel_layout has no effect
Christian Ebert
blacktrash at gmx.net
Mon Jun 29 17:06:51 EEST 2020
Hi,
I'm trying to downsample 4 channel (unknown layout) pcm to
stereo. However, aresample's in_channel_layout option has no
effect:
$ ffmpeg -report -guess_layout_max 0 -i 4ac.wav -filter:a aresample=in_channel_layout=4.0:out_channel_layout=stereo -c:a pcm_s16le -y out.wav
ffmpeg started on 2020-06-29 at 14:53:17
Report written to "ffmpeg-20200629-145317.log"
Log level: 48
ffmpeg version N-98130-g38737b3d4e Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --enable-gpl --enable-nonfree --enable-shared --enable-openssl --enable-pic --enable-libspeex --enable-libopus --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libmp3lame --enable-libbluray --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libvidstab --enable-libfreetype --enable-libzimg --enable-libass --extra-cflags=-I/opt/sw/include --extra-libs='-L/opt/sw/lib -L/opt/sw/lib/freetype219/lib -L/opt/sw/lib/gcc9/lib' --disable-htmlpages
libavutil 56. 54.100 / 56. 54.100
libavcodec 58. 92.100 / 58. 92.100
libavformat 58. 46.101 / 58. 46.101
libavdevice 58. 11.100 / 58. 11.100
libavfilter 7. 86.100 / 7. 86.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, wav, from '4ac.wav':
Metadata:
encoder : Lavf58.46.101
Duration: 00:00:12.00, bitrate: 3072 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 4 channels, s16, 3072 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'out.wav':
Metadata:
ISFT : Lavf58.46.101
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Metadata:
encoder : Lavc58.92.100 pcm_s16le
size= 2250kB time=00:00:12.00 bitrate=1536.1kbits/s speed= 387x
video:0kB audio:2250kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.003385%
$ grep -A 2 Matrix ffmpeg-20200629-145317.log
[Parsed_aresample_0 @ 0x7fc03e500a40] [SWR @ 0x1110fe000] Matrix coefficients:
[Parsed_aresample_0 @ 0x7fc03e500a40] [SWR @ 0x1110fe000] FL: FL:0.453082 FR:0.000000 FC:0.320377 BC:0.226541
[Parsed_aresample_0 @ 0x7fc03e500a40] [SWR @ 0x1110fe000] FR: FL:0.000000 FR:0.453082 FC:0.320377 BC:0.226541
$ ffmpeg -report -guess_layout_max 0 -i 4ac.wav -filter:a aresample=in_channel_layout=quad:out_channel
_layout=stereo -c:a pcm_s16le -y out.wav
ffmpeg started on 2020-06-29 at 14:59:13
Report written to "ffmpeg-20200629-145913.log"
Log level: 48
ffmpeg version N-98130-g38737b3d4e Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --enable-gpl --enable-nonfree --enable-shared --enable-openssl --enable-pic --enable-libspeex --enable-libopus --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libmp3lame --enable-libbluray --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libvidstab --enable-libfreetype --enable-libzimg --enable-libass --extra-cflags=-I/opt/sw/include --extra-libs='-L/opt/sw/lib -L/opt/sw/lib/freetype219/lib -L/opt/sw/lib/gcc9/lib' --disable-htmlpages
libavutil 56. 54.100 / 56. 54.100
libavcodec 58. 92.100 / 58. 92.100
libavformat 58. 46.101 / 58. 46.101
libavdevice 58. 11.100 / 58. 11.100
libavfilter 7. 86.100 / 7. 86.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, wav, from '4ac.wav':
Metadata:
encoder : Lavf58.46.101
Duration: 00:00:12.00, bitrate: 3072 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 4 channels, s16, 3072 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'out.wav':
Metadata:
ISFT : Lavf58.46.101
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Metadata:
encoder : Lavc58.92.100 pcm_s16le
size= 2250kB time=00:00:12.00 bitrate=1536.1kbits/s speed= 375x
video:0kB audio:2250kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.003385%
$ grep -A 2 Matrix ffmpeg-20200629-145913.log
[Parsed_aresample_0 @ 0x7feeca404380] [SWR @ 0x111d48000] Matrix coefficients:
[Parsed_aresample_0 @ 0x7feeca404380] [SWR @ 0x111d48000] FL: FL:0.453082 FR:0.000000 FC:0.320377 BC:0.226541
[Parsed_aresample_0 @ 0x7feeca404380] [SWR @ 0x111d48000] FR: FL:0.000000 FR:0.453082 FC:0.320377 BC:0.226541
Matrix coefficients for icl 4.0 and quad, or for any other 4
channel layout are exactly the same,
What am I overlooking?
Something like aresample=ocl=quad,aresample=ocl=stereo yields a
different matrix, but what is the point of in_channel_layout
then?
TIA
Christian
--
LAST SHIP HOME
Winner of the German Ocean Film Award 2019
--->> https://lastshiphome.de
More information about the ffmpeg-user
mailing list