Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
9th January 2019, 14:54 | #1 | Link | |||
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Avs+ and audio ChannelMask
A avs audio decoder can know the ChannelMask and:
Quote:
1) Let me explain the problem: We have, for instance, a 3 channel (FL-FR-FC or 3/0/0) 300.dts And we can recode without problems to a correct 300.ac3 with ffmpeg ffmpeg -i 300.dts 300.ac3 But using Avs+ with a simple script like: Quote:
ffmpeg -i 300.avs 300.ac3 I obtain: ... Guessed Channel Layout for Input Stream #0.0 : 2.1 ... And a 2/0/1 or FL-FR-LFE 201.ac3 instead a 300.ac3 Seems than ffmpeg ignore the script variable FFCHANNEL_LAYOUT generated by FFAudioSource Don't help add OPT_UseWaveExtensible = True (same warning and output) And also fixing OPT_dwChannelMask: Quote:
If ffmpeg can't use the AviSynth global OPT or the script variable FFCHANNEL_LAYOUT generated by ffms2.dll how can use them? 2) Workarounds. I know two interfaces to output correct WAVE_FORMAT_EXTENSIBLE headers from AviSynth with the correct ChannelMask. 2.1) BeHappy Is enough set [2]Tweak.ChMask to 7 to obtain the correct WAVE_FORMAT_EXTENSIBLE AiSynth output, than can be stored like wav or recoded to any format with FL-FR-FC support, of course to AC3 with ffmpeg. 2.2) Wavi Now the ChannelMask must be in the command line: wavi test.avs /M 7 300.wav Of course can be piped to any encoder like ffmpeg without problems But the avs can't have global OPT_UseWaveExtensible = true Wavi can generate the WAVE_FORMAT_EXTENSIBLE header but don't accept it like input: Error: Could not find PCM audio track in "test.avs". (However, the file contains an audio track of another format.) 2.3) avs2pipemod Like wavi avs2pipemod can generate the WAVE_FORMAT_EXTENSIBLE by command line: avs2pipemod -extwav 300.avs > 300.wav or other encoder, of course, but we can't put the correct ChannelMask like a parameter an always set a default per numchannels. Then the avs2pipemod default for 3 channels is FL-FR-BC and we obtain a incorrect 210.wav instead a 300.wav 3) The ChannelMask must be a audio property than replace to NumChannels. The NumChannels can be obtained very easy from ChannelMask (sum of bits with 1). In this Century the AviSinth audio output must be always WAVE_FORMAT_EXTENSIBLE with the correct ChannelMask.
__________________
BeHappy, AviSynth audio transcoder. |
|||
12th January 2019, 23:16 | #2 | Link |
Registered User
Join Date: Feb 2012
Posts: 82
|
I'm not sure if the Soundout plugin may help solve your problem. It is only in a 32bit version but does work with Avisynth+
http://avisynth.nl/index.php/SoundOut |
13th January 2019, 13:14 | #3 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Thanks for the answer.
Soundout can output WAVE_FORMAT_EXTENSIBLE format, but always set ChannelMask (using OPT_dwChannelMask or not) to the invalid value of 0. Then any encoder can apply the default or show a error.
__________________
BeHappy, AviSynth audio transcoder. |
16th January 2019, 09:40 | #4 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
OPT_UseWaveExtensible and OPT_dwChannelMask only has an effect if the consuming application is using the VFW interface to read data from Avisynth. Anything talking to the Avisynth API directly (so most things these days, since the VFW interface isn't hip anymore) will only see num_channels unless they explicitly go looking for variables in the script environment.
|
16th January 2019, 11:20 | #5 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
But like seems than SoundOut, wavi, avs2pipemod and also ffmpeg ignore OPT_dwChannelMask or FFCHANNEL_LAYOUT, there are a way to decode multichannel audio to a correct WAV/W64 with Avs?
__________________
BeHappy, AviSynth audio transcoder. |
17th January 2019, 10:13 | #7 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Quote:
Also, how fill OPT_dwChannelMask with FFCHANNEL_LAYOUT provided by FFAudioSource in the avs script?
__________________
BeHappy, AviSynth audio transcoder. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|