Page 1 of 1

Handling the DTS-HD Master 7.1 strange setup

Posted: 2014/09/06 17:29
by ramicio
It's not true that the 7.1 strange setup can't be decoded losslessly. It takes some time, but it can be done. What I do is move the weird channels to M$-defined ones. It might not be correct, but it's better than a low volume and weirdly-mixed 7.1 track, or downmixing it to 5.1 with a decoder I've never been able to locate.

Required tools:
  • eac3to
  • ArcSoft decoder
  • DTS HD Master Suite
  • A hex editor
  • SoX
  • Wavewizard (optional)
  • GoldWave (optional)
  • mkvtoolnix (optional)
  • Tons of disk space (~20 GiB per hour of movie length is a good safety net)
1. Demux the DTS-HD Master track in question. Yes, it needs to be demuxed. This can be done with either mkvtoolnix or eac3to, depending on source. From now on in these instructions, this file will be known as "input.dtshd".

Code: Select all

mkvextract tracks input.mkv <stream number>:original.dtshd

Code: Select all

eac3to <bluray path> <title number>) <stream number>: original.dtshd

Code: Select all

eac3to input.mkv <stream number>: original.dtshd
2. Decode the file to wavs with eac3to.

Code: Select all

eac3to input.dtshd output.wavs
3. Stretch each mono wav to be about a half hour longer than the original. I use SoX for this, but you could use GoldWave. You will have to play around with the math. I used 0.75 here because it's what I used for the files in these instructions. (Note: You can't insert silence into the audio, because silence compresses effortelssly, and we need to make the DTS Suite give us a header for plenty of length.)

Code: Select all

sox -S in.wav out.wav speed 0.75
4. Open up the DTS Suite. Select the "7.1 - L, R, C, LFE, Ls, Rs, Lsr, Rsr" channel layout.

Image

5. Load up the channels as shown below:

Image

6. Make sure to click "Encode Entire File" under "Timecode Settings".

Image

7. Click the "Save To" button to select the path to save to. Once selected it will fill in the name of the file to "DTSENC". There is no need to change it unless you have a weird reason to. Lastly, click the round red "ENCODE" button. Go do some other tasks; it takes a long time.

Image

8. Once the encoding is done, open the resulting "DTSENC.dtshd" and the original "input.dtshd" files in your hex editor.

9. Select the first 140 (8C) bytes of "DTSENC.dtshd" and copy it.

Image

10. Paste that data at the beginning of "input.dtshd" and save it. It's okay to overrite it. If you mess it up, it can always be demuxed again.

Image

11. Open the "input.dtshd" with DTS -HD StreamPlayer under the "Primary Audio" field in the "File Input" panel. Click on the "Playlist" button. In the panel that extended to the right, just single click on "input.dtshd". Click the "Decode to PCM" button and select the output directory. It will stop decoding some time before 100%.

Image

12. Now we will merge, or stitch, the new individual wavs into a single multichannel wav. The M$ channel order for the 7.1 layout we want (0x0000063F) is as follows: Front Left, Front Right, Front Center, LFE, Back Left, Back Right, Side Left, and Side Right. The generated files labeled as "Ls" and "Rs" are going to be the "side" channels. The "Lsr" and "Rsr" files are going to be the "back" channels. I personally use SoX for this, but i will also show you how to do it in Wavewizard.

Code: Select all

sox -S -M input_L.wav input_R.wav input_C.wav input_LFE.wav input_Lsr.wav input_Rsr.wav input_Ls.wav input_Rs.wav final.wav
For Wavewizard, add the files one by one in the order listed above. When done adding them, go to Edit -> Preferences. Set it up as shown in the image below (with the exception of personal prefences of the path or conversion settings). The most important setting here is "Merge Files" under "Stream Manipulation". Click "Ok" to apply the settings and go back to the home screen. Now just click "Convert" and wait.

Image Image

Now you can do whatever you want with the resulting wav file. I encode mine to FLAC with eac3to. As far as the data, it's a bit-perfect decode from the original, with the exception of the channel layout. Who knows, maybe they selected the wrong layout in authoring and meant for it to be standard, and what we're going here is correcting their mistake...

Re: Handling the DTS-HD Master 7.1 strange setup

Posted: 2021/06/13 21:58
by ramicio
This information is now useless, now that LAV codecs include licDCAdec.