Log in

View Full Version : How can I decode a .DTS file to .WAV?


Chainmax
2nd November 2006, 22:08
I am trying to transcode a 5.1 .DTS file to 2.0 Vorbis and was wondering what methods are used today. Is azidts v0.1 still used? If so, would this commandline:

azidts.exe filename.dts filename.wav -c normal -g 6 -L -3db -s dplii

be ok?

Skelsgard
3rd November 2006, 00:56
The -g 6 might give u to much digital clipping cause of the downmixing but the rest itīs OK.

Cheers.

Chainmax
3rd November 2006, 01:15
Why is that and what would you set -g to then? Also, what alternatives to azidts do I have?

Skelsgard
3rd November 2006, 14:54
Cause in the downmixing, the overall output level is raised with each sum of channels.
Usually that sum doesnīt cross but gets very near the digital clipping value (0). If u add a 6dB gain, itīs very likely that u WILL make most of the track (not only the maximum peaks) to reach and exceed the digital clipping.

For dts decoding I use ac3filter thru graphedit. Intervideo and cyberlinkīs decoders are other options too. (But ac3filter is awesome and FREE!!!!)
Cheers.

laserfan
3rd November 2006, 15:28
Cause in the downmixing, the overall output level is raised with each sum of channels.
Usually that sum doesnīt cross but gets very near the digital clipping value (0). If u add a 6dB gain, itīs very likely that u WILL make most of the track (not only the maximum peaks) to reach and exceed the digital clipping.:eek: :confused: :eek:

I converted a 5.1 DTS program to DolbyDigital awhile back, which included converting (extracting?) to PCM, but can't say I was too thrilled with the result. I didn't understand how the various commands/options worked, and still don't.

Ultimately decided to buy a DTS-decoding amplifier instead! :D

No disrespect Skelsgard--I wish I had the understanding that you do!

Chainmax
3rd November 2006, 18:16
Skelsgard: I see, thanks for the explanation. What value would you recommend me to use for the - g switch? I'd try the AC3Filter GraphEdit route, but I never used GraphEdit efore so I'm not going to e as comfortable with it as I am with azid/azidts.


[edit]Not that it matters much since I'm downmixing anyway, but the DTS file is reported as having 5 channels whereas the AC3 versions are reported as having 6. Weird.

Skelsgard
3rd November 2006, 22:59
@laserfan
No offense taken.
Transcoding from DTS to AC3 is not that good an idea, unless is done for compatibility issues (like in your case). In the best scenario, you wonīt hear a difference between them wich means you did a really good transcoding (regarding parameters). But transcoding is in no way gonna make it sound better or get you a cleaner sound. If anything, is gonna mean a loss in quality (that can be imperceptible).

@chainmax
The -g setting will depend on parameters like DRC or DialNorm.
As uīre using DRC, I assume youīre familiar with the way it affects the levels across the entire track.
A fast way to see the effect of the gain value youīre using would be to load into an audio editor like Audacity or audition or soundforge (or any other) a 0dB gain sample and a +6dB gain sample of the track to compare if any clipping is present in your desired gain sample.

Note: to use graphedit.
Youīre gonna need wavdest.ax to be installed. If u donīpt have in your PC, download it, put it the System32 folder, and register it with Start --> Run (Inicio --> Ejecutar) --> regsvr32 wavdest.ax.
Start Graphedit. Go to File --> Render Media File --> select the .DTS.
Then, delete from the chain the filters u donīt need: like the renderer or intermediate filters after AC3filter (if AC3filter is in the chain, leave it. If not, add it along with the rest of the filters).
Go to Graph --> Insert Filters. Unfold the "Directshow Filters" tree. Import Wavdest, File writer (itīll prompt you to choose a filename and extension: whatever.wav), AC3filter if needed, and done.
Connect the ac3 file with AC3filter (if not already connected), this one with WavDest, and finally with File writer (that will appear as "whatever.wav").
Configure Ac3filter to your desired output and hit the PLAY button. Wait till the button goes back to green to know the process is finished. U can open the config dialog of AC3filter during process to see how its going.

Cheers.

Chainmax
3rd November 2006, 23:52
I actually don't know anything about this subject, I got this line for AC3-->WAV with azid a long time ago and figured it could work for DTS-->WAV. I'll try the GraphEdit route though, as it seems simple enough. Thanks for your answers :) http://smilies.vidahost.com/otn/wink/thumb.gif.

Skelsgard
4th November 2006, 01:44
This is what it looks like

http://img288.imageshack.us/img288/6739/graphkn8.jpg

Cheers.

Chainmax
4th November 2006, 03:30
Weird, the .DTS can't be rendered even though I have DTS decoding via libdts enabled on FFDShow and WinVD is installed. I'll give AC3Filter a try then. Will AC3Filter cause conflicts with FFDShow's audio decoder when playing back an AC3 or DTS file?

