Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th March 2005, 23:01   #1  |  Link
malc0mn^CBK
Registered User
 
Join Date: Mar 2005
Posts: 3
DTS to AC3: your opinions on this guide

Hi al!!

It's me again. Just straigtened out a misunderstanding about my previous post with KpeX (thanks man!).

I'll explain the problem I had, to make the situation clear. I have a DTS only DVD but I have no DTS decoder. So I ripped the DTS track and wanted to properly encode it to AC3.
I started reading a lot of threads on this board and collected various bits of information (like SomeJoes excellent guide).
I studied the DTS an AC3 audio formats from info I could find on the net and on Doom9 and I found that both of them are mastered in a specific way. Remember that I'm specifically referring to DTS and AC3 tracks from movie DVD's, not from music or other DVD's.

I have written a guide, at first for myself, but since I learned a lot on Doom9, I thought it would be appropriate to post it here to aid people who might be in the same situation.

If I have made wrong conclusions or assumptions, please do correct me!

Here we go...

----------------------------------------------------------------------

Purpose
Convert a DTS stream to an AC3 stream with as little quality loss as possible.
Note 1: This method uses a lot of disk space, but it's the only reliable method I could piece together to compensate for the different channel mappings in DTS and AC3.
There is a special BeSweet.dll available that should solve the channel mapping problem, but since it's not that easy to find (nicely tucked away in the Doom9 forums since Feb 2k4), I used the DLL posted on DSPGuru's site.
Note 2: I have read in different sources that you should have the full registered version of WinDVD to pull this off. This seems untrue to me. I legally downloaded the trial version (v6) without registering. You don't even need to launch the program. Just install and follow this guide. I don't think using the trial version in this way is "illegal". Correct me if I'm wrong though!
Note 3: We'll be using Soft Encode to make the actual AC3 file because this way we can optimally use the procedure proposed by SomeJoe. As far as I can tell, ac3enc.dll still has the low volume issue without a decent workaround available (although the new AC3 Machine looked promising).
You can of course use an AC3 encoder a you see fit, as long as it supports the options explained in the first link of the "Reading" section.

Reason
I found loads of bits of information on and via this board but never a full guide (on DTS to AC3!) as there are so many others available here.
Maybe I missed the "full guides" and if so, I do not pretend to have invented this method, I merely pieced it together from other sources of information.

Reading
If you want to understand what you will be doing in step 3/4 where we get and set the AC3 encoder settings, then the following links are a must read:

1. http://forum.doom9.org/showthread.ph...0&pagenumber=1
2. http://www.hometheaterhifi.com/volum...on-6-2000.html

More info on the LFE channel:
3. http://206.225.87.49/volume_7_2/feat...pril-2000.html

Full guidelines on professional Dolby Digital encoding are here:
4. http://www.beussery.com/pdf/beussery.dolby.pdf

Credits
Credit where credit's due: the Doom9 community and all the authors of the used programs. People without whom this guide would not exist are DSPGuru, SomeJoe and Daphy.
Who am I? Does it matter?

Used progs
- WinDVD 6 Gold/Platinum
- Gabest DTS filters (listed in the download section as "DTS / AVI Filters") *
- azidts 0.1 *
- BeSweet DLL 1.5b23 *
- BeSplit 0.9b6 *
- Sonic Foundry Soft Ecnode 1.0
- Adobe Audition/CoolEdit

* You can get all of these programs in one go by using Daphy's BeSweet Installer.

Procedure
1. Open up a shell and cd to your azidts dir
1.1 Call azidts with the following parameters:
Code:
azidts -core( -input "<source>.dts" -output "<destination>-" -6chfloat -logfilea "<logfile>.log" )
This will crate six separate 32bit float wav files named
Code:
<destination>-<channelname>.wav
Note that the "-logfilea" parameter is of course optional.

1.2 The IVIAudio properties window will pop up. Select 6 speaker mode (5.1 channel) and No Vocal in order to get 6 mono wav files.


1.3 If azidts refuses to process your DTS file, then do the following:
open BeSliced (packaged with BeSplit 0.9b6) and drag and drop the DTS file on the window and select Fix File!. Now try step 1.1 again

