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,915
|
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. |
|||
|
|