View Full Version : GetChannel() cannot handle more than 5.1
kenpachi
18th November 2010, 03:22
I've got a DTS source:
Audio
Format : DTS
Format/Info : Digital Theater Systems
Format profile : ES
Duration : 3h 14mn
Bit rate mode : Constant
Bit rate : 755 Kbps
Channel(s) : 7 channels
Channel positions : Front: L C R, Side: L R, Back: C, LFE
Sampling rate : 48.0 KHz
Bit depth : 24 bits
Stream size : 1.03 GiB (100%)
I don't know how to extract Back C channel using Avisynth. I guess sooner or later I'll have to use DTS Encode Suite to do something with that problem but maybe there's other way in Avisynth to handle audio tracks greater than 5.1?
I ask due to joining this DTS 6.1 source with AC3 5.1 one.
poisondeathray
18th November 2010, 03:36
I think 6.1 configuration is:
6.1: FL FR C LFE BL BR BC
vid=blankclip()
aud=NicLPCMSource("audio.dts",48000,-24,7)
#BC = GetChannel(aud, 7)
audiodub(vid,aud)
EDIT: Sorry, I don't think it works, I though you could load with NicLPCMSource or NicDTSSource.....
I would double check with tebasuna51 in Audio subforum, I don't know what the downmix function is or the coefficients used for 6.1=>5.1
Midzuki
18th November 2010, 04:54
If you have registered the ArcSoft and/or the Sonic audio decoders, you could try the DirectShowSource() approach
(I am not sure if that will work as it should, though).
IanB
18th November 2010, 06:27
Avisynth is audio channel agnostic, i.e. it will support any number of audio channels.
However the source filters and export interfaces are limited by the technology they use to implement their function. i.e. VfW believes in Mono and Stereo everything else is a mistake, this is used by AviSource()
DirectShowSource() should be able to deliver any number of channels provided the DIrectShow graph components are capable of presenting them.
Nic*Source()'s should be able to deliver most extended formats.
The SoundOut plugin should also be able to export many extended formats.
GetChannel() can extract any subset of the input source. Remember it starts numbering channels at 1.
tebasuna51
18th November 2010, 19:21
There are two kind of DTS-ES 7 channel.
- DTS-ES, 5.1 channels, matrixed, only 6 physical channels with BC channel mixed in surround channels.
Can be decoded with free decoders (NicAudio, libavcodec, ...) to 5.1 uncompresed audio. Same output with commercial (ArcSoft, ...) decoders.
Can be recoded to AC3-EX with Aften and some flags:
Aften -xbsi2 1 -dsurexmod 2 dts-es-mat.wav ac3-ex.ac3
- DTS-ES, 6.1 channels, discrete, a physical BC channel. (The kenpachi sample).
Free decoders (NicAudio, libavcodec, ...) mix automatically the BC channel to surround channels and can be used like matrixed one.
ArcSoft decoder (Sonic not tested) used with eac3to, output 7 channels with this order: FL, FR, FC, LF, BC, SL, SR (ChannelMask = 0x070F)
I don't know the output if ArcSoft is used with DirectShow (not possible without hacks (http://forum.doom9.org/showthread.php?t=154070)).
Other valid map can be: FL, FR, FC, LF, BL, BR, BC (ChannelMask = 0x013F).
@kenpachi, don't worry use NicDTSSource and you have a standard 5.1 with the BC channel mixed to surround channels.
@IanB, without a new audio property (ChannelMask) we can't manage properly multichannel audio inside AviSynth.
kenpachi
19th November 2010, 02:00
1) When I say GetChannel() cannot read more than 5.1 I mean I use e.g. this script:
eng_a = NicDTSSource(".\demuxed\ENG.dts").ConvertAudioToFloat()
eng_a = eng_a.TimeStretch(tempo = 100 * 25.0 * 1001.0 / 24000.0)
eng_a = eng_a.GetChannel(7)
return eng_a
and get this message:
GetChannel: Attempted to request a channel that didn't exist!
2) When playing in mplayerc I decode it using AC3Filter v.1.63b and get in "Decoder info" box as follows:
Input format: DTS - 48000
User format: PCM Float 2/0 (stereo) 0
Output format: PCM Float 2/0 (stereo) 48000
Decoding chain:
(DTS - 48000) -> Decoder -> (Linear PCM 3/2.1 (5.1) 48000) -> Processor -> (PCM Float 2/0 (stereo) 48000) -> Dejitter -> (PCM Float 2/0 (stereo) 48000)
Filters info (in order of processing):
Decoder:
Stream format: DTS 3/2.1 (5.1) 48000Hz
Bitstream type: 16bit big endian
Frame size: free format
Samples: 512
Bitrate: unknown
SPDIF stream type: 0xb
Frame interval: 1006
Actual bitrate: 754kbps
DTS
speakers: 3/2.1 (5.1)
sample rate: 48000Hz
bitrate: 768kbps
stream: 16bit BE
frame size: 1006 bytes
nsamples: 512
amode: 9
No CRC
Processor:
(Linear PCM 3/2.1 (5.1) 48000) -> Input levels -> (Linear PCM 3/2.1 (5.1) 48000) -> Input cache ->
(Linear PCM 3/2.1 (5.1) 48000) -> Mixer -> (Linear PCM 2/0 (stereo) 48000) -> SRC ->
(Linear PCM 2/0 (stereo) 48000) -> Bass redirection -> (Linear PCM 2/0 (stereo) 48000) ->
Equalizer -> (Linear PCM 2/0 (stereo) 48000) -> Dither -> (Linear PCM 2/0 (stereo) 48000) ->
AGC -> (Linear PCM 2/0 (stereo) 48000) -> Delay -> (Linear PCM 2/0 (stereo) 48000) ->
Output cache -> (Linear PCM 2/0 (stereo) 48000) -> Output levels ->
(Linear PCM 2/0 (stereo) 48000) -> Linear->PCM converter -> (PCM Float 2/0 (stereo) 48000)
Dejitter:
-
3) It seems like NicDTS doesn't decode more than 6 channels neither does AC3Filter. It's obvious due to no errors when attempting to splice clip with mentioned DTS source and clip with 5.1 AC3 source.
IanB: Do I understand correctly? If I decode a source properly it doesn't matter to GetChannel() how many channels there are? So this is a problem with decoding, right?
tebasuna51: Ok, so the BC channel is somewhere there, right? My point is not to drop any channels from DTS. I'd like to keep the 6.1 system, because the AC5.1 clip that I splice DTS clip with is only 9 frames long. NicDTS downmixes, right? I need to avoid it.
4) I got DTS-HD Master Audio Encoder Suite. I wonder if I can separate channels to uncompressed WAVs using this? But from what I remind myself doing such thing once, I managed to separate anything only with eac3to. But that was uncompressed WAV 5.1.
5) So, let's say this DTS source has those 7 channels and I want to extract them to uncompressed WAVs, especially 7th one. Can I do it with eac3to and DTS-HD EncSuite without using ArcSoft?
EDIT: I've just tried eac3to but without ArcSoft Decoder it cannot decode BC channel. Will try DTS-HD and then this whole ArcSoft thing.
IanB
19th November 2010, 05:16
Yes you can only GetChannel() a channel that has been input into the script.
Use Info() to check what an input filter is actually doing. Use AudioDub(BlankClip, Last) if there is no video to write the text onto.
Gavino
19th November 2010, 10:25
Use AudioDub(BlankClip, Last) if there is no video to write the text onto.
Because of this bug (fixed in current CVS), this will give the error "AudioDub: need an audio and a video track".
You need to write AudioDub(BlankClip(), Last).
tebasuna51
20th November 2010, 14:32
3) ...
tebasuna51: Ok, so the BC channel is somewhere there, right? My point is not to drop any channels from DTS. I'd like to keep the 6.1 system, because the AC5.1 clip that I splice DTS clip with is only 9 frames long. NicDTS downmixes, right? I need to avoid it.
...
2) Seems you have your DirectShow system configured to only 2 channels.
3) Then use 4) or 5). But, you can't recode 6.1 to AC3 (max 5.1).
4) With DTS-HD Master Audio Encoder Suite I think you can decode to 7 channels (I can't test this).
5) With eac3to and ArcSoft decoder you can decode DTS-ES 6.1 to multichannel WAV/W64 6.1 or 7 monowavs.
kenpachi
20th November 2010, 21:03
I used ArcSoft decoder and succeeded in extracting to WAVs:
DTS-ES, 6.1 channels, 3:14:49, 24 bits, 755kbps, 48khz, dialnorm: -4dB
Decoding with ArcSoft DTS Decoder...
Removing DTS dialog normalization...
Writing WAVs...
R.wav"...
C.wav"...
LFE.wav"...
SL.wav"...
BC.wav"...
SR.wav"...
L.wav"...
eac3to processing took ...
Done.
Strange thing is each .wav is unreadable. Whether I open the files in mplayerc whether with WAVSource.ConvertToFloat() in .avs I get only constant audio noise. Each WAV is 1500kbs and weights 'bout 1.7GB.
What's about that dialnorm: -4dB? How to disable it?
tebasuna51
21st November 2010, 04:43
@IanB, I move some post to the old thread http://forum.doom9.org/showthread.php?t=137991 to don't disturb this thread with 2 separated discussions. Please help me about ChannelMask in that thread.
...
Strange thing is each .wav is unreadable. Whether I open the files in mplayerc whether with WAVSource.ConvertToFloat() in .avs I get only constant audio noise. Each WAV is 1500kbs and weights 'bout 1.7GB.
@kenpachi, sorry, I forget say you than DTS 6.1 is only decoded properly, with eac3to at last, with ArcSoft decoder version 1.1.0.0
See this thread http://forum.doom9.org/showthread.php?t=125966&page=538
Maybe dansrfe can supply soon the pack 1.1.0.0
What's about that dialnorm: -4dB? How to disable it?
eac3to remove automatically dialnorm:
"Removing DTS dialog normalization..."
If you want preserve the Dialog Normalization value you can use the parameter:
-keepDialnorm
kenpachi
22nd November 2010, 23:49
Many thanks tebasuna. Dansfre's just delivered version 1.0.0.0 and demuxing is just fine. Just one little problem is still there. The DTS source Bit Depth is 24 bit. I edit demuxed WAVs in Avisynth and then open the scripts in VirtualDub to full process audio streams and save them in PCM. The problem is that Bit Depth in VD is restricted to 16bit. I'm searching for another way to convert AviSynth.ConvertToFloat() source to straight 24bit pcm. I tried eac3to but it doesn't accept .avs. Does anybody know solution to this?
I've read fccHandler from VDMPEG-2 project featured DadRip that can at least extract 24bit from VOBs
http://forums.virtualdub.org/index.php?act=ST&f=4&t=7877
http://fcchandler.home.comcast.net/DADRip.exe
but the link's dead and anyway it seems to be unhelpful.
EDIT: I got my answer. I forgot 'bout that SoundOut plugin.
SoundOut(out.KillVideo(), output="WAV", format=2, filename=path)
tebasuna51
23rd November 2010, 00:42
BeHappy can also manage audio avs and output to the desired format.
IanB
23rd November 2010, 01:50
The Avifile output routines automatically convert float audio samples to 16bit, adding "global OPT_AllowFloatAudio=True" to your script will prevent this. 24Bit and 32Bit PCM are not converted on output.
Avisynth automatically converts audio sample format to suit the filters being loaded. Float samples are the preferred when a given format is not supported by the filter. Use ConvertAudioTo24Bit() to convert float samples to 24bit PCM at the end of your script.
VirtualDub can only process 16Bit PCM in full processing mode but will process anything in direct stream copy mode.
And adding "global OPT_UseWaveExtensible=True" will change the AviFIle audio header from WAVEFORMATEX to WAVEFORMATEXTENSIBLE.
kenpachi
23rd November 2010, 13:40
@tebasuna51: Good to know. Shame it doesn't work on vista, though.
@IanB: Thanks. Gonna be helpful.
I'm pasting SoundOut specs:
WAV/AIF/CAF Script Parameters:
type
0: Microsoft WAV (default),
1: WAV with WAVEFORMATEX,
2: Apple/SGI AIFF,
3: Sun/NeXT AU,
4: RAW PCM,
5: S.F. WAVE64,
6: Core Audio File,
7: Broadcast Wave.
format
0: 16bit per sample,
1: 24bit per sample,
2: 32bit per sample,
3: 32bit float per sample,
Default: Same as input.
The interesting thing is that I must choose format=2, not format=1 to get 24bit. Otherwise I get 16bit. It seems specs refer to 0..n counting when in fact counting is 1..n in AviSynth 2.5.8 SoundOutIncluded.
Also, Guys, I wonder if BitDepth changing lowers the quality anyhow. It's not the same as changing up SampleRate, is it?
cretindesalpes
23rd November 2010, 14:49
Also, Guys, I wonder if BitDepth changing lowers the quality anyhow. It's not the same as changing up SampleRate, is it?
Reducing the samplerate will limit the frequency content bandwidth.
Reducing the bitdepth will distort or eliminate signals of low amplitude.
Gavino
23rd November 2010, 14:57
The interesting thing is that I must choose format=2, not format=1 to get 24bit. Otherwise I get 16bit. It seems specs refer to 0..n counting when in fact counting is 1..n in AviSynth 2.5.8 SoundOutIncluded.
The documentation is wrong and omits the 8bit option which is actually format=0, as for WAVPack.
Also, Guys, I wonder if BitDepth changing lowers the quality anyhow. It's not the same as changing up SampleRate, is it?
Lowering bit depth will introduce quantization noise (http://en.wikipedia.org/wiki/Quantization_error).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.