2. Now we need to mux these mono wav files into one AC3 stream. We'll use Soft Encode for this, so start it up
2.1 Open the mono wav files in the following order: FL, FR, C, SR, LFE, SL.
It is absolutely imperative to respect this file ordering to get correct channel mappings in the resulting AC3 stream! (You can of course change the channel mapping after you've loaded the files, but the above order will immediately give you the right mapping.)
It seems that the BeSweet.dll 1.5b23 wrongly names the resulting mono wavs when converting from DTS (as reported several times in the forums here).

Here's what they should be like:
Code:
FL  -> correct
FR  -> C
C   -> FR
LFE -> SR
SL  -> LFE
SR  -> SL
If you don't want the hassle with the wrong channelmappings, you can always use the special BeSweet.dll (or use Daphy's BeSweet Installer) which fixes this problem.

2.2 You now have a graph of all your channels. If you have a true 5.1 movie mix, all of the dialog will be concentrated on the centre channel, as you should be able to see by looking at the graph. This will in most cases be so, since we started from a "movie" DTS to begin with.


3. Open up CoolEdit or Adobe Audition and load the centre channel wav file (named *-FR.wav)
3.1 Go to Analyze/Statistics. Abort the scan if it starts automatically.
3.2 In the RMS Settings section select 0dB = FS Sine Wave and check Account for DC. Leave the Window Size set to 50ms. I have tried increasing this value but other than the RMS calculation taking somewhat longer, it never truly changed the average RMS power. (For clarification of these settings, see "Additional comments" and read the first link in the "Reading" section.)


3.3 Recalculate the RMS values and note the Average RMS Power value. Mostly you will see this number floating around -27dB. That is because this is somewhat the "standard" value used in the movie industry to mix the dialogue to since it produces a natural level for conversation (read link 2 in the "Reading" section for more info on this). Also make a note of the DC Offset value.


4. Go back to Soft Encode and go to Options/Encode Settings...
4.1 Set Data Rate to 448kbps and check Auto for the sample rate.


4.2 Audio encoding mode should be 3:2 (L, C, R, l, r) with LFE enabled. Unless of course, your DTS source has a different channel setup.


4.3 Bit stream mode should be set to Main audio service: Complete main.
As we all know, you can add multiple elementary audio streams to one movie. One of them is always the "main mix". Others can be directors commentary, a stream with "augmented" dialogue for the hearing impaired and so on.
If you wish to encode a second stream, you can change this setting accordingly. It's just metadata and will not affect playback.
For a full explanation of the bit stream modes, read the fourth link (point 5.4.4) from the "reading" section.


4.4 Set the Dialogue normalisation to the number you noted in 3.3. This is by far the most important setting. If this one is wrong, the resulting AC3 file will not sound as it's supposed to. Read links 1 and 2 in the "Reading" section for clarification.


4.5 Intel byte order is not needed


4.6 In the Bit Stream tab, we see the centre and surround mix channels.
The values shown here will be used to down mix the centre and surround channels when they are not available on the playback system.
If you do not have a centre channel, then the centre channel will be down mixed by the value indicated in respect to the left and right channels. The same goes for the surround channels.
I recommend leaving them at -3dB, unless you feel that the resulting mix on a two channel system is not at all what you expect.


4.7 The copyright bit and original bit stream can be set as you please, this will not affect playback in any way.


4.8 The Info exists checkbox will allow you to add metadata about how the AC3 stream was mixed. The mix level can help the decoder to produce playback that is more consistent with the original mix. Room type is usually not used by the decoder, but might still be useful by other parts in the decoding chain.
Since we cannot tell how and where the original DTS mix was done, I recommend unchecking Info exists.


4.9 On the Preprocessing tab we have the Input filtering checkboxes.
Digital deemphasis will apply a de-emphasis filter on the encoded stream. This should only be used if an emphasis filter was applied on the source material. I doubt that this will be the case, unless you did that yourself or are encoding quite old material (in the beginning of the Audio CD, old recordings used emphasis to "enhance" the sound on the CD). I recommend leaving it unchecked.
DC high-pass filter is used to remove any DC offset that might be present in your source files. You should have spotted that in 3.3 if this is the case. For best results, leave this turned on. If there is an offset, it will be removed. If not, no harm done.
Bandwidth low-pass filter should be turned on. The cut-off frequency will be close to the Audio bandwidth you can see on the left.
LFE low-pass filter is not really needed when converting from DTS. DTS recommends cutting off the LFE at 80Hz and AC3 asks to do so at 120Hz. We can thus conclude that our LFE channel has nothing above 120Hz so we can safely turn off this filter.


