Opened 18 months ago

Last modified 17 months ago

#10473 new enhancement

Feature request: Support Audio ChannelMask with AviSynth+ r4001

Reported by: Jose Peirote Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

With the last AviSynth+ r4001 the audio channelmask is stored in the VideoInfo.image_type variable (see details in the new https://github.com/AviSynth/AviSynthPlus/blob/master/avs_core/include/avisynth.h )

At least a decoder test (https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works/issues/35) can store that info, or can be set in avs script with SetChannelMask().

Now only know VirtualDub2 to output WAVE_FORMAT_EXTENSIBLE with the correct channel map taken from that info.

Please add that feature to ffmpeg, now is ignored and a default channel mask, based in numchannels, is output.

Added a avs script and a eac3 sample to be load in VirtualDub2 and save audio:
MaskChannels : 22031 (FL FR FC LF SL SR TFL TFR).
If don't want install the test version of LWLibavAudioSource uncomment the SetChannelMask("22031")

Compare the output with the:

ffmpeg -i chmask.avs chbad.wav

MaskChannels : 1599 (FL FR FC LF BL BR SL SR)

Attachments (2)

chmask.avs (190 bytes ) - added by Jose Peirote 18 months ago.
8w3D.ec3 (939.0 KB ) - added by Jose Peirote 18 months ago.

Download all attachments as: .zip

Change History (4)

by Jose Peirote, 18 months ago

Attachment: chmask.avs added

by Jose Peirote, 18 months ago

Attachment: 8w3D.ec3 added

comment:1 by Francesco Bucciantini, 17 months ago

I can confirm that the new LWLibavAudioSource() is correctly populating the audio properties inside Avisynth (checked in AVSPmod mod and VirtualDub), so yeah, it would be nice to have them supported inside ffmpeg too.

Just as a reference for the ffmpeg devs, here's the stable build of Avisynth 3.7.3 which introduced support to the new ChannelMask (i.e SetChannelMask() ): https://github.com/AviSynth/AviSynthPlus/releases/tag/v3.7.3

comment:2 by Jose Peirote, 17 months ago

Using other decoders can also obtain the same result with a workaround (until supported), see https://forum.doom9.org/showthread.php?p=1989675#post1989675

global OPT_UseWaveExtensible = true # Needed to use global OPT_dwChannelMask=
FFAudioSource("8w3D.ec3")
global OPT_dwChannelMask=FFCHANNEL_LAYOUT

or

global OPT_UseWaveExtensible = true # Needed to use global OPT_dwChannelMask=
BestAudioSource("8w3D.ec3")
global OPT_dwChannelMask=BASCHANNEL_LAYOUT

Note: See TracTickets for help on using tickets.