Converting DTS to AC3
From NMTWiki
| Applicable only for the following: |
|---|
| PCH NMT models: | A100/110/B110 |
|---|---|
| Others NMT's: | HDX/eGreat |
This tutorial will allow you to convert DTS (Digital Theater Systems) Audio Stream in MKV files which Popcorn Hour A-100 cannot play due to licensing issues into AC3 Stream. For those with Popcorn Hour A-110 devices, download the latest firmware to play DTS.
Contents |
Windows
Prerequisites
There are more than one User App written to convert DTS audio to AC3. Heartware's Audioconverter software offers a tutorial and more options and format conversions than most.
- Download and save the MKV AudioConverter (Warning, some anti-virus programs claim it has a trojan. If so, download the .ZIP version instead)
- Run it and allow the software to download and install the utilities (this is by far the easiest method to get all external tools)
- Choose to view the tutorial
- If you didn't allow the software to download the tools, you'll need to download the various utilities required by your conversion (for DTS-to-AC3 you need MKVToolnix, eac3to and DelayCut). To go to the tool's home page, click the globe button next to the tool.
- There is a dts to ac3 website, maybe it can help you. http://www.dts-to-ac3.com/
Converting
- Select the source file with the Browse button
- Name the output file via the Browse button
- Click "Run"
- Sit back and wait for the finished .MKV file
Linux/OS X
Prerequisites
Download and install the following:
- mkvtoolnix - Matroska (MKV) tools
- libdca - DTS to WAV decoder
- aften - WAV to AC3 encoder
Using mkvdts2ac3
Installation
Download the latest stable version of mkvdts2ac3, a bash script for automatic DTS to AC3 conversion in matroska files, and extract the tarball.
Usage
To convert the audio simply run the script with the following command:
/path/to/mkvdts2ac3 /path/to/matroska.file.mkv
The script will automatically extract the DTS track, convert it to AC3, and merge it back into the original file.
If you would not like to retain the DTS track in the final file you can run the script with the -n argument:
/path/to/mkvdts2ac3 -n /path/to/matroska.file.mkv
Once the script has completed it will display the "Total processing time: XXX seconds" and the bash prompt will reappear. You can ensure the AC3 track has been added by running:
mkvmerge -i /path/to/matroska.file.mkv
Step by Step
Get the track information
mkvmerge -i /path/to/matroska.file.mkv
Sample output
Track ID 1: video (V_MPEG4/ISO/AVC) Track ID 2: audio (A_DTS)
This means that the matroska.file.mkv contains two tracks, a video track with id 1 and a DTS track with id 2.
Extract the DTS track
2 is the DTS track ID from the given example.
mkvextract tracks /path/to/matroska.file.mkv 2:/tmp/dts.file.dts
Converting the DTS track to AC3
dcadec -o wavall /tmp/dts.file.dts | aften - /tmp/ac3.file.ac3
Remux the AC3 track into MKV
mkvmerge -o /tmp/matroska.file.mkv /path/to/matroska.file.mkv /tmp/ac3.file.ac3
Verify
mkvmerge -i /tmp/matroska.file.mkv
Sample output
Track ID 1: video (V_MPEG4/ISO/AVC) Track ID 2: audio (A_DTS) Track ID 3: audio (A_AC3)
Delete temporary files
rm /tmp/dts.file.dts /tmp/ac3.file.ac3
Keep the DTS and the AC3 track
Move the /tmp/matroska.file.mkv to the proper directory or overwrite the original file:
mv /tmp/matroska.file.mkv /path/to/matroska.file.mkv
Remove the DTS track
3 is the AC3 Track ID from the given example (see Verify)
mkvmerge -o /tmp/matroska.file.ac3.only.mkv -a 3 /tmp/matroska.file.mkv
Move the /tmp/matroska.file.ac3.only.mkv to the proper directory or overwrite the original file:
mv /tmp/matroska.file.ac3.only.mkv /path/to/matroska.file.mkv
Possible errors
dcadec: error while loading shared libraries: libdca.so.0: cannot open shared object file: No such file or directory
Copy the libdca.so.0 to /usr/local/lib/libdca.so.0 ater you built libdca
If the file is already present in /usr/local/lib and you still get the error, try;
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
You can add the export command to the .sh file.