4.10 The surround channel processing settings then.
90 degrees phase shift will apply a 90 degree phase shift to the surround channels, which is useful when the stream will be down mixed to two channels by the decoder. Since this option does not exist with a DTS encoder and thus was not used in the DTS stream we started with, I recommend always turning this on.
3 db attenuation will lower the surround channels by 3 db. When encoding an original cinema stream for home use (DVD distribution etc.) this is useful because the surround channels in a cinema mix are usually mixed 3 db "too high" to compensate for cinema amplifier gains. This feature is also available in DTS encoders, so we can be pretty sure that it was applied when encoding our DTS stream for DVD distribution if the mixer did a proper job (unless your DTS stream came from a different source).
I'd say it's safe to turn it off. No need to lower the surround channels twice!


4.11 The compression characteristics relevant to us are Film: Standard, which is recommended for most movies, and Film: Light, which you can use if you want a little more range.
If you have a blasting action movie with a lot of explosions etc, you might want to choose "Standard". Light might be better for a more "quiet" movie without such extremes as mentioned before. I mostly go for Standard.
The "null band" (in which no audio modification takes place) is 10 dB for Standard and 20 dB for Light.
A full explanation of the options can be found in link four (point 4.2.2) in the "Reading" section.
Turning off the DRC is only useful if you have pre-limited material which already falls within an acceptable range for home theatre playback.
RF overmodulation protection is only valid if you will use the stream for broadcasting purposes. For DVD mastering we do not need this at all!
The two small graphs show the area (in red) in which no alteration of the sound will take place. All of the dialog should be in this area with the dialogue normalization as its centre point.


4.12 The final tab is of no use to us at all, so leave everything turned off.
4.13 Hit OK and go to File/Save As... to start encoding.


Additional comments
1. Step 3.2, options explained (from the manual):

0dB = FS Sine Wave sets the dB level of the RMS settings to correspond to a full-scale sine wave (where peak amplitude is at 0 dB, using every sample value in the 16-bit range).
=> We need that to comply with the Dolby dbFS logic (see first link in the "Reading" section)
0dB = FS Square Wave sets the dB level of the RMS settings to correspond to a full-scale square wave, where peak amplitude is about 3.02 dB louder than a full-scale sine wave.

Account For DC subtracts any DC offset to achieve the most accurate RMS values.
=> We want to be as accurate as we can get

Window Width specifies the number of milliseconds in each RMS window. A selected range contains a series of such windows, which Adobe Audition averages to calculate the Minimum RMS and Maximum RMS values. To achieve the most accurate RMS values, use wide windows for audio with a wide dynamic range, and narrow windows for audio with a narrow dynamic range.

2. Maven3D.com must have aquired Soft Encode and incorporates it in their "Maven 3D Pro" suite. Take a look at the product page:
http://maven3d.com/en/features.asp?PID=1#ID401
Specifically check the AC3 encoder. I'm just guessing here, but I find it pretty apparent!

So if you like Soft Encode and would like a "newer version" (and you may take that very lightly) then this might be something to check out. Demo versions are available for download.
__________________
"...the rest are details." -- Albert Einstein

Last edited by malc0mn^CBK; 11th March 2005 at 14:48.
malc0mn^CBK is offline   Reply With Quote
Old 10th March 2005, 07:55   #2  |  Link
daphy
Miles Freak
 
daphy's Avatar
 
