Log in

View Full Version : Extract core with eac3to and tsmuxer spectrum different


theliver9x
1st November 2019, 06:19
I extract core audio from dts-hd with eac3to and with tsmuxer, then compared the two dts files and it have different hash, the spectrum is also different, why is there a difference here?

tebasuna51
1st November 2019, 10:29
tsMuxeR is a muxer, like extractor not always work fine.

Please remember rule 8:

8) No cross posting. Post your message once, to the appropriate forum and nowhere else or it will be locked or deleted without warning.

theliver9x
1st November 2019, 14:39
tsMuxeR is a muxer, like extractor not always work fine.

Please remember rule 8:
Thanks, so eac3to extract is exactly bit and bit?

tebasuna51
2nd November 2019, 10:11
Yes, the core extraction from DTS-HD with eac3to always work fine for me.

theliver9x
2nd November 2019, 14:54
Yes, the core extraction from DTS-HD with eac3to always work fine for me.
I have a dts-hd music and it has a 16bit core, when i demux core and it automatically convert to 24bit, so i added the dontPatchDts command so it doesn't convert to 24bit, i will get a 16bit perfect? I wonder why it turned into 24bit?

sneaker_ger
2nd November 2019, 14:56
DTS cores don't have any inherent bitdepth (same for many other lossy format, e.g. AC3, AAC). You can ignore what MediaInfo tells you about it after core extraction. Only the lossless DTS-HD Master Audio "has" a bitdepth in any meaningful way. Do not use -dontPatchDts.

theliver9x
3rd November 2019, 06:54
DTS cores don't have any inherent bitdepth (same for many other lossy format, e.g. AC3, AAC). You can ignore what MediaInfo tells you about it after core extraction. Only the lossless DTS-HD Master Audio "has" a bitdepth in any meaningful way. Do not use -dontPatchDts.
Thanks for some useful information. So change bit is only change the title, right? It's like change the tag and the audio data inside won't change and won't be distorted?

tebasuna51
3rd November 2019, 13:25
I have a dts-hd music and it has a 16bit core, when i demux core and it automatically convert to 24bit, so i added the dontPatchDts command so it doesn't convert to 24bit, i will get a 16bit perfect?

Nope, the core is lossy then the 16 bit it's not perfect, only the DTS-HD is 16 bit perfect.

I wonder why it turned into 24bit?

Like the core is not perfect the best aproach to the perfection is decode the core to 24 bits at least.
Some decoders read this metadata to output 24 bit int (the internal decoder precission is 32 bits float) instead only 16 bit less accurate.

theliver9x
3rd November 2019, 13:32
Nope, the core is lossy then the 16 bit it's not perfect, only the DTS-HD is 16 bit perfect.



Like the core is not perfect the best aproach to the perfection is decode the core to 24 bits at least.
Some decoders read this metadata to output 24 bit int (the internal decoder precission is 32 bits float) instead only 16 bit less accurate.
So change bit to 24 is only change the title, right? It's like change the tag and the raw audio data inside won't change and won't be distorted?

tebasuna51
4th November 2019, 12:03
Of course only the metadata in header is changed, the raw audio data remain the same.

theliver9x
11th November 2019, 04:16
Of course only the metadata in header is changed, the raw audio data remain the same.
I have one more question, i tried converting a mono wav file to dts-hd and then i extracted dts-hd to wav again, in my opinion, dts-hd is lossless and not loss, i compared hash of the original wav file and the wav file i extracted from dts-hd but both are not the same, i have learned more and there is some information saying that remove wav header and it will be the same, so how do i delete the wav file header that has been extracted with arcsoft in eac3to?

tebasuna51
11th November 2019, 11:26
You an use eac3to to remove wav headers:

eac3to input.wav output1.pcm

To decode DTS-HD use libdcadec.dll (the eac3to default) arcsoft have some bugs.
Encode your input.wav to dtshd and directly:

eac3to input.dtshd output2.pcm

and after compare output1 with output2

theliver9x
11th November 2019, 11:41
You an use eac3to to remove wav headers:

eac3to input.wav output1.pcm

To decode DTS-HD use libdcadec.dll (the eac3to default) arcsoft have some bugs.
Encode your input.wav to dtshd and directly:

eac3to input.dtshd output2.pcm

and after compare output1 with output2
I have compared the two pcm files and they are not the same.

filler56789
12th November 2019, 06:16
I have compared the two pcm files and they are not the same.

This thread explains it all: https://forum.doom9.org/showthread.php?t=168133

tebasuna51
12th November 2019, 09:52
Of course can have some extra silence at end to complain the granularity of 11 ms in DTS.