[edit]No luck. This is the error message I get:

http://img206.imageshack.us/img206/5044/errmsgoh4.png (http://imageshack.us)
(message at the bottom: "Cannot play file. Format is not compatile")

Chainmax
4th November 2006, 15:33
I downloaded and registered DTSAC3Source.ax and now it works perfectly. It's so simple and straightforward that I'll be using it for AC3-WAV too instead of lugging around azid and a text file with the recommended settings. Thanks for the advice :) http://smilies.vidahost.com/otn/wink/thumb.gif.

Chainmax
4th November 2006, 16:19
The resulting WAV sounded like "Alvin and the Chipmunks" and WinAmp didn't report it as stereo and indicated an 89min runtime when it shoiuld be 149min. I used FFDShow's audio decoder with DPLII output and normalization instead of AC3Filter, but I don't think that acused this. Any ideas as to what may have happened?

Skelsgard
4th November 2006, 22:43
Itīs a glitch in AC3filter in wich when u have a given speaker output config (i.e. 3/2 + 1) selected thru the config panel in Start --> Programs, and u create a graph selecting a different speaker output within the graph (i.e. 2/0), AC3filter renders with error. It only happens with the "output speakers" option from within the graph, it can be solved by selecting the desired output speakers from Start --> Programs --> AC3filter, and then importing AC3filter into the graph.

Cheers.

tebasuna51
5th November 2006, 01:30
I am trying to transcode a 5.1 .DTS file to 2.0 Vorbis and was wondering what methods are used today.
One recent method is use BeHappy. You can prepare a job for:

1) Open the 5.1 DTS with the AviSynth decoder NicDtsSource using, or not, the DRC (Dynamic Range Compression).

2) Downmix 5.1 to 2 channels using stereo/dpl I/dpl II/dpl II(+LFE) methods.

3) Normalize to 100%, or less.

4) Encode to ogg with the Average/Variable desired bitrate.

Click "Enqueue", click "Start" and wait. The ogg is obtained without intermediate wav files.

Edit: Warning, with GraphEdit: dts -> ffdshow -> wavdest -> file-writer
I get a broken wav with only 2:03.902 (and clicks) from a dts 2:06.688.
The same dts are decoded ok (2:06.688) with BeHappy-NicDts, Tranzcode and Foobar2000.

Skelsgard
5th November 2006, 03:43
Yeah, itīs that stupid 4Gb limitation for WAVs, that u canīt bypass in graphedit.

I actually forgot about the Vorbis desired output cause of the thread title (still, u can encode to vorbis thru graphedit).

Cheers.

tebasuna51
5th November 2006, 04:08
@Skelsgard, isn't the 4 GB problem because is only 2 minutes 6.688 seconds and there are audible skips in the decoded wav.

Ebobtron
5th November 2006, 09:52
The 4 GB issue is a 32 bit problem FFFF-FFFF is 4,294,967,295. So the next byte 4,294,967,296 = 1-0000-0000.

The wave file header only has 32 bits to describe the file size and the data size. The spec has only the file size to describe the playback length. It effects different players in different ways, note how audacity scans the wave it opens(it trusts that the data fields in the header may be wrong).

The latest wave format spec still allows a solution if an enterprising group would take up the task. That be the formal naming of a chuck and its size in bits. 8 GB wave files would be no trouble at all if you wanted your software to read them.

If you follow the fact chunk thing (debate), whatever. We could have a "size" chunk. It's presents or not would change nothing for Media Player but an application that needed to gobble up two and a half hours of six channel 16 bit wave could do so with ease.

@Chainmax
I was going to suggest that you try NicDtsSource in a script in FilmCutter and then use the Save Audio as Wave feature I added to FilmCutter.

There are some details here (http://forum.doom9.org/showthread.php?t=116739) and here (http://forum.doom9.org/showthread.php?t=97438).

Skelsgard
5th November 2006, 19:28
@tebasuna51
Like Ebobtron said, itīs a header problem.
If u make the calculations a 6ch 16bits 48kHz will mean a (6 x 16 x 48000 / 2 = 576000 bytes/second). 4Gb (as 4294967296 bytes) can only have 4294967296 / 576000 = 7456.54 seconds (like 2 hs 4 minutes tops).
In apps like wavewizard u can bypass this problem by choosing "Ignore size in header --> Always", wich allows to output above 4Gb.
Donīt know of a solution for Graphedit. Maybe a Dump.ax instead of Filewriter or WavDest + File writer can do the trick. It would be a RAW PCM so u would have to import it into audacity or other audio editor to export it back as Wav PCM, wich is more work than most people would like to deal with. Me, Iīm neurotic so i actually like to have full control on every process of the conversion :D .

Cheers.

ukendt
5th November 2006, 19:41
http://perso.orange.fr/alain.mainard/Pc-Horizon/Dvd/Dts/dts.html

tebasuna51
5th November 2006, 20:54
http://perso.orange.fr/alain.mainard/Pc-Horizon/Dvd/Dts/dts.html
azidts don't work without IVIAudio.ax:
"Si par hasard įa ne fonctionnait pas ā la suite de cette manip, il faut peut-ętre avoir le lecteur WinDvd installé sur son ordinateur"

This method need pay a software: WinDVD

@Skelsgard, two problems:
1) The dts ffdshow broken decoder. In my test there are skips losing 3 sec in 126 sec, more than 2%.