Join Date: Apr 2003
Location: Europe
Posts: 652
Quote:
Note 1: This method uses a lot of disk space, but it's the only reliable method I could piece together to compensate for the different channel mappings in DTS and AC3.
There is a "special" BeSweet.dll available that should solve the channel mapping problem, but since it's not that easy to find (nicely tucked away in the doom9 forums since Feb 2k4), I use the dll posted on DSPGuru's site.
Quote:
2. Now we need to mux these mono wav files into one AC3 stream. We'll use Soft Encode for this, so start it up
2.1 Open the mono wav files in the following order: FL, FR, C, SR, LFE, SL.
It is absolutely imperative to respect this file ordering to get correct channel mappings in the resulting AC3 stream! (You can of course change the channel mapping after you've loaded the files, but the above order will immediately give you the right mapping.)
It seems that the BeSweet.dll 1.5b23 wrongly names the resulting mono wavs when converting from DTS (as reported several times in the forums here).

Here's what they should be like:

code:
FL -> correct
FR -> C
C -> FR
LFE -> SR
SL -> LFE
SR -> SL
a.
use the BesweetInstaller from my side, itīs included - saves you the remapping procedure.

b.
for demuxing use the standard profile in besweetgui -> 6 mono WAV 32 bit saves working with softencode at this point

Quote:
1.3 If azidts refuses to process your DTS file, then do the following:
open BeSliced and drag and drop the DTS file on the window and select Fix File!. Now try step 1.1 again
I guess you need besplit0.7 -> see installer above

Quote:
3. - 4.
plz send some screen shots, makes it much easier to understand

Quote:
So if you like Soft Encode and would like a "newer version" (and you may take that very lightly) then this might be something to check out. Demo versions are available for download.
-> latest (2005/01) HeadAC3 has no problem with silent output, itīs freeware but also has less possibilities

nice work letīs put it together with some screenshots as a complete guide
__________________
CYA Daphy

Last edited by daphy; 10th March 2005 at 08:07.
daphy is offline   Reply With Quote
Old 10th March 2005, 17:11   #3  |  Link
malc0mn^CBK
Registered User
 
Join Date: Mar 2005
Posts: 3
Quote:
b.
for demuxing use the standard profile in besweetgui -> 6 mono WAV 32 bit saves working with softencode at this point
Not sure what you mean by this... I'm not using Soft Encode in the demuxing process...?

Quote:
I guess you need besplit0.7 -> see installer above
Wasn't the only fix in that version the support for open bitrate DTS files...? If you rip the DTS track off a movie DVD, you will always have the bitrate info, or am I wrong there?

Quote:
-> latest (2005/01) HeadAC3 has no problem with silent output, itīs freeware but also has less possibilities
Indeed, definately check it out! But be aware of the lack of several options you do get in a "professional" encoder.

Quote:
nice work letīs put it together with some screenshots as a complete guide
Thanks! How about now?
__________________
"...the rest are details." -- Albert Einstein

Last edited by malc0mn^CBK; 10th March 2005 at 17:13.
malc0mn^CBK is offline   Reply With Quote
Old 13th March 2005, 19:48   #4  |  Link
planet1
... space nerd ...
 
planet1's Avatar
 
Join Date: Feb 2004
Location: Terra
Posts: 151
though I dont quite get why dts->ac3 should be done in the first place, there might be some exceptional cases:

1. only a AC-3 2.0 track on the DVD, besides the DTS 5.1
2. making DVD-Audio compilations out of DTS-CDs and adding AC-3 onto the DVD-video part for maximum compatibility
3. something else ...

anyway here is a quick and dirty alternative (quick = youll see) (dirty = libdts isnt the "best" dts decoder & ffmpeg isnt the "best" ac3 encoder)

tools needed:

foobar2000 v0.8.3 with dts plugin: http://www.saunalahti.fi/cse/foobar2000.php
BeSweet 1.5 beta 29: http://dspguru.doom9.net/
BeLight 0.21 (final): http://belight.corecodec.org/
ffmpeg *latest* CVS: http://www.aziendeassociate.it/cd.asp?dir=/ffmpeg
gui4ffmpeg 1.0: http://www.videohelp.com/tools?tool=gui4ffmpeg


1. Drag your dts file into foobar2000 and convert it to PCM [by picking WAV(PCM, fixed-point) in the Diskwriter output presets], youll get a 6 channel WAVE (PCM) as a result.

If you play that WAVE you will notice it has a correct channel mapping, but unfortunately its not yet suited for ac3 through ffmpeg. That requires rearranging the individual channels in the 5.1 WAVE. For that task BeSweet along with its new GUI BeLight (thx Kurtnoise13, how about adding drag&drop ) is required.

DTS -> foobar2000 - output PCM -> 6ch WAVE



2. Choose the 6ch WAVE as BeLight's input.
Output Format: WAVE , 16 Bit (Six) Mono Waves
Youll end up with six waves named: filname.wav"channel".wav

6ch WAVE -> BeSweet - channel split -> 6 x Mono WAVEs



3. Creating a .mux list to rearrange the channels. Open up a Texteditor and add these six lines in the same order:

filename.wavFL.wav
filename.wavC.wav
filename.wavFR.wav
filename.wavSL.wav
filename.wavSR.wav
filename.wavLFE.wav

save as channel.mux NOT as channel.txt

6 x Mono WAVEs -> Texteditor - channel mapping reorder -> channel.mux


4. Feed that .mux to BeLight - pick as output format: WAV , 16 Bit 5.1 Wave.
If your compare the original 6ch WAVE (foobar2000) and the new 6ch WAVE (BeSweet) they have a different channel mapping!

channel.mux -> BeSweet - merging -> 6ch WAVE (channel disorder)


5. Make sure ffmpeg.exe and GUI4FFMPEG.exe are in the same folder. Start the GUI and open the NEW 6ch WAVE, deactivate the "Process Video Enconding" and pick ac3, a suitable bitrate and 6 Channels in the "Process Audio Encoding" section.
Now hit the "Save File" button to allocate the output file (finalresult.ac3) and "Encode"

The final result is a working dolby digital file.

6ch WAVE -> ffmpeg - AC3 encoding -> AC3 (with correct channel mapping)



Now if someone could only write a foobar2000 ac3 diskwriter plugin (based on ffmpeg) ... hehe
planet1 is offline   Reply With Quote
Old 14th March 2005, 07:22   #5  |  Link
daphy
Miles Freak
 
daphy's Avatar
 
Join Date: Apr 2003
Location: Europe
Posts: 652
Quote:
though I dont quite get why dts->ac3 should be done in the first place, there might be some exceptional cases
There might be some other reason like encoding into another 'new' 5.1 format in future.

DTS to AC3
in my opinion: if youīve got a DTS file - be happy
Your decoding cenario works for shure

Quote:
DTS -> foobar2000 - output PCM -> 6ch WAVE
Itīs the fastest method in the moment!
But I thought I had read a thread (I donīt know where in the moment) that asserts that foobar makes less good quality then decoding via ds-filter.
maybe we should try some comparison
__________________
CYA Daphy
daphy is offline   Reply With Quote
Old 14th March 2005, 14:05   #6  |  Link
ursamtl
Registered User
 
Join Date: May 2004
Location: Montreal
Posts: 729
Quote:
Originally posted by daphy
[B]DTS to AC3
in my opinion: if youīve got a DTS file - be happy
As long as he doesn't create a DVD-Video disc with just the DTS file for the audio. That won't play on systems without a DTS decoder.
ursamtl is offline   Reply With Quote
Old 14th March 2005, 20:47   #7  |  Link
planet1
... space nerd ...
 
planet1's Avatar
 
Join Date: Feb 2004
Location: Terra
Posts: 151
@ursamtl

Yes of course it would be a illegal DVD-Video, because AC-3 or LPCM are mandatory audio streams for DVD-V (actually i think ac3/lpcm could be dropped for MP2 but only for PAL discs).

@daphy

yes of course your right, DTS -> AAC makes sense for DVD-Backups especially in the case when the dts stream is @ 1536 kb/s.

btw foobar2000 correctly handles DTS/AC3 -> AAC (only LC) conversion.
planet1 is offline   Reply With Quote
Old 27th December 2006, 20:48   #8  |  Link
vefve
Registered User
 
Join Date: Nov 2006
Posts: 10
can anybody tell me how to demux DTS 6.1 Discrete to get 7 mono wavs?????????????????????
vefve is offline   Reply With Quote
Old 29th December 2006, 18:04   #9  |  Link
vefve
Registered User
 
Join Date: Nov 2006
Posts: 10
also when i start azidts as soon as IVIAudio properties window pops up it stops responding!!!!!!!
can sum1 tell me what's the problem??????????
vefve is offline   Reply With Quote
Old 30th December 2006, 16:26   #10  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,322
Try using Tranzcode v0.40beta to decode the DTS file instead of azidts.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 31st December 2006, 09:13   #11  |  Link
vefve
Registered User
 
Join Date: Nov 2006
Posts: 10
can tranzcode decode dts es discrete???????
vefve is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.