Log in

View Full Version : opening DTS-HD MA with NicAudio


zee944
26th April 2014, 13:00
I've tried opening a DTS-HD MA track with this script:

LoadPlugin("NicAudio[2.0.4].dll")
a=NicDTSSource("movie.dts", DRC=1) #a=NicAC3Source("movie.ac3", DRC=1)
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3)
lfe = GetChannel(a, 4)
lfc = MixAudio(fcc, lfe, 0.2071, 0.2071)
mix = MergeChannels(lfc, lfc)
lrc = MixAudio(flr, mix, 0.2929, 1.0)
blr = GetChannel(a, 5, 6)
MixAudio(lrc, blr, 1.0, 0.2929)
Normalize()
ConvertAudioto24bit()
AudioDubEx(BlankClip(length=Int(25*AudioLengthF(last)/Audiorate(last)), width=32, height=32, pixel_type="RGB24", fps=25), last)

VirtualDub opens this seemingly fine, but when I press play it just freezes, and the same happens when I want to save the audio.

Simplifying the script to this...:

LoadPlugin("NicAudio[2.0.4].dll")
NicDTSSource("movie.dts", DRC=1)
AudioDubEx(BlankClip(length=Int(25*AudioLengthF(last)/Audiorate(last)), width=32, height=32, pixel_type="RGB24", fps=25), last)

...it doesn't freeze, but no audio plays, and can't save the wave either. Why's that?

What I actually wanted to do is a proper stereo downmix of the DTS-HD MA 5.1 track.

filler56789
26th April 2014, 13:38
opening DTS-HD MA with NicAudio

You'd better try DirectShowSource (with LAV Audio + Arcsoft's DTS decoder).

zee944
26th April 2014, 14:39
You'd better try DirectShowSource (with LAV Audio + Arcsoft's DTS decoder).

How do I do that?

BTW, I've already decoded the six channels with eac3to. So I have 6 wavs. I can open them instead if that's easier, but I don't know how to make a stereo mix out of them.

zee944
26th April 2014, 16:46
Doesn't eac3to also have -downDpl and -downStereo options to do the downmix job?

You're perfectly right! I forgot about it.

I can't do dynamic range compression with that though - as far as I know, players do this when they downmix to stereo. Any suggestions?

Richard1485
27th April 2014, 08:53
NicDTSSource() does not decode DTS-HD MA. Extract the core with eac3to and try your first script again.

tebasuna51
27th April 2014, 12:18
I can't do dynamic range compression with that though - as far as I know, players do this when they downmix to stereo. Any suggestions?

NicAudio DRC parameter only work with AC3 than have DRC info in the stream, DTS audio don't have this info and the use of DRC parameter is useless.

And yes NicAudio can't decode DTS-MA, sometimes work decoding only the 'core' but is not recommended.

With (output.wav or other):

eac3to movie.dts output.wav -downStereo

you have the same downmix than with your avs script.

zee944
27th April 2014, 12:43
NicDTSSource() does not decode DTS-HD MA. Extract the core with eac3to and try your first script again.

I did that and it works now, thanks!

Now the question is: is my first script "right"? Should I handle a DTS track the very same way as an AC3 track? Will my stereo mix be good?

zee944
27th April 2014, 13:41
eac3to movie.dts output.wav -downStereo

you have the same downmix than with your avs script.

Thanks! I guess it is a "proper" stereo downmixing of a DTS track then.

Richard1485
27th April 2014, 14:37
Now the question is: is my first script "right"? Should I handle a DTS track the very same way as an AC3 track? Will my stereo mix be good?

The script looks right. The downmix is fine, but I prefer this.


flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3694, 0.2612)
blr = GetChannel(a, 5, 6)
MixAudio(lrc, blr, 1.0, 0.3694)

I normalize after downmixing to stereo. If you're concerned about dynamic range simply because you want to listen in a home environment, you can recompress to AC-3 at a bitrate that is high enough to be transparent (e.g. 384 kbps) and apply a DRC profile and dialnorm value e.g. film standard and -27. You can do this with WAV to AC3 encoder (http://www.videohelp.com/tools/EncWAVtoAC3). I do this quite often for friends who dislike high dynamic range. Give it a try.

zee944
27th April 2014, 18:48
The script looks right. The downmix is fine, but I prefer this.

How a player do the downmixing? Like "my" script do, or like yours?

If you're concerned about dynamic range simply because you want to listen in a home environment,
I'm only concerned about the dynamic range because as far as I know, players do DRC compression if the AC3 is flagged that way. I didn't know that in the case of DTS, this flag doesn't exist.

Richard1485
27th April 2014, 19:37
The script that I posted discards the LFE, which is what Dolby recommends. You can, of course, mix the LFE if you wish.

I'm only concerned about the dynamic range because as far as I know, players do DRC compression if the AC3 is flagged that way. I didn't know that in the case of DTS, this flag doesn't exist.

In that case, you need only the PCM. You mentioned earlier that you successfully used eac3to to split your audio into WAVs. Does this mean that you have access to Arcsoft? If so, forget NicDTSSource and proceed to make your stereo PCM.

zee944
28th April 2014, 09:07
You mentioned earlier that you successfully used eac3to to split your audio into WAVs. Does this mean that you have access to Arcsoft? If so, forget NicDTSSource and proceed to make your stereo PCM.

Yes, I have Arcsoft DTS Decoder.

I'm not sure what do you mean. You mean use eac3to and its -downStereo option?

Richard1485
28th April 2014, 19:31
I mean use eac3to to decode the DTS-HD MA. As I understand it from reading back through the thread, you chose to use NicDTSSource() despite the fact that it decodes only the lossy core because you thought it could apply DRC. Now that you have found that that is not the case, you might as well use Arcsoft

Either use eac3to input output.wav -downstereo if you want the built-in downmix or use eac3to input output.wavs if you want to apply the one I use. Better still, try them both and pick the one you like the best.

zee944
29th April 2014, 14:54
Either use eac3to input output.wav -downstereo if you want the built-in downmix or use eac3to input output.wavs if you want to apply the one I use. Better still, try them both and pick the one you like the best.

Could you modify your script to use the six WAVs and put the LFE into the mix as well? It would be very helpful.

Richard1485
30th April 2014, 00:39
You might as well use the stereo downmix that eac3to uses. The discarding of the LFE is a big part of why I like the mix. But you might ask Tebasuna if he thinks it's possible. He's the expert.