2) The 4 GB limit in GraphEdit. I agree with your comment completely. Only a little typo: 6 x 48000 x (16 / 8) = 576000 bytes/second.

BTW, if the downmix (5.1 -> 2) is make in ffdshow/ac3filter the output is stereo and 149min is <2GB:
"89min runtime when it should be 149min. I used FFDShow's audio decoder with DPLII output and normalization"

Skelsgard
6th November 2006, 01:25
@tebasuna51
Yeah, Iīve dealt with the problem in ac3filter and got it working as I posted above. I donīt use ffdshow for ac3 or dts so I havenīt come across any of this issues (the speaker issue and the broken decoding issue). Is it on the latest ffdshow builds (unofficial or not) only?
About the typo: can u believe I actually use the calculator getting the right result just to type the ecuation wrong in the post :D ?

Cheers.

ukendt
6th November 2006, 19:58
This method need pay a software: WinDVD
Not to my knowledge, I don't have windvd, although it comes with most HP.
Not sure where I got this file(long time ago)but it seems to me it may be dl as a free filter here:
http://www.free-codecs.com/download/Nimo_Codec_Pack.htm
And You don't need installing the whole bunch, just install the file

Chainmax
8th November 2006, 00:07
The ~2.5h file I transcoded using Skelsgard's method and his fix to the issue seemed fine. Then again, ~2.5h of stereo 48Khz audio does occupy less than 4Gb.

miztadux
21st November 2006, 16:48
Hello,

I used azidts.exe + WinDVD Filter (ivaudio.ax) to decode DTS files numerous times, the results were good but the problem was it was "real time" and thus took a long time to decode and depended on a proprietary piece of software ...
The problem at the time was that there were no "open" nor "homebrew" implementation of a DTS decoder (due to licensing) and ivaudio.ax was the only option.

The last time I checked there was an open decoder for DTS, developed for VLC, called "libdts" but it wasn't easily available due to licensing restriction and was in early stages of development (read incomplete/unstable)
This decoder was part of VLC but also available in command line "dtsdec.exe" and as a foobar plugin

After googling it seems to have been renamed to libdca and still be in alpha stage.

http://developers.videolan.org/libdca.html

To be honest I'm surprised to see the azidts.exe method still being used, I'd though the "libdts" method would be more stable now and thus the azidts method would be obsolete....
And so I got some questions:
- Is the libdts method still incomplete/unstable ?
- What about the foobar2000 method (which was also based on libdts)?
- I see in the post that the new AC3Filter can decode DTS now, is it based on libdts or some other implementation ?
- Same question for NicDtsSource

Thanks !

tebasuna51
21st November 2006, 17:48
...
To be honest I'm surprised to see the azidts.exe method still being used, I'd though the "libdts" method would be more stable now and thus the azidts method would be obsolete....
And so I got some questions:
- Is the libdts method still incomplete/unstable ?
- What about the foobar2000 method (which was also based on libdts)?
- I see in the post that the new AC3Filter can decode DTS now, is it based on libdts or some other implementation ?
- Same question for NicDtsSource
I agree with you about azidts.
There are a few methods using libdts/libdca, for instance
Tranzcode (http://forum.doom9.org/showthread.php?t=93926), foo_dts, NicAudio, AC3Filter (not tested for me) and ffdshow.
For me Tranzcode, NicAudio and foo_dts works ok but ffdshow maybe have a bug with 44100 Hz (http://forum.doom9.org/showthread.php?t=118111)

Ebobtron
21st November 2006, 17:49
Nic's readme names one source

FilmShrink.sf.net - Attila T. Afra

tebasuna51
21st November 2006, 19:06
Nic's readme names one source

FilmShrink.sf.net - Attila T. Afra
In FilmShrink_033_src:
Gildas Bazin
libdts/libdca
http://www.videolan.org/libdca.html

miztadux
21st November 2006, 20:40
Ok, thanks for your answers and the link to Tranzcode...