theliver9x
12th November 2019, 10:38
Of course can have some extra silence at end to complain the granularity of 11 ms in DTS.
I have found the reason for the output is not the same as the original, because when encoder to dts-hd with MAS it add delay to the file, when eac3to extract to wav and it apply delay, eac3to without removing delay and apply to file output.
If i want to check dts-hd have delay or not, what software should i use to check it?
You can give me link download of LeeAudBi4?

tebasuna51
13th November 2019, 11:45
The strict DTS stream don't have any info about the delay included by MAS.
When MAS create a DTS the output have a extra initial header (DTSHDHDR) with some info.

Note: Authoring tools shall use the Codec_Delay_At_Max_Fs and the
Samples_Per_Frame_At_Max_Fs to determine the number of encoded frames that
initially must to be skipped (i.e., excluded from the disc).

This header is for Authoring tools only, the DTS stream can't have this header and the initial frames must be excluded.

You can read this header (from a file with extension .dtshd) with my LeeAudBi5: https://www.sendspace.com/file/2nwuq1

theliver9x
13th November 2019, 13:34
The strict DTS stream don't have any info about the delay included by MAS.
When MAS create a DTS the output have a extra initial header (DTSHDHDR) with some info.



This header is for Authoring tools only, the DTS stream can't have this header and the initial frames must be excluded.

You can read this header (from a file with extension .dtshd) with my LeeAudBi5: https://www.sendspace.com/file/2nwuq1
Thanks for good some information, so dts-hd on the bluray movie disc have delay or not? And what do i need to do to know if it is have delay or not?

tebasuna51
14th November 2019, 10:34
In a container like m2ts (BD) or mkv the header DTSHDHDR don't exist but the container can have delays for any track.

When extract with eac3to must correct any delay in DTS tracks deleting/inserting frames, like standard frames are ~11 ms you can obtain a error less than +-6ms.

theliver9x
17th November 2019, 06:10
In a container like m2ts (BD) or mkv the header DTSHDHDR don't exist but the container can have delays for any track.

When extract with eac3to must correct any delay in DTS tracks deleting/inserting frames, like standard frames are ~11 ms you can obtain a error less than +-6ms.
Let me ask more, dts 1509kbps 6 channels, so each internal channel will have a bitrate is 251kbps?

tebasuna51
17th November 2019, 12:52
Is not so simple:

"... joint intensity coding and sum/difference coding may be employed to further improve audio quality. The
optional LFE channel is compressed by: low-pass filtering, decimation and mid-tread scalar quantization."

The LFE channel without high frequencies need only a low bitrate to be encoded.
And some channels can be joined to optimize compression, and front channels can have preference for high fequencies over back channels...

filler56789
17th November 2019, 14:49
Let me ask more, dts 1509kbps 6 channels, so each internal channel will have a bitrate is 251kbps?

tebasuna51's answer explained it well, it's not that simple.
But if one wants to simplify anyway [but not too much], one can say that 1509 kbps for 5.1 DTS is (roughly) equivalent to 300 kbps per channel (the ".1" channel not being counted, of course).

Which is overkill, granted. DTS-CD uses 1234.8 kbps @ 44.1 kHz, which is the same as 1344 kbps @ 48 kHz...
Fortunately the BD-specs do allow lower bitrates for 5.1 DTS audio.
Unfortunately the average BD production is lazy and stupid :( :mad:

theliver9x
18th November 2019, 10:35
Is not so simple:

"... joint intensity coding and sum/difference coding may be employed to further improve audio quality. The
optional LFE channel is compressed by: low-pass filtering, decimation and mid-tread scalar quantization."

The LFE channel without high frequencies need only a low bitrate to be encoded.
And some channels can be joined to optimize compression, and front channels can have preference for high fequencies over back channels...
Thanks. And when convert audio, i see a message saying "remapping channel", so what is remapping and it have change the raw audio data or not?

tebasuna51
18th November 2019, 11:38
The channel order inside a compressed stream can have a different order in dts, ac3, aac, etc.
Any decoder output always (remapping) the standard wav (M$) file channel order, any encoder must accept the standard wav order like input.

All is automatic, you don't need do nothing.

theliver9x
19th November 2019, 06:46
The channel order inside a compressed stream can have a different order in dts, ac3, aac, etc.
Any decoder output always (remapping) the standard wav (M$) file channel order, any encoder must accept the standard wav order like input.

All is automatic, you don't need do nothing.
I convert the wav file to ac3 with eac3to, length of ac3 file output is 21ms longer than the original wav, why is it different and what do i have to do to get the ac3 file of the same length as the original wav file?

tebasuna51
19th November 2019, 09:55
You always get a AC3 file duration multiple of 32 ms (if 48 KHz) because a AC3 stream is a set of frames of that length.

The encoders delay the wav file with 256 silence samples (5.33 ms at 48 KHz) and fill the las frame with silence samples until the 32 ms full